aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-09-20 22:46:15 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-09-20 22:46:15 +0000
commita1cd3769a3fd425d5e40a250420c5141698cb897 (patch)
treeff83b964c07bc32b655d3d72c88908857f41d86a
parentrender: remove assertion that isn't always true (diff)
main: round strikeout position, and ceil strikeout thickness
This fixes an issue where sometimes the strikeout thickness where truncated to 0 (e.g. Cascadia Code). Note that we already do this for the underline calculations.
-rw-r--r--main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.c b/main.c
index 2716addd..6e2bc1d7 100644
--- a/main.c
+++ b/main.c
@@ -643,8 +643,8 @@ main(int argc, char *const *argv)
TT_OS2 *os2 = FT_Get_Sfnt_Table(ft_face, ft_sfnt_os2);
if (os2 != NULL) {
- f->strikeout.position = os2->yStrikeoutPosition * x_scale / 64.;
- f->strikeout.thickness = os2->yStrikeoutSize * x_scale / 64.;
+ f->strikeout.position = round(os2->yStrikeoutPosition * x_scale / 64.);
+ f->strikeout.thickness = ceil(os2->yStrikeoutSize * x_scale / 64.);
}
if (f->strikeout.position == 0.) {