Top Description Fields Constructors Methods
org.apache.fontbox.ttf

public final Class OpenTypeScript

extends Object
Class Inheritance
Imports
java.io.BufferedInputStream, .IOException, .InputStream, .InputStreamReader, .LineNumberReader, java.util.Arrays, .HashMap, .Map, .Map.Entry, .StringTokenizer, .TreeMap, org.apache.commons.logging.Log, .LogFactory

A class for mapping Unicode codepoints to OpenType script tags
Author
Aaron Madlon-Kay
See Also
Microsoft Typography: Script Tags, Unicode Script Property

Field Summary

Modifier and TypeField and Description
public static final String
private static final Log
public static final String
private static final Map<String, String[]>
UNICODE_SCRIPT_TO_OPENTYPE_TAG_MAP

A map associating Unicode scripts with one or more OpenType script tags.

private static String[]
private static int[]
public static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
ensureValidCodePoint(int codePoint)

public static String[]

Returns:

An array of four-char script tags
getScriptTags
(int
the unicode codepoint of the OpenType script tag
codePoint
)

Obtain the OpenType script tags associated with the given Unicode codepoint.

private static String

Returns:

A Unicode script string, or #UNKNOWN if unknown
getUnicodeScript
(int codePoint)

Obtain the Unicode script associated with the given Unicode codepoint.

private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INHERITEDback to summary
public static final String INHERITED
LOGback to summary
private static final Log LOG
TAG_DEFAULTback to summary
public static final String TAG_DEFAULT
UNICODE_SCRIPT_TO_OPENTYPE_TAG_MAPback to summary
private static final Map<String, 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
unicodeRangeScriptsback to summary
private static String[] unicodeRangeScripts
unicodeRangeStartsback to summary
private static int[] unicodeRangeStarts
UNKNOWNback to summary
public static final String UNKNOWN

Constructor Detail

OpenTypeScriptback to summary
private OpenTypeScript()

Method Detail

ensureValidCodePointback to summary
private static void ensureValidCodePoint(int codePoint)
getScriptTagsback to summary
public static 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:int

the unicode codepoint of the OpenType script tag

Returns:String[]

An array of four-char script tags

getUnicodeScriptback to summary
private static String getUnicodeScript(int codePoint)

Obtain the Unicode script associated with the given Unicode codepoint.

Returns:String

A Unicode script string, or #UNKNOWN if unknown

parseScriptsFileback to summary
private static void parseScriptsFile(InputStream inputStream) throws IOException