We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a17c3fe commit bc1460bCopy full SHA for bc1460b
src/pixie/fonts.nim
@@ -85,6 +85,11 @@ proc lineHeight*(typeface: Typeface): float32 {.inline, raises: [].} =
85
# The descent is negative number, so this is really ascent + descent + lineGap.
86
typeface.ascent - typeface.descent + typeface.lineGap
87
88
+proc capHeight*(typeface: Typeface): float32 {.raises: [].} =
89
+ ## The font cap height value in font units.
90
+ if typeface.opentype != nil:
91
+ result = typeface.opentype.os2.sCapHeight.float32
92
+
93
proc underlinePosition(typeface: Typeface): float32 =
94
if typeface.opentype != nil:
95
result = typeface.opentype.post.underlinePosition.float32
0 commit comments