Skip to content

Commit 06c19f8

Browse files
committed
Implemented GetHorizontalGlyphAssembly
1 parent 6109461 commit 06c19f8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

CSharpMath.Core.Example/BackEnd/JsonMathTable.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,15 @@ public override float GetTopAccentAdjustment(TFont font, TGlyph glyph) {
219219
}
220220
}
221221

222-
public override IEnumerable<GlyphPart<TGlyph>>? GetHorizontalGlyphAssembly(TGlyph rawGlyph, TFont font) => throw new System.NotImplementedException();
222+
public override IEnumerable<GlyphPart<TGlyph>>? GetHorizontalGlyphAssembly(TGlyph rawGlyph, TFont font) => _assemblyTable[GlyphNameProvider.GetGlyphName(rawGlyph)]?[_assemblyPartsKey] is JArray parts
223+
? parts.Select(partInfo =>
224+
new GlyphPart<TGlyph>(
225+
GlyphNameProvider.GetGlyph(partInfo[_glyphKey]!.Value<string>()!),
226+
FontUnitsToPt(font, partInfo[_advanceKey]!.Value<int>()),
227+
FontUnitsToPt(font, partInfo[_startConnectorKey]!.Value<int>()),
228+
FontUnitsToPt(font, partInfo[_endConnectorKey]!.Value<int>()),
229+
partInfo[_extenderKey]!.Value<bool>()))
230+
// Should have been defined, but let's return null
231+
: null;
223232
}
224233
}

0 commit comments

Comments
 (0)