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

How to change the font? #234

Open
f1nked opened this issue May 15, 2022 · 1 comment
Open

How to change the font? #234

f1nked opened this issue May 15, 2022 · 1 comment

Comments

@f1nked
Copy link

f1nked commented May 15, 2022

I want to make a document using a TrueType font (.ttf). The font is not system, is in a separate file. How can I integrate it into the document? Changing FONT_NAME does not change the font in the resulting document. Any help would be very helpful. Thanks.

page.Resources.Font.F1.Subtype = PdfName.TrueType
page.Resources.Font.F1.BaseFont = PdfName.FONT_NAME
@sl2c
Copy link

sl2c commented Sep 20, 2023

There's no simple way to do it in pdfrw as the setting up of fonts in PDF is a rather laborous task. However, see https://github.com/sl2c/pdfrwx/blob/master/pdffont.py for an example of how this can be done in pdfrwx.

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

No branches or pull requests

2 participants