Skip to content

How to customize the font in the insert_textbox function #3934

@TCHSDUFH

Description

@TCHSDUFH

When using the insert_textbox function, I want to use some Chinese fonts, such as SimSum.ttf. I checked the source code of the function and found that it doesn't support this font. It's also not possible to directly assign a local font file path. How should I proceed to make the inserted text use the SimSum.ttf font? tks

page.insert_textbox(rect,
                            nowPage,
                            fontsize=int(pageFontSet.fontSize),
                            fontname='D:\\SimSum.ttf',    
                            color=pageFontSet.fontColor,    
                            align=TEXT_ALIGN_CENTER,  
                            overlay=True)  # 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions