Example #1
0
		/// <summary> Gets the advance width of this character in device-independent units. </summary>
		private double GetAdvanceWidth(Glyph glyph)
		{
			return GlyphRunViewModel.glyphFace.AdvanceWidths[glyph.Index] * glyph.Size;
		}
Example #2
0
		/// <summary> Handles adding a new glyph. </summary>
		private void AddNewGlyphsMutation(Glyph newGlyph, int palpableIndex, BoxViewModel glyphReceiver)
		{
			Func<IEnumerable<NameInstance>> mutation = () => GetMutation(newGlyph, palpableIndex).ToSingleton();
			GetCollectionToAddTo(GetRoute(glyphReceiver)).Add(palpableIndex, mutation, true);
			//() => EnumerableExtensions.Zip(newGlyphs.Select(glyph => glyph.Character),newGlyphs.Select(glyph => glyph.Markup),Enumerable.Range(0, int.MaxValue).Select(i => new LinearPosition(palpableIndex + i)),ToNameInstance),true);
		}
Example #3
0
		private NameInstance GetMutation(Glyph newGlyph, int palpableIndex)
		{
			//no registering of an event handler necessary
			return ToNameInstance(newGlyph.Character, newGlyph.Markup, new LinearPosition(palpableIndex));
		}
Example #4
0
		/// <summary> Returns whether the specified glyph represents the placeholder glyph. </summary>
		public static bool IsPlaceholder(Glyph glyph)
		{
			return glyph.Character == placeholderGlyphCharacter;
		}