asukiasov / noto

Automatically exported from code.google.com/p/noto
0 stars 0 forks source link

Tests for advance width of whitespace #329

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The attached python script is a contribution by Sascha Brawer, CC-ed. 

Please consider integrating into noto_lint.py, with whatever change necessary. 
Some tolerance for error may need to be added too.

Here's the output of the script:
FAIL: fonts/individual/hinted/NotoSans-Bold.ttf: Horizontal advance width of 
U+2006 (glyph #581) is 342, but should be 341
FAIL: fonts/individual/hinted/NotoSans-Bold.ttf: Horizontal advance width of 
U+2007 (glyph #582) is 1145, but should be 1171
FAIL: fonts/individual/hinted/NotoSans-Bold.ttf: Horizontal advance width of 
U+2008 (glyph #583) is 584, but should be 1171
FAIL: fonts/individual/hinted/NotoSans-Bold.ttf: Horizontal advance width of 
U+2009 (glyph #584) is 410, but should be 409
FAIL: fonts/individual/unhinted/NotoSans-Bold.ttf: Horizontal advance width of 
U+2006 (glyph #581) is 342, but should be 341
FAIL: fonts/individual/unhinted/NotoSans-Bold.ttf: Horizontal advance width of 
U+2007 (glyph #582) is 1145, but should be 1171
FAIL: fonts/individual/unhinted/NotoSans-Bold.ttf: Horizontal advance width of 
U+2008 (glyph #583) is 584, but should be 1171
FAIL: fonts/individual/unhinted/NotoSans-Bold.ttf: Horizontal advance width of 
U+2009 (glyph #584) is 410, but should be 409
FAIL: fonts/individual/hinted/NotoSans-BoldItalic.ttf: Horizontal advance width 
of U+2006 (glyph #581) is 342, but should be 341
FAIL: fonts/individual/hinted/NotoSans-BoldItalic.ttf: Horizontal advance width 
of U+2007 (glyph #582) is 1145, but should be 1128
FAIL: fonts/individual/hinted/NotoSans-BoldItalic.ttf: Horizontal advance width 
of U+2008 (glyph #583) is 584, but should be 1128
FAIL: fonts/individual/hinted/NotoSans-BoldItalic.ttf: Horizontal advance width 
of U+2009 (glyph #584) is 410, but should be 409
FAIL: fonts/individual/unhinted/NotoSans-BoldItalic.ttf: Horizontal advance 
width of U+2006 (glyph #581) is 342, but should be 341
FAIL: fonts/individual/unhinted/NotoSans-BoldItalic.ttf: Horizontal advance 
width of U+2007 (glyph #582) is 1145, but should be 1128
FAIL: fonts/individual/unhinted/NotoSans-BoldItalic.ttf: Horizontal advance 
width of U+2008 (glyph #583) is 584, but should be 1128
FAIL: fonts/individual/unhinted/NotoSans-BoldItalic.ttf: Horizontal advance 
width of U+2009 (glyph #584) is 410, but should be 409

Original issue reported on code.google.com by roozbeh@google.com on 8 Apr 2015 at 7:35

Attachments:

GoogleCodeExporter commented 9 years ago
changes in branch lint_whitespace, r6c1305e34a9f

I left one font unit of slop around the tests, rounding error etc.  MS's 
document specifies a different value (1 off) for one of these than the rounded 
value I get.

Sascha's code was not using the right character for the '.' width, so the 
values there were off.  But for that, the new code generates the same values 
his did (modulo my rounding changes). I report fewer problems since I accept 
the off-by-one values.

Roozbeh, can you look the code over?

Original comment by dougf...@google.com on 8 Apr 2015 at 11:46

GoogleCodeExporter commented 9 years ago
Doug, can you point to the MS's document you're talking about?

Original comment by roozbeh@google.com on 9 Apr 2015 at 2:31

GoogleCodeExporter commented 9 years ago
Found the MS document (it's in the code). Reviewing the code now.

Original comment by roozbeh@google.com on 9 Apr 2015 at 2:33

GoogleCodeExporter commented 9 years ago
I just posted my comments on the code at r6c1305e34a9f.

Original comment by roozbeh@google.com on 9 Apr 2015 at 2:57

GoogleCodeExporter commented 9 years ago
Fixes in r68c309a4aedd.

Original comment by dougf...@google.com on 9 Apr 2015 at 7:46

GoogleCodeExporter commented 9 years ago

Original comment by dougf...@google.com on 27 Apr 2015 at 10:35