This commit is contained in:
Ryan Oldenburg 2021-05-05 16:51:19 -05:00
parent 6a618b9e6b
commit 05889d51e4
2 changed files with 5 additions and 1 deletions

View file

@ -1479,6 +1479,10 @@ proc getAdvance*(opentype: OpenType, rune: Rune): float32 =
result = opentype.hmtx.hMetrics[^1].advanceWidth.float32
proc getKerningAdjustment*(opentype: OpenType, left, right: Rune): float32 =
if left notin opentype.cmap.runeToGlyphId or
right notin opentype.cmap.runeToGlyphId:
return
let
leftGlyphId = opentype.cmap.runeToGlyphId[left]
rightGlyphId = opentype.cmap.runeToGlyphId[right]

View file

@ -4,7 +4,7 @@ import pixie/fontformats/opentype, pixie/fontformats/svgfont, pixie/paths,
const AutoLineHeight* = -1.float32 ## Use default line height for the font size
type
Typeface = ref object
Typeface* = ref object
opentype: OpenType
svgFont: SvgFont