MCPcopy Create free account
hub / github.com/apache/pdfbox / TrueTypeFont

Class TrueTypeFont

fontbox/src/main/java/org/apache/fontbox/ttf/TrueTypeFont.java:42–868  ·  view source on GitHub ↗

A TrueType font file. @author Ben Litchfield

Source from the content-addressed store, hash-verified

40 * @author Ben Litchfield
41 */
42public class TrueTypeFont implements FontBoxFont, Closeable
43{
44
45 private static final Log LOG = LogFactory.getLog(TrueTypeFont.class);
46
47 private float version;
48 private int numberOfGlyphs = -1;
49 private int unitsPerEm = -1;
50 private boolean enableGsub = true;
51 protected final Map<String,TTFTable> tables = new HashMap<>();
52 private final TTFDataStream data;
53 private volatile Map<String, Integer> postScriptNames;
54
55 private final Object lockReadtable = new Object();
56 private final Object lockPSNames = new Object();
57 private final List<String> enabledGsubFeatures = new ArrayList<>();
58
59 /**
60 * Constructor. Clients should use the TTFParser to create a new TrueTypeFont object.
61 *
62 * @param fontData The font data.
63 */
64 TrueTypeFont(TTFDataStream fontData)
65 {
66 data = fontData;
67 }
68
69 @Override
70 public void close() throws IOException
71 {
72 data.close();
73 }
74
75 /**
76 * @return Returns the version.
77 */
78 public float getVersion()
79 {
80 return version;
81 }
82
83 /**
84 * Set the version. Package-private, used by TTFParser only.
85 * @param versionValue The version to set.
86 */
87 void setVersion(float versionValue)
88 {
89 version = versionValue;
90 }
91
92 /**
93 * @return Returns true if the GSUB table can be used for this font
94 */
95 public boolean isEnableGsub()
96 {
97 return enableGsub;
98 }
99

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…