Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ttf-driver: optimize TrueType_Gen_Widths #640

Open
jirkakunze opened this issue Sep 15, 2024 · 1 comment
Open

ttf-driver: optimize TrueType_Gen_Widths #640

jirkakunze opened this issue Sep 15, 2024 · 1 comment

Comments

@jirkakunze
Copy link
Collaborator

jirkakunze commented Sep 15, 2024

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.

  1. 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
Copy link
Collaborator Author

jirkakunze commented Sep 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant