Skip to content

Commit

Permalink
GH-80 fix encoding regressions from last commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Corless committed Mar 5, 2021
1 parent 2acbe50 commit 1a45b7d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ public TrueTypeFont(Library library, HashMap entries) {
public synchronized void init() {
super.init();
inited = true;
if (encoding == null) {
encoding = Encoding.standardEncoding;
font = font.deriveFont(encoding, toUnicodeCMap);
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected ZSimpleFont(ZSimpleFont font) {
@Override
public Point2D echarAdvance(final char ech) {
try {
String name = encoding.getName(ech);
String name = encoding != null ? encoding.getName(ech) : null;
float advance = 0.001f; // todo should be DW.
if (name != null) {
advance = fontBoxFont.getWidth(name);
Expand Down

0 comments on commit 1a45b7d

Please sign in to comment.