Handle empty font variant tables in FontMetrics
This commit is contained in:
@@ -30,7 +30,8 @@ extension Math {
|
|||||||
guard
|
guard
|
||||||
let graphicsFont = FontRegistry.shared.graphicsFont(named: font.name),
|
let graphicsFont = FontRegistry.shared.graphicsFont(named: font.name),
|
||||||
let glyphName = graphicsFont.name(for: glyph) as String?,
|
let glyphName = graphicsFont.name(for: glyph) as String?,
|
||||||
let variantGlyphs = table.vVariants[glyphName]
|
let variantGlyphs = table.vVariants[glyphName],
|
||||||
|
!variantGlyphs.isEmpty
|
||||||
else {
|
else {
|
||||||
return [glyph]
|
return [glyph]
|
||||||
}
|
}
|
||||||
@@ -44,7 +45,8 @@ extension Math {
|
|||||||
guard
|
guard
|
||||||
let graphicsFont = FontRegistry.shared.graphicsFont(named: font.name),
|
let graphicsFont = FontRegistry.shared.graphicsFont(named: font.name),
|
||||||
let glyphName = graphicsFont.name(for: glyph) as String?,
|
let glyphName = graphicsFont.name(for: glyph) as String?,
|
||||||
let variantGlyphs = table.hVariants[glyphName]
|
let variantGlyphs = table.hVariants[glyphName],
|
||||||
|
!variantGlyphs.isEmpty
|
||||||
else {
|
else {
|
||||||
return [glyph]
|
return [glyph]
|
||||||
}
|
}
|
||||||
@@ -58,7 +60,8 @@ extension Math {
|
|||||||
guard
|
guard
|
||||||
let graphicsFont = FontRegistry.shared.graphicsFont(named: font.name),
|
let graphicsFont = FontRegistry.shared.graphicsFont(named: font.name),
|
||||||
let glyphName = graphicsFont.name(for: glyph) as String?,
|
let glyphName = graphicsFont.name(for: glyph) as String?,
|
||||||
let variantGlyphs = table.vVariants[glyphName]
|
let variantGlyphs = table.vVariants[glyphName],
|
||||||
|
!variantGlyphs.isEmpty
|
||||||
else {
|
else {
|
||||||
return glyph
|
return glyph
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user