HinTak / 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
146 stars 12 forks source link

CFF further work. #13

Open HinTak opened 8 years ago

HinTak commented 8 years ago

The new CFF checking as of Feb 2016 only parse for INDEX and DICT structures. These are the bulk of the CFF table so just parsing for them already is quite useful.

The 3 structures which are not parsed (yet) are: Charsets, Encodings, and CID FDSelect . An implementation for Encodings is already in my hard disk; only 10 fonts I have use it - 8 from Adobe (Adobe Arabic x4 and Adobe Hebrew x4) plus two toy demo fonts from other dev sources. Not surprising as equivalent functionality should be provided by cmap table in an opentype font. The 10 instances are all bare - i.e. zero-entry skeletal Encoding structure. Charsets seems mandatory, and FDSelect are not rare, so they need to be supported.

Detailed checking of CharStrings would be an ambitious plan - the bulk of Font Validator's code and running time spent is in the glyf table checking, and the rasterization test. Implementing equivalent checks for CFF would be a very long and large project.

HinTak commented 8 years ago

Discussion with Sairus Patel of Adobe on the opentype mailing list clarified that offSize in the header should be the maximum of all the other offSize embedded in the INDEX's.

I think that already covers the cases of offset's inside dictionaries, as dictionaries are part of the TopDICT INDEX ? Need to think a bit more and test that's actually the case.

HinTak commented 7 years ago

suggestion from @Pomax, 3 February, 2016 on the opentype list:

2. any string that _is_ 7-bit clean, but doesn't conform to the postscript
string format, should probably be flagged as "Illegal string format: not
PostScript-compliant" (or variation thereof)
HinTak commented 7 years ago

Copied from top-level readme:

Incomplete CFF checks:

val_CFF.cs I.CFF_I_NotValidated val_head.cs: I._TEST_I_NotForCFF head_MinMaxValues val_hhea.cs: I._TEST_I_NotForCFF hhea_MinMax val_OS2.cs: I._TEST_I_NotForCFF OS/2_xAvgCharWidth

prepare commented 6 years ago

Hello, @HinTak

I just want to notify you that I have some C# code that trying to read CFF in the otf format.

(folder https://github.com/LayoutFarm/Typography/tree/dev/Typography.OpenFont/Tables.CFF)

It works but NOT finish yet.

This may help you too.

:)

example: read CFF, parse CharStrings and render.

latin_4

latin_4_a

pic 1: glyph 4, Latin-Modern-Math-Regular.otf,


please see https://github.com/LayoutFarm/Typography/issues/75

HinTak commented 6 years ago

Thanks - I'll have a look at some point in time.