freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft-devel] the fontval error enums, and the freetype-demo ftvalid c-tool


From: Hin-Tak Leung
Subject: [ft-devel] the fontval error enums, and the freetype-demo ftvalid c-tool
Date: Tue, 12 Jul 2016 09:00:15 +0000 (UTC)

Hi,

Now that I have put the new fontval out, I'll say a bit more about the list of 
FontVal error/warning enums. The patch is written the way it is because of what 
I'd think as a limitations of enums in C - enums in C are pre-processed and 
nothing beyond numbers. C# enums aren't just numbers; they know about their own 
names, and really closer to associative arrays (dictionaries) than C's enums.

The list of enums within FontVal are auto-generated from the master 
documentation - it keeps the code and help file in sync. Everywhere it is used 
it is in the symbolic form so the actual number corresponding to a particular 
enum isn't important (so do change as more test errors/warnins are added). 
Between the c<->c# boundary, if I pass a C enum, it means I have to lock the 
value of the number on the C# side. So it is more "future-proof" to pass the 
name of the enum through the c<->c# interface, than the value itself.

I am wonder if it is okay to keep a composite struct list

struct[] FontValErrors = {
{ enum1, "name_of_enum1"},
{ enum2, "name_of_enum2"},
...
}

on the freetype side?

As I have always suspected, my personal stash of (mostly old CJK ) fonts are 
fairly buggy ( 
https://github.com/HinTak/Font-Validator/issues/5#issuecomment-231935786 ) - 
but one use what one can have, CJK-font wise, mostly... - so I have at least 
one test files for about 30 (or half) of the rest of 70+ hinting error / 
warning types. So about at least another 30 enums are coming, eventually. It 
will just take a lot more time to add them gradually all, after the 6 so far.

I think I might add a switch, e.g. -g glypid:size, to ftvalid to hook into the 
diagnostic patch, to look at errors/warnings on specific glyph at a specific 
size. People okay with that?

Hin-Tak
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]