Skip to content

Custom font in PDF export #1329

Closed
Closed
@blwsk

Description

@blwsk

Is your feature request related to a problem? Please describe.
We use custom fonts in our production block editor and want the same fonts to be used in our exported PDFs. Currently, it appears as though the editor font is hardcoded to Inter: https://github.com/TypeCellOS/BlockNote/blob/main/packages/xl-pdf-exporter/src/pdf/pdfExporter.tsx#L57C10-L74

Describe the solution you'd like

  • Add support for overriding the default page styles, allowing a font to be specified. Ideally, other style properties like page margin could be altered, too, for future flexibility.
  • Support registering custom fonts, overriding the default registerFont method.

Describe alternatives you've considered
No alternatives come to mind, aside from perhaps forgoing the default block / inline style mappers and writing our own versions for every block or inline content type. Doing so would decrease the value provided by the package.

Additional context
Happy to submit a PR.

Bonus

  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖

(https://github.com/poggiolabs is a sponsor)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions