Skip to content

Commit

Permalink
PDFBOX-5660: put font name in exception text
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1914654 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
THausherr committed Dec 14, 2023
1 parent 72611f5 commit d381964
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ protected byte[] encode(int unicode) throws IOException
if (!encoding.contains(getGlyphList().codePointToName(unicode)))
{
throw new IllegalArgumentException(
String.format("U+%04X is not available in this font's encoding: %s",
unicode, encoding.getEncodingName()));
String.format("U+%04X is not available in font %s encoding: %s",
unicode, getName(), encoding.getEncodingName()));
}

String name = getGlyphList().codePointToName(unicode);
Expand Down Expand Up @@ -438,7 +438,7 @@ protected byte[] encode(int unicode) throws IOException
if (code == null)
{
throw new IllegalArgumentException(
String.format("U+%04X is not available in this font's Encoding", unicode));
String.format("U+%04X is not available in font %s encoding", unicode, getName()));
}

return new byte[] { (byte)(int)code };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ protected byte[] encode(int unicode) throws IOException
if (!encoding.contains(name))
{
throw new IllegalArgumentException(
String.format("U+%04X ('%s') is not available in this font's encoding: %s",
unicode, name, encoding.getEncodingName()));
String.format("U+%04X ('%s') is not available in font %s encoding: %s",
unicode, name, getName(), encoding.getEncodingName()));
}

String nameInFont = getNameInFont(name);
Expand Down

0 comments on commit d381964

Please sign in to comment.