/// <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; }
/// <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); }
private NameInstance GetMutation(Glyph newGlyph, int palpableIndex) { //no registering of an event handler necessary return ToNameInstance(newGlyph.Character, newGlyph.Markup, new LinearPosition(palpableIndex)); }
/// <summary> Returns whether the specified glyph represents the placeholder glyph. </summary> public static bool IsPlaceholder(Glyph glyph) { return glyph.Character == placeholderGlyphCharacter; }