Skip to content

Commit

Permalink
[tx] [ufowrite] use floor instead of round for underline values
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-hadley committed Jul 13, 2022
1 parent 4b71f56 commit fa00f4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions c/shared/source/ufowrite/ufowrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,13 +833,13 @@ static int writeFontInfo(ufwCtx h, abfTopDict *top) {

if (top->UnderlinePosition != cff_DFLT_UnderlinePosition) {
writeLine(h, "\t<key>postscriptUnderlinePosition</key>");
sprintf(buffer, "\t<integer>%d</integer>", (int)round(0.5 + top->UnderlinePosition));
sprintf(buffer, "\t<integer>%d</integer>", (int)floor(0.5 + top->UnderlinePosition));
writeLine(h, buffer);
}

if (top->UnderlineThickness != cff_DFLT_UnderlineThickness) {
writeLine(h, "\t<key>postscriptUnderlineThickness</key>");
sprintf(buffer, "\t<integer>%d</integer>", (int)round(0.5 + top->UnderlineThickness));
sprintf(buffer, "\t<integer>%d</integer>", (int)floor(0.5 + top->UnderlineThickness));
writeLine(h, buffer);
}

Expand Down

0 comments on commit fa00f4d

Please sign in to comment.