Skip to content
Discussion options

You must be logged in to vote

To support a font file or a font in memory, use the page.insert_font() method.
In general please note that the "fontname" parameter is not the font filename!
This is a symbolic name (like a variable name) by which the font is referenced.
Therefore, do this:

page.insert_font(fontname="myfont", fontfile='D:\\SimSum.ttf')  # or fontbuffer=...
page.insert_textbox(...., fontname="myfont")

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@TCHSDUFH
Comment options

Answer selected by TCHSDUFH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #3934 on October 10, 2024 13:57.