Originally developed by Wolfgang Glas for Sketch.
| Modifier and Type | Field and Description |
|---|---|
| private final SortedSet | |
| private boolean | |
| private final List | |
| private static final Log | |
| private static final byte[] | |
| private String | |
| private static final TimeZone | |
| private final TrueTypeFont | |
| private final CmapLookup | |
| private final SortedMap |
| Access | Constructor and Description |
|---|---|
| public | |
| public | TTFSubsetter(TrueTypeFont
the font to be subset ttf, List<String> optional tables to keep if present tables)Creates a subsetter for the given font. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| private void | |
| public void | |
| private byte[] | |
| private byte[] | |
| private byte[] | |
| private byte[] | |
| private byte[] | |
| private byte[] | |
| private byte[] | |
| private byte[] | |
| private byte[] | |
| private byte[] | |
| private long | |
| public Map | |
| private int | |
| private int | |
| public void | |
| private boolean | |
| private long | |
| private long | |
| private long | Returns: The file offset of the first TTF table to write.The data output stream. out, int The number of table. nTables)
|
| private void | |
| private void | |
| private void | |
| private void | |
| private long | |
| public void | writeToStream(OutputStream
the stream used for writing. It will be closed by this method. os)Write the subfont to the given output stream. |
| private void | |
| private void | |
| private void |
| glyphIds | back to summary |
|---|---|
| private final SortedSet<Integer> glyphIds | |
| hasAddedCompoundReferences | back to summary |
|---|---|
| private boolean hasAddedCompoundReferences | |
| keepTables | back to summary |
|---|---|
| private final List<String> keepTables | |
| LOG | back to summary |
|---|---|
| private static final Log LOG | |
| PAD_BUF | back to summary |
|---|---|
| private static final byte[] PAD_BUF | |
| prefix | back to summary |
|---|---|
| private String prefix | |
| TIMEZONE_UTC | back to summary |
|---|---|
| private static final TimeZone TIMEZONE_UTC | |
| ttf | back to summary |
|---|---|
| private final TrueTypeFont ttf | |
| unicodeCmap | back to summary |
|---|---|
| private final CmapLookup unicodeCmap | |
| uniToGID | back to summary |
|---|---|
| private final SortedMap<Integer, Integer> uniToGID | |
| TTFSubsetter | back to summary |
|---|---|
| public TTFSubsetter(TrueTypeFont ttf) throws IOException Creates a subsetter for the given font.
| |
| TTFSubsetter | back to summary |
|---|---|
| public TTFSubsetter(TrueTypeFont ttf, List<String> tables) throws IOException Creates a subsetter for the given font.
| |
| add | back to summary |
|---|---|
| public void add(int unicode) Add the given character code to the subset.
| |
| addAll | back to summary |
|---|---|
| public void addAll(Set<Integer> unicodeSet) Add the given character codes to the subset. | |
| addCompoundReferences | back to summary |
|---|---|
| private void addCompoundReferences() throws IOException Resolve compound glyph references. | |
| addGlyphIds | back to summary |
|---|---|
| public void addGlyphIds(Set<Integer> allGlyphIds) | |
| buildCmapTable | back to summary |
|---|---|
| private byte[] buildCmapTable() throws IOException | |
| buildGlyfTable | back to summary |
|---|---|
| private byte[] buildGlyfTable(long[] newOffsets) throws IOException | |
| buildHeadTable | back to summary |
|---|---|
| private byte[] buildHeadTable() throws IOException | |
| buildHheaTable | back to summary |
|---|---|
| private byte[] buildHheaTable() throws IOException | |
| buildHmtxTable | back to summary |
|---|---|
| private byte[] buildHmtxTable() throws IOException | |
| buildLocaTable | back to summary |
|---|---|
| private byte[] buildLocaTable(long[] newOffsets) throws IOException | |
| buildMaxpTable | back to summary |
|---|---|
| private byte[] buildMaxpTable() throws IOException | |
| buildNameTable | back to summary |
|---|---|
| private byte[] buildNameTable() throws IOException | |
| buildOS2Table | back to summary |
|---|---|
| private byte[] buildOS2Table() throws IOException | |
| buildPostTable | back to summary |
|---|---|
| private byte[] buildPostTable() throws IOException | |
| copyBytes | back to summary |
|---|---|
| private long copyBytes(InputStream is, OutputStream os, long newOffset, long lastOffset, int count) throws IOException | |
| getGIDMap | back to summary |
|---|---|
| public Map Returns the map of new -> old GIDs.
| |
| getNewGlyphId | back to summary |
|---|---|
| private int getNewGlyphId(Integer oldGid) | |
| log2 | back to summary |
|---|---|
| private int log2(int num) | |
| setPrefix | back to summary |
|---|---|
| public void setPrefix(String prefix) Sets the prefix to add to the font's PostScript name.
| |
| shouldCopyNameRecord | back to summary |
|---|---|
| private boolean shouldCopyNameRecord(NameRecord nr) | |
| toUInt32 | back to summary |
|---|---|
| private long toUInt32(int high, int low) | |
| toUInt32 | back to summary |
|---|---|
| private long toUInt32(byte[] bytes) | |
| writeFileHeader | back to summary |
|---|---|
private long writeFileHeader(DataOutputStream out, int nTables) throws IOException
| |
| writeFixed | back to summary |
|---|---|
| private void writeFixed(DataOutputStream out, double f) throws IOException | |
| writeLongDateTime | back to summary |
|---|---|
| private void writeLongDateTime(DataOutputStream out, Calendar calendar) throws IOException | |
| writeSInt16 | back to summary |
|---|---|
| private void writeSInt16(DataOutputStream out, short i) throws IOException | |
| writeTableBody | back to summary |
|---|---|
| private void writeTableBody(OutputStream os, byte[] bytes) throws IOException | |
| writeTableHeader | back to summary |
|---|---|
| private long writeTableHeader(DataOutputStream out, String tag, long offset, byte[] bytes) throws IOException | |
| writeToStream | back to summary |
|---|---|
| public void writeToStream(OutputStream os) throws IOException Write the subfont to the given output stream.
| |
| writeUint16 | back to summary |
|---|---|
| private void writeUint16(DataOutputStream out, int i) throws IOException | |
| writeUint32 | back to summary |
|---|---|
| private void writeUint32(DataOutputStream out, long l) throws IOException | |
| writeUint8 | back to summary |
|---|---|
| private void writeUint8(DataOutputStream out, int i) throws IOException | |