Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/UglyToad.PdfPig.Fonts/Type1/Type1FontProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ internal Type1Font(string name, IReadOnlyDictionary<int, string> encoding, Array
/// </summary>
public PdfRectangle? GetCharacterBoundingBox(string characterName)
{
if (string.Equals(characterName, GlyphList.NotDefined, StringComparison.OrdinalIgnoreCase))
{
return null;
}

var glyph = GetCharacterPath(characterName);
return PdfSubpath.GetBoundingRectangle(glyph);
}
Expand Down Expand Up @@ -94,8 +99,13 @@ private static TransformationMatrix GetFontTransformationMatrix(ArrayToken array
/// <summary>
/// Get the pdfpath for the character with the given name.
/// </summary>
public IReadOnlyList<PdfSubpath> GetCharacterPath(string characterName)
public IReadOnlyList<PdfSubpath>? GetCharacterPath(string characterName)
{
if (string.Equals(characterName, GlyphList.NotDefined, StringComparison.OrdinalIgnoreCase))
{
return null;
}

if (!CharStrings.TryGenerate(characterName, out var glyph))
{
return null;
Expand Down
Loading