Class TrueTypeCollection
java.lang.Object
org.ofdrw.converter.font.TrueTypeCollection
A TrueType Collection, now more properly known as a "Font Collection" as it may contain either
TrueType or OpenType fonts.
- Author:
- John Hewson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidforeach(Consumer<TrueTypeFont> cn) 遍历字体集合中的所有字体getFontAtIndex(int idx) 通过字体索引获取字体int字体总数parse(TTFDataStream stream) Creates a new TrueTypeCollection from a TTC stream.
-
Constructor Details
-
TrueTypeCollection
public TrueTypeCollection()
-
-
Method Details
-
parse
Creates a new TrueTypeCollection from a TTC stream.- Parameters:
stream- The TTF file.- Returns:
- this
- Throws:
IOException- If the font could not be parsed.
-
getFontAtIndex
通过字体索引获取字体- Parameters:
idx- 索引号- Returns:
- 字体
- Throws:
IOException- IOE
-
foreach
遍历字体集合中的所有字体- Parameters:
cn- 字体集合- Throws:
IOException- IOE
-
getNumFonts
public int getNumFonts()字体总数- Returns:
- 总数
-