API for OpenType tables.
Access to MATH
table is fully supported.
harfbuzz | SwiftOpenType |
---|---|
hb_ot_math_has_data | hasData |
hb_ot_math_get_constant | getConstant |
hb_ot_math_get_glyph_italics_correction | getGlyphItalicsCorrection |
hb_ot_math_get_glyph_top_accent_attachment | getGlyphTopAccentAttachment |
hb_ot_math_get_glyph_kerning | getGlyphKerning |
hb_ot_math_get_glyph_kernings | getGlyphKernings, getGlyphKerningCount |
hb_ot_math_is_glyph_extended_shape | isGlyphExtendedShape |
hb_ot_math_get_glyph_variants | getGlyphVariants, getGlyphVariantCount |
hb_ot_math_get_min_connector_overlap | getMinConnectorOverlap |
hb_ot_math_get_glyph_assembly | getGlyphAssembly, getGlyphAssemblyItalicsCorrection, getGlyphAssemblyParts, getGlyphAssemblyPartCount |
do {
let helvetica = CTFontCreateWithName("Helvetica" as CFString, 12.0, nil)
let mathTable = helvetica.createCachedMathTable()
if !mathTable.hasData() {
print("no MATH table")
}
}
do {
let lmmath = CTFontCreateWithName("Latin Modern Math" as CFString, 12.0, nil)
let mathTable = lmmath.createCachedMathTable()
print("axis height, in design units: \(mathTable.getConstant(.axisHeight))")
}
See MathTableTests
OpenTypeSwift is the repository that this codebase evolved from, which supports math constants.
OpenType Specification is the best reference.