Skip to content

Commit

Permalink
PDFBOX-5920: make sure that the exception is thrown if space isn't in…
Browse files Browse the repository at this point in the history
… the font

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1922902 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
THausherr committed Jan 5, 2025
1 parent 4e9a534 commit 0ad7e44
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ public float getSpaceWidth()
try
{
// PDFBOX-5920: try with encoding, which gets the correct code
encode(" "); // this throws an exception if space doesn't exist,
// getStringWidth() not always
fontWidthOfSpace = getStringWidth(" ");
}
catch (IllegalArgumentException | UnsupportedOperationException ex)
Expand Down

0 comments on commit 0ad7e44

Please sign in to comment.