bluewaysw / pcgeos

#FreeGEOS source codes. The offical home of the PC/GEOS operating system technology. For personal computing fans. For all developers and assembly lovers. For YOU!
Apache License 2.0
720 stars 86 forks source link

ttf-driver: optimize TrueType_Gen_Widths #640

Open jirkakunze opened 2 weeks ago

jirkakunze commented 2 weeks ago

grafik grafik

Ideas: 1) Refactor filling CTF_IS_FIRST_KERN and CTF_IS_SECONT_KERN in ConvertWidths(). At the moment we iterate over all char and for each char over all kernpairs. This results in hundreds of thousands of iterations to fill the chartable entries.

Better: Iterate over kernpairs and fill for every kernpair CTF_IS_FIRST_KERN and CTF_IS_SECONT_KERN flag. For this we only need as many iterations as there are kernpairs.

2) Write a function that loads the fontbox for the GEOS characters without loading the glyph. A similar function already exists in the ftxwidth.c extension.

jirkakunze commented 2 weeks ago

Here is the timer profile of the TrueTypeGenWidths function: grafik grafik

We need a better solution to convert the index of a character into a GEOS character.