mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-14 19:05:01 +08:00
load resources dictionary from pages as well as page node and throw informative error when the font is not found.
This commit is contained in:
@@ -79,10 +79,15 @@
|
||||
|
||||
public void ShowText(IInputBytes bytes)
|
||||
{
|
||||
var font = resourceStore.GetFont(GetCurrentState().FontState.FontName);
|
||||
|
||||
var currentState = GetCurrentState();
|
||||
|
||||
var font = resourceStore.GetFont(currentState.FontState.FontName);
|
||||
|
||||
if (font == null)
|
||||
{
|
||||
throw new InvalidOperationException($"Could not find the font with name {currentState.FontState.FontName} in the resource store. It has not been loaded yet.");
|
||||
}
|
||||
|
||||
var fontSize = currentState.FontState.FontSize;
|
||||
var horizontalScaling = currentState.FontState.HorizontalScaling;
|
||||
var characterSpacing = currentState.FontState.CharacterSpacing;
|
||||
|
Reference in New Issue
Block a user