Browse Source

Merge pull request #505 from avobelk/fix-fallback-not-found-glyph

fix glyph check in FontFallback.MatchFallbackOption
Marcin Ziąbek 2 years ago
parent
commit
a1e7cbbeb3
1 changed files with 6 additions and 1 deletions
  1. 6 1
      Source/QuestPDF/Elements/Text/FontFallback.cs

+ 6 - 1
Source/QuestPDF/Elements/Text/FontFallback.cs

@@ -86,7 +86,12 @@ namespace QuestPDF.Elements.Text
                         return fallbackOption;
                 }
 
-                throw CreateNotMatchingFontException(codepoint);
+                if (Settings.CheckIfAllTextGlyphsAreAvailable)
+                {
+                    throw CreateNotMatchingFontException(codepoint);
+                }
+
+                return fallbackOptions.First();
             }
 
             static Exception CreateNotMatchingFontException(int codepoint)