diff --git a/src/UglyToad.PdfPig/PdfFonts/Simple/TrueTypeStandard14FallbackSimpleFont.cs b/src/UglyToad.PdfPig/PdfFonts/Simple/TrueTypeStandard14FallbackSimpleFont.cs index 17346d87..f649f567 100644 --- a/src/UglyToad.PdfPig/PdfFonts/Simple/TrueTypeStandard14FallbackSimpleFont.cs +++ b/src/UglyToad.PdfPig/PdfFonts/Simple/TrueTypeStandard14FallbackSimpleFont.cs @@ -87,7 +87,10 @@ } var name = encoding.GetName(characterCode); - var metrics = fontMetrics.CharacterMetrics[name]; + if (!fontMetrics.CharacterMetrics.TryGetValue(name, out var metrics)) + { + return new CharacterBoundingBox(new PdfRectangle(), 0); + } if (overrides?.TryGetWidth(characterCode, out width) != true) {