Re: [ft] Failure in loading U+033F in DejaVu fonts
suzuki toshiya <mpsuzuki <at> hiroshima-u.ac.jp>
2016-05-10 06:30:31 GMT
The naming convention for the types, variables and functions
need further improvement (sorry for my poor English), and some
compiler warnings should be fixed, but anyway I've drafted
a proof of concept. I confirmed it does not complain DejaVu
but detects the recursive reference in the sample files in
please think about the glyph composed like this.
in following, I note the node as a:0, the first "a" is
the glyph id, the second "0" is the recursion count.
now, the component is "pushed" to the list.
after parsing the first chain, composites would be like:
[ e:4, d:3, c:2, b:1, a:0 ]
when we push the first node in the 2nd chain, f:1,
the list is rotated until the node whose recursion count
is less than "1" (of f:1). For this rotation, I introduced
the rotated result is
[ a:0, e:4, d:3, c:2, b:1 ]
now, we scan until the root glyph 0) from the beginning.
if we find any "f" component, it could be recursive.
if there is no, we push f:1 to the head.
[ f:1, a:0, e:4, d:3, c:2, b:1 ]
by such rotate-then-push process, we can use single chain
to scan single chain from a given node to root.
to store the data like "a:0", I introduced a structure
typed as TT_GlyphDecompose (including gid & recurse_count).
therefore, for the memory manager, the cost becomes twice.
original implementation used FT_ListNode->data to store GID.
The memory manager just allocated & freed the node, but,
in my preliminary implementation, the memory manager works
twice - FT_ListNode and TT_GlyphDecompose storage.
Should I consider overwriting (and extend if required)
storategy, to minimize the memory management?
Werner LEMBERG wrote:
>> It seems that the changeset 758d55e522eb426dad2f15adc1d945f7896d7b29
>> (between 2.6.1 and 2.6.2) is the point that FT2 starts the complain
>> against DejaVu. The changset was introduced to detected looped
>> reference. [...]
> Thanks for your analysis. It seems that the test to protect against
> recursion is a bit too simple.
>> I guess the composite glyphs referring same component twice or more
>> can cause this warning. I will try to fix it...
Freetype mailing list
Freetype <at> nongnu.org