From cc51b62b733689931210cf5a3ea674a0a1cf57b6 Mon Sep 17 00:00:00 2001 From: MarcinZiabek Date: Fri, 29 Jul 2022 23:53:55 +0200 Subject: [PATCH] Added information about available font families --- QuestPDF/Drawing/FontManager.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/QuestPDF/Drawing/FontManager.cs b/QuestPDF/Drawing/FontManager.cs index 352fdc8..7192205 100644 --- a/QuestPDF/Drawing/FontManager.cs +++ b/QuestPDF/Drawing/FontManager.cs @@ -142,12 +142,15 @@ namespace QuestPDF.Drawing if (fontFromDefaultSource != null) return fontFromDefaultSource; + + var availableFontNames = string.Join(", ", SKFontManager.Default.GetFontFamilies()); throw new ArgumentException( $"The typeface '{style.FontFamily}' could not be found. " + $"Please consider the following options: " + $"1) install the font on your operating system or execution environment. " + - $"2) load a font file specifically for QuestPDF usage via the QuestPDF.Drawing.FontManager.RegisterFontType(Stream fileContentStream) static method."); + $"2) load a font file specifically for QuestPDF usage via the QuestPDF.Drawing.FontManager.RegisterFontType(Stream fileContentStream) static method. " + + $"Available font family names: [{availableFontNames}]"); } static float GetTextScale(TextStyle style)