DavBfr / dart_pdf

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

Currencies icons #1720

Open tuceturan opened 3 weeks ago

tuceturan commented 3 weeks ago

Hello,

After reviewing the questions, I couldn't find an answer. Is there a font that can display all currencies when the library is not connected to the internet, or should we include the fonts for all the languages used in the application while writing?

leocirto commented 3 weeks ago

I don't know the best answer, but I'd start with Noto Sans fonts and test several currencies ( https://fonts.google.com/noto ).

Possible configuration:

  pw.PageTheme(
     theme: pw.ThemeData.withFont(
        base:       await PdfGoogleFonts.notoSansRegular( ),
        bold:       await PdfGoogleFonts.notoSansBold( ),
        italic:     await PdfGoogleFonts.notoSansItalic( ),
        boldItalic: await PdfGoogleFonts.notoSansBoldItalic( ),
        icons:      await PdfGoogleFonts.materialIcons(),
        fontFallback: [
                    await PdfGoogleFonts.notoColorEmoji( ),
                    await PdfGoogleFonts.notoEmojiMedium( ),
                    await PdfGoogleFonts.notoSansMathRegular( ),
                    await PdfGoogleFonts.notoSansSymbolsRegular( ),
                    await PdfGoogleFonts.notoSansSymbols2Regular( ),
        ]
     ).copyWith(  textAlign: pw.TextAlign.justify ),
  );