DavBfr / dart_pdf

Pdf creation module for dart/flutter
https://pub.dev/packages/pdf
Apache License 2.0
1.41k stars 630 forks source link

Is it possible to use multiple custom fonts in one page #1494

Open moham96 opened 1 year ago

moham96 commented 1 year ago

How can I use multiple custom fonts on one page of the pdf? I can specify ( base, bold, italic, boldItalic and icons) fonts in the page theme and load custom fonts using the fontFromAssetBundle method but how can I use a different font in some parts of the pdf (for example a Text widget)?

ilaurillard commented 9 months ago

You can specify a per page theme defining fonts for text, paragraphs, headers, ..

But you can also specify a font per Text/Paragraph - just set a font in the Text.style attibute