Ejemplo n.º 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;
		}
Ejemplo n.º 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);
		}
Ejemplo n.º 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));
		}
Ejemplo n.º 4
0
		/// <summary> Returns whether the specified glyph represents the placeholder glyph. </summary>
		public static bool IsPlaceholder(Glyph glyph)
		{
			return glyph.Character == placeholderGlyphCharacter;
		}