microsoft / Font-Validator

Font Validator is a tool for testing fonts prior to release. This testing ensures that fonts meet Microsoft's high quality standards and perform exceptionally well on Microsoft's platform.
Other
117 stars 41 forks source link

detect invalid chars in FontName and FontVersion #31

Open HinTak opened 8 years ago

HinTak commented 8 years ago

A few font files I have contains strange things in FontName and FontVersion. This causes problems downstream with XML processing. There should be new error codes for these, and they should be sanitized at the report.

    5472 parser error : xmlParseCharRef: invalid xmlChar value 0
      4 parser error : xmlParseCharRef: invalid xmlChar value 16
      2 parser error : xmlParseCharRef: invalid xmlChar value 65535
HinTak commented 8 years ago

Many of these are old CJK fonts. (and they have non-ascii in those).

HinTak commented 8 years ago

One of them is a currently-in-use font:

$ rpm -qf /usr/share/fonts/gfs-bodoni-classic/GFSBodoniClassic.otf
gfs-bodoni-classic-fonts-20070415-21.fc24.noarch
HinTak commented 8 years ago

Another:

$ rpm -qf /usr/share/fonts/apx/04b03.ttf
apx-fonts-0.1-12.fc24.noarch
HinTak commented 8 years ago

Interestingly in OTFontFileVal/ValDriver.cs line 194, it already does "BAD FONT VERSION" - it just doesn't cover these cases. Also, a new error code is warranted.

HinTak commented 7 years ago

place-holder W0023/W0024

HinTak commented 7 years ago

Sanitization is in dev code.