| Constructor and Description |
|---|
TTFSubsetter(TrueTypeFont ttf)
Creates a subsetter for the given font.
|
TTFSubsetter(TrueTypeFont ttf,
List<String> tables)
Creates a subsetter for the given font.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int unicode)
Add the given character code to the subset.
|
void |
addAll(Set<Integer> unicodeSet)
Add the given character codes to the subset.
|
void |
addGlyphIds(Set<Integer> allGlyphIds) |
void |
forceInvisible(int unicode)
Forces the glyph for the specified character code to be zero-width and contour-free,
regardless of what the glyph looks like in the original font.
|
Map<Integer,Integer> |
getGIDMap()
Returns the map of new -> old GIDs.
|
void |
setPrefix(String prefix)
Sets the prefix to add to the font's PostScript name.
|
void |
writeToStream(OutputStream os)
Write the subfont to the given output stream.
|
public TTFSubsetter(TrueTypeFont ttf) throws IOException
ttf - the font to be subsetIOException - if there is an error reading the font datapublic TTFSubsetter(TrueTypeFont ttf, List<String> tables) throws IOException
ttf - the font to be subsettables - optional tables to keep if presentIOException - if there is an error reading the font datapublic void setPrefix(String prefix)
prefix - to be used as prefix for the PostScript name of the fontpublic void add(int unicode)
unicode - character codepublic void addAll(Set<Integer> unicodeSet)
unicodeSet - character code setpublic void forceInvisible(int unicode)
added
separately.unicode - the character code whose glyph should be invisiblepublic Map<Integer,Integer> getGIDMap() throws IOException
IOException - if the font data could not be readpublic void writeToStream(OutputStream os) throws IOException
os - the stream used for writing. It will be closed by this method.IOException - if something went wrong.IllegalStateException - if the subset is empty.Copyright © 2008–2025 The Apache Software Foundation. All rights reserved.