8260453: Improve Font Bounding

Reviewed-by: rhalade, psadhukhan, mschoene, serb
This commit is contained in:
Phil Race 2021-02-25 22:20:14 +00:00 committed by Henry Jen
parent 7ad6c23c32
commit 7b6410f213
2 changed files with 4 additions and 1 deletions

View File

@ -426,7 +426,6 @@ abstract class CMap {
try {
this.uvs = new UVS(buffer, offset);
} catch (Throwable t) {
t.printStackTrace();
}
}
return;

View File

@ -518,6 +518,10 @@ public class TrueTypeFont extends FileFont {
&& getDirectoryEntry(hheaTag) == null) {
throw new FontFormatException("missing hhea table");
}
ByteBuffer maxpTable = getTableBuffer(maxpTag);
if (maxpTable.getChar(4) == 0) {
throw new FontFormatException("zero glyphs");
}
initNames();
} catch (Exception e) {
if (FontUtilities.isLogging()) {