Round x-heights naturally instead of rounding up.

I think this matches what macOS does.
This commit is contained in:
Patrick Walton 2017-11-07 17:39:29 -08:00
parent e5b76726d9
commit 997e9b852a
1 changed files with 4 additions and 4 deletions

View File

@ -302,10 +302,10 @@ export class Hint {
this.hintedXHeight = this.xHeight;
this.hintedStemHeight = this.stemHeight;
} else {
this.hintedXHeight = Math.ceil(Math.ceil(this.xHeight * pixelsPerUnit) /
pixelsPerUnit);
this.hintedStemHeight = Math.ceil(Math.ceil(this.stemHeight * pixelsPerUnit) /
pixelsPerUnit);
this.hintedXHeight = Math.round(Math.round(this.xHeight * pixelsPerUnit) /
pixelsPerUnit);
this.hintedStemHeight = Math.round(Math.round(this.stemHeight * pixelsPerUnit) /
pixelsPerUnit);
}
}