public static bool AttributesMatch <TFont, TGlyph>(this AttributedGlyphRun <TFont, TGlyph> run1, AttributedGlyphRun <TFont, TGlyph> run2) where TFont : IMathFont <TGlyph> { if (run1 is null || run2 is null) { return(false); } return(run1.Font.Equals(run2.Font)); }
public static AttributedString <TFont, TGlyph> Combine <TFont, TGlyph>(AttributedString <TFont, TGlyph> aStr, AttributedGlyphRun <TFont, TGlyph> run) where TFont : MathFont <TGlyph> { if (aStr == null) { return(AttributedStrings.FromGlyphRuns(run)); } else { if (run != null) { aStr.AppendGlyphRun(run); } return(aStr); } }
internal void AppendGlyphRun(AttributedGlyphRun <TFont, TGlyph> run) { _Runs.Add(run); TryFuseRunAt(_Runs.Count - 1); }
public static AttributedString <TFont, TGlyph> Combine <TFont, TGlyph>(AttributedGlyphRun <TFont, TGlyph> run1, AttributedGlyphRun <TFont, TGlyph> run2) where TFont : MathFont <TGlyph> => AttributedStrings.FromGlyphRuns(run1, run2);
public static bool AttributesMatch <TFont, TGlyph>(this AttributedGlyphRun <TFont, TGlyph> run1, AttributedGlyphRun <TFont, TGlyph> run2) where TFont : IFont <TGlyph> => !(run1 is null || run2 is null) && run1.Placeholder == run2.Placeholder && EqualityComparer <TFont> .Default.Equals(run1.Font, run2.Font);