Package org.apache.fontbox.ttf
Class OpenTypeScript
java.lang.Object
org.apache.fontbox.ttf.OpenTypeScript
A class for mapping Unicode codepoints to OpenType script tags
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidensureValidCodePoint(int codePoint) static String[]getScriptTags(int codePoint) Obtain the OpenType script tags associated with the given Unicode codepoint.private static StringgetUnicodeScript(int codePoint) Obtain the Unicode script associated with the given Unicode codepoint.private static voidparseScriptsFile(InputStream inputStream)
-
Field Details
-
LOG
private static final org.apache.commons.logging.Log LOG -
INHERITED
- See Also:
-
UNKNOWN
- See Also:
-
TAG_DEFAULT
- See Also:
-
UNICODE_SCRIPT_TO_OPENTYPE_TAG_MAP
A map associating Unicode scripts with one or more OpenType script tags. Script tags are not necessarily the same as Unicode scripts. A single Unicode script may correspond to multiple tags, especially when there has been a revision to the latter (e.g. Bengali -> [bng2, beng]). When there are multiple tags, they are ordered from newest to oldest.- See Also:
-
unicodeRangeStarts
private static int[] unicodeRangeStarts -
unicodeRangeScripts
-
-
Constructor Details
-
OpenTypeScript
private OpenTypeScript()
-
-
Method Details
-
parseScriptsFile
- Throws:
IOException
-
getUnicodeScript
Obtain the Unicode script associated with the given Unicode codepoint.- Parameters:
codePoint-- Returns:
- A Unicode script string, or
#UNKNOWNif unknown
-
getScriptTags
Obtain the OpenType script tags associated with the given Unicode codepoint. The result may contain the special value#INHERITED, which indicates that the codepoint's script can only be determined by its context. Unknown codepoints are mapped to#TAG_DEFAULT.- Parameters:
codePoint-- Returns:
- An array of four-char script tags
-
ensureValidCodePoint
private static void ensureValidCodePoint(int codePoint)
-