freetype-devel
[Top][All Lists]
Advanced

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

[ft-devel] [patch] distinguish overlapped and unsorted segments in cmap


From: Chia-I Wu
Subject: [ft-devel] [patch] distinguish overlapped and unsorted segments in cmap format 4
Date: Mon, 28 Nov 2005 20:23:25 +0800
User-agent: Mutt/1.5.11

Hi,

The problem I mentioned in the last mail is solved by replacing the bool
`cmap->unsorted' by `cmap->flags.'  So here is the patch.

For "bad" fonts, the improvement is great, since we can do binary search
now:

bkai00mp.ttf
-------------
(original)
Get_Char_Index                 : 31.956 us/op
Charmap iteration              : 454657.805 us/op

(new)
Get_Char_Index                 : 0.376 us/op
Charmap iteration              : 1274.315 us/op

As for "good" fonts, there is no big impact on them.  FT_Get_Char_Index
is slightly slower partly because of function call overhead, i.e.
`char_index' and `char_next' are wrappers to the same function.  I have
not yet check how other cmap classes implment `char_index' and
`char_next'.  If it turns out only one function is needed, we can change
the cmap class interface and the overhead disappears.

Charmap iteration is faster for unknown reason :-)

Vera.ttf
-------------
(original)
Get_Char_Index                 : 0.191 us/op
Charmap iteration              : 25.127 us/op

(new)
Get_Char_Index                 : 0.209 us/op
Charmap iteration              : 23.035 us/op

Please test if fonts still work correctly, "good" or "bad".  Also,
please let me know if you find other fonts which is "bad" too.
(according to the comments in the code, they are Asian fonts.  I am kind
of afraid it only refers to bkai00mp.ttf.)

-- 
Regards,
olv

Attachment: cmap.4.patch
Description: Text document


reply via email to

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