freetype-devel
[Top][All Lists]
Advanced

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

RE: [ft-devel] latest patch file for spline flattening


From: David Bevan
Subject: RE: [ft-devel] latest patch file for spline flattening
Date: Tue, 7 Sep 2010 12:39:12 -0400

Here are some test results with Latin fonts (40 thousand curves from fonts at 
various point sizes).

Trace results:
                                  
                                 CJK     CJK     CJK     LATIN   LATIN
                                 OLD     NEW     HAIN    NEW     HAIN
average line segs per arc        13.5     11.3    2.1     30.9    6.1
max line segs per arc            32      133     16      163     18

average deviation per line seg    0.29     0.44   6.5      0.37   7.4
max deviation per line seg       22.2     15.8   15.7      7.9   15.7

Performance results:

In gray_convert_glyph, the time is distributed as follows:

                  CJK    CJK    CJK     LATIN  LATIN
                  OLD    NEW    HAIN    NEW    HAIN
render_line       20%    15%     12%    14%    11%
render_cubic      15%    33%      9%    34%    11%
render_scanline   14%    10%     10%    10%    11%
split_cubic        6%     9%      2%    10%     3%

Including children, we have the following actual times per call for handling 
cubic curves:

                  CJK    CJK    CJK     LATIN   LATIN
                  OLD    NEW    HAIN    NEW     HAIN
render_cubic      142us  220us  61us    546us   176us


Conclusions:

The performance improvement is as evident with Latin fonts as with CJK ones.

However, on average Bezier curves from Latin fonts require more flattening (6 
segments versus 2 with the Hain implementation), so processing them takes 
longer. As Graham pointed out to me: "The curves used in Latin and other 
Latin-like alphabets are very often used to navigate 90-degree corners; P0 and 
P1 lie on a grid line, and so do P2 and P3. This is very rarely true in Han 
characters."

On the other hand, Latin glyphs contain fewer Bezier curves than CJK (6 versus 
57 on average with my data).

The upshot of both of these together is that the performance change is very 
similar (the CJK and Latin time distribution figures are so similar they could 
be from the same test).

David %^>




reply via email to

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