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

Does FPDF2 support TTF fonts with kerning? #812

Closed
AndTikhomirov opened this issue Jun 9, 2023 · 6 comments
Closed

Does FPDF2 support TTF fonts with kerning? #812

AndTikhomirov opened this issue Jun 9, 2023 · 6 comments

Comments

@AndTikhomirov
Copy link

Hi.

I've got a trouble.
I'm trying to use a custom font with kerning, but cannot make it render properly. No kernings applied to text.
Currently all kerning pairs made for cyrylic letter "Т" for testing.

Can someone help me with this problem?

Dumbledor3Thin.zip

@andersonhc
Copy link
Collaborator

I am working on a PR right now to implement text shaping and that will cover kerning - it should be ready to start testing soon.

Can you give me a sample text string you are testing with that font?

@AndTikhomirov
Copy link
Author

Because all pairs were made only for letter "Т"

Text sample looks like this "Ты То Тф Та Тт Ти"

@AndTikhomirov
Copy link
Author

AndTikhomirov commented Jun 9, 2023

Examples of render in fpdf2 & fontforge

fpdf2_render
FontForge_render

@Lucas-C Lucas-C added the font label Jun 9, 2023
@Lucas-C
Copy link
Member

Lucas-C commented Jun 9, 2023

@andersonhc andersonhc mentioned this issue Jun 14, 2023
9 tasks
@Lucas-C
Copy link
Member

Lucas-C commented Aug 2, 2023

@andersonhc PR #820 has been merged today.

Could you test if that solved your issue @AndTikhomirov?

You can install fpdf2 directly from the master branch of this repo with this command:

pip install git+https://github.com/PyFPDF/fpdf2.git@master

The documentation is there: https://pyfpdf.github.io/fpdf2/TextShaping.html

@Lucas-C
Copy link
Member

Lucas-C commented Aug 17, 2023

The text shaping feature has been released in 2.7.5,
so I'm going to close this issue.

Anyone is free to reopen it or open another one thare are still issues with font kerning.

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

3 participants