Package org.apache.fontbox.ttf
Class OpenTypeScript
- java.lang.Object
-
- org.apache.fontbox.ttf.OpenTypeScript
-
public final class OpenTypeScript extends java.lang.ObjectA class for mapping Unicode codepoints to OpenType script tags
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringINHERITEDprivate static org.apache.commons.logging.LogLOGstatic java.lang.StringTAG_DEFAULTprivate static java.util.Map<java.lang.String,java.lang.String[]>UNICODE_SCRIPT_TO_OPENTYPE_TAG_MAPA map associating Unicode scripts with one or more OpenType script tags.private static java.lang.String[]unicodeRangeScriptsprivate static int[]unicodeRangeStartsstatic java.lang.StringUNKNOWN
-
Constructor Summary
Constructors Modifier Constructor Description privateOpenTypeScript()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidensureValidCodePoint(int codePoint)static java.lang.String[]getScriptTags(int codePoint)Obtain the OpenType script tags associated with the given Unicode codepoint.private static java.lang.StringgetUnicodeScript(int codePoint)Obtain the Unicode script associated with the given Unicode codepoint.private static voidparseScriptsFile(java.io.InputStream inputStream)
-
-
-
Field Detail
-
LOG
private static final org.apache.commons.logging.Log LOG
-
INHERITED
public static final java.lang.String INHERITED
- See Also:
- Constant Field Values
-
UNKNOWN
public static final java.lang.String UNKNOWN
- See Also:
- Constant Field Values
-
TAG_DEFAULT
public static final java.lang.String TAG_DEFAULT
- See Also:
- Constant Field Values
-
UNICODE_SCRIPT_TO_OPENTYPE_TAG_MAP
private static final java.util.Map<java.lang.String,java.lang.String[]> 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:
- Microsoft Typography: Script Tags
-
unicodeRangeStarts
private static int[] unicodeRangeStarts
-
unicodeRangeScripts
private static java.lang.String[] unicodeRangeScripts
-
-
Method Detail
-
parseScriptsFile
private static void parseScriptsFile(java.io.InputStream inputStream) throws java.io.IOException- Throws:
java.io.IOException
-
getUnicodeScript
private static java.lang.String getUnicodeScript(int codePoint)
Obtain the Unicode script associated with the given Unicode codepoint.- Parameters:
codePoint-- Returns:
- A Unicode script string, or
#UNKNOWNif unknown
-
getScriptTags
public static java.lang.String[] getScriptTags(int codePoint)
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- the unicode codepoint of the OpenType script tag- Returns:
- An array of four-char script tags
-
ensureValidCodePoint
private static void ensureValidCodePoint(int codePoint)
-
-