/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Provides the definitions of the five logical fonts: Serif, SansSerif,
* Monospaced, Dialog, and DialogInput. The necessary information
* is obtained from fontconfig files.
*/
public abstract class FontConfiguration {
//static global runtime env
protected static boolean isProperties = true;
protected boolean preferLocaleFonts;
protected boolean preferPropFonts;
private boolean foundOsSpecificFile;
private boolean inited;
/* A default FontConfiguration must be created before an alternate
* one to ensure proper static initialisation takes place.
*/
if (FontUtilities.debugFonts()) {
.info("Creating standard Font Configuration");
}
}
fontManager = fm;
setOsNameAndVersion(); /* static initialization */
setEncoding(); /* static initialization */
/* Separating out the file location from the rest of the
* initialisation, so the caller has the option of doing
* something else if a suitable file isn't found.
*/
}
public synchronized boolean init() {
if (!inited) {
this.preferLocaleFonts = false;
this.preferPropFonts = false;
inited = true;
}
return true;
}
boolean preferLocaleFonts,
boolean preferPropFonts) {
fontManager = fm;
if (FontUtilities.debugFonts()) {
.info("Creating alternate Font Configuration");
}
this.preferLocaleFonts = preferLocaleFonts;
this.preferPropFonts = preferPropFonts;
/* fontConfig should be initialised by default constructor, and
* its data tables can be shared, since readFontConfigFile doesn't
* update any other state. Also avoid a doPrivileged block.
*/
}
/**
* Fills in this instance's osVersion and osName members. By
* default uses the system properties os.name and os.version;
* subclasses may override.
*/
protected void setOsNameAndVersion() {
}
private void setEncoding() {
}
/////////////////////////////////////////////////////////////////////
// methods for loading the FontConfig file //
/////////////////////////////////////////////////////////////////////
public boolean foundOsSpecificFile() {
return foundOsSpecificFile;
}
/* Smoke test to see if we can trust this configuration by testing if
* the first slot of a composite font maps to an installed file.
*/
public boolean fontFilesArePresent() {
init();
try {
}
catch (Exception e) {
return false;
}
}
});
return exists.booleanValue();
}
private void findFontConfigFile() {
foundOsSpecificFile = true; // default assumption.
throw new Error("java.home property not set");
}
if (userConfigFile != null) {
} else {
}
}
/* This is invoked here as readFontConfigFile is only invoked
* once per VM, and always in a privileged context, thus the
* directory containing installed fall back fonts is accessed
* from this context
*/
if (f != null) {
try {
if (isProperties) {
} else {
loadBinary(in);
}
if (FontUtilities.debugFonts()) {
}
} catch (IOException e) {
if (FontUtilities.debugFonts()) {
}
}
}
}
}
return;
}
for (int i=0; i<numTTFs; i++) {
}
for (int i=0; i<numT1s; i++) {
}
}
}
if (f.canRead()) {
isProperties = true;
return f;
}
if (f.canRead()) {
isProperties = false;
return f;
}
return null;
}
if (configFile != null) {
return configFile;
}
if (decimalPointIndex != -1) {
if (configFile != null) {
return configFile;
}
}
}
if (configFile != null) {
return configFile;
}
}
if (configFile != null) {
return configFile;
}
if (osMajorVersion != null) {
if (configFile != null) {
return configFile;
}
}
}
foundOsSpecificFile = false;
if (configFile != null) {
return configFile;
}
return null;
}
/* Initialize the internal data tables from binary format font
* configuration file.
*/
int[] tableSizes = new int[INDEX_TABLEEND];
for (int i = 0; i < INDEX_TABLEEND; i++) {
}
//StringTable cache
table_stringTable = new char[len];
int i = 0, j = 0;
while (i < len) {
}
if (verbose) {
dump();
}
}
/* Generate a binary format font configuration from internal data
* tables.
*/
sanityCheck();
//stringTable
if (verbose) {
dump();
}
}
//private static boolean loadingProperties;
private static short stringIDNum;
private static short[] stringIDs;
//loadingProperties = true;
//StringID starts from "1", "0" is reserved for "not defined"
stringIDNum = 1;
stringIDs = new short[1000];
}
//loadingProperties = false;
stringTable = null;
}
/////////////////////////////////////////////////////////////////////
// methods for initializing the FontConfig //
/////////////////////////////////////////////////////////////////////
/**
* set initLocale, initEncoding and initELC for this FontConfig object
* currently we just simply use the startup locale and encoding
*/
private void initFontConfig() {
if (preferLocaleFonts && !willReorderForStartupLocale()) {
preferLocaleFonts = false;
}
initELC = getInitELC();
}
//"ELC" stands for "Encoding.Language.Country". This method returns
//the ID of the matched elc setting of "initLocale" in elcIDs table.
//If no match is found, it returns the default ID, which is
//"NULL.NULL.NULL" in elcIDs table.
private short getInitELC() {
if (initELC != -1) {
return initELC;
}
}
} else {
}
int i = 0;
while (i < table_alphabeticSuffix.length) {
if (initELC == table_alphabeticSuffix[i]) {
return initELC;
}
i += 2;
}
return initELC;
}
public static boolean verbose;
private void initAllComponentFonts() {
short[] fallbackScripts = getFallbackScripts();
/*
System.out.println("coreScriptID=" + table_sequences[initELC * 5 + fontIndex]);
for (int i = 0; i < coreScripts.length; i++) {
System.out.println(" " + i + " :" + getString(table_scriptIDs[coreScripts[i]]));
}
*/
//init exclusionRanges
}
//init componentFontNames
int index;
//core
}
if (preferPropFonts) {
}
//System.out.println("nameid=" + nameIDs[index]);
}
//fallback
}
if (preferPropFonts) {
}
continue;
}
/*
System.out.println("fontIndex=" + fontIndex + ", styleIndex=" + styleIndex
+ ", fbIndex=" + i + ",fbS=" + fallbackScripts[i] + ", id=" + id);
*/
}
short[] newNameIDs = new short[index];
}
}
}
}
}
return fontID;
}
fontID = (short)i;
break;
}
}
return fontID;
}
public static boolean hasMonoToPropMap() {
}
if (preferPropFonts &&
int i = 0;
while (i < table_proportionals.length) {
if (table_proportionals[i] == id) {
return table_proportionals[i + 1];
}
i += 2;
}
}
return id;
}
/////////////////////////////////////////////////////////////////////
// Methods for handling font and style names //
/////////////////////////////////////////////////////////////////////
= {"serif", "sansserif", "monospaced", "dialog", "dialoginput"};
= {"plain", "bold", "italic", "bolditalic"};
/**
* Checks whether the given font family name is a valid logical font name.
* The check is case insensitive.
*/
}
/**
* Checks whether the given font family name is a valid logical font name.
* The check is case sensitive.
*/
return true;
}
}
return false;
}
/**
* Checks whether the given style name is a valid logical font style name.
*/
return true;
}
}
return false;
}
/**
* Checks whether the given font face name is a valid logical font name.
* The check is case insensitive.
*/
}
/**
* Checks whether the given font face name is a valid logical font name.
* The check is case sensitive.
*/
if (period >= 0) {
return isLogicalFontFamilyName(familyName) &&
} else {
return isLogicalFontFamilyName(fontName);
}
}
}
}
return i;
}
}
assert false;
return 0;
}
switch (style) {
return 0;
return 1;
return 2;
return 3;
default:
return 0;
}
}
}
return styleNames[styleIndex];
}
/**
* Returns the font face name for the given logical font
* family name and style.
* The style argument is interpreted as in java.awt.Font.Font.
*/
assert isLogicalFontFamilyName(familyName);
}
/**
* Returns the string typically used in properties files
* for the given style.
* The style argument is interpreted as in java.awt.Font.Font.
*/
}
/**
* Returns a fallback name for the given font name. For a few known
* font names, matching logical font names are returned. For all
* other font names, defaultFallback is returned.
* defaultFallback differs between AWT and 2D.
*/
/**
* Returns the 1.1 equivalent for some old 1.0 font family names for
* which we need to maintain compatibility in some configurations.
* Returns null for other font names.
*/
return "serif";
return "sansserif";
return "monospaced";
}
return null;
}
/**
* Maps a file name given in the font configuration file
* to a format appropriate for the platform.
*/
return fileName;
}
//////////////////////////////////////////////////////////////////////
// reordering //
//////////////////////////////////////////////////////////////////////
/* Mappings from file encoding to font config name for font supporting
* the corresponding language. This is filled in by initReorderMap()
*/
/* Platform-specific mappings */
protected abstract void initReorderMap();
/* Move item at index "src" to "dst", shuffling all values in
* between down
*/
return;
}
}
}
/* Called to determine if there's a re-order sequence for this locale/
* encoding. If there's none then the caller can "bail" and avoid
* unnecessary work
*/
public static boolean willReorderForStartupLocale() {
return getReorderSequence() != null;
}
}
/* Find the most specific mapping */
}
}
return val;
}
/* This method reorders the sequence such that the matches for the
* file encoding are moved ahead of other elements.
* If an encoding uses more than one font, they are all moved up.
*/
return;
}
}
}
}
}
}
}
//String.split would be more convenient, but incurs big performance penalty
int start = 0;
int end;
}
}
return parts;
}
}
////////////////////////////////////////////////////////////////////////
// Methods for extracting information from the fontconfig data for AWT//
////////////////////////////////////////////////////////////////////////
/**
* Returns FontDescriptors describing the physical fonts used for the
* given logical font name and style. The font name is interpreted
* in a case insensitive way.
* The style argument is interpreted as in java.awt.Font.Font.
*/
assert isLogicalFontFamilyName(fontName);
}
if (descriptors == null) {
}
return descriptors;
}
}
}
// look up character encoding
encoding = "default";
}
// we already have the exclusion ranges
int[] exclusionRanges = fontExclusionRanges[i];
// create descriptor
}
return descriptors;
}
/**
* Returns the AWT font name for the given platform font name and
* character subset.
*/
return platformFontName;
}
/**
* Returns the java.io name of the platform character encoding for the
* given AWT font name and character subset. May return "default"
* to indicate that getDefaultFontCharset should be called to obtain
* a charset encoder.
*/
} else {
}
return fc.newEncoder();
}
} else {
try {
} catch (ClassNotFoundException e) {
}
return null;
}
});
try {
} catch (Exception e) {
}
}
}
}
} else {
}
return fc.newEncoder();
}
/* This retrieves the platform font directories (path) calculated
* by setAWTFontPathSequence(String[]). The default implementation
* returns null, its expected that X11 platforms may return
* non-null.
*/
return null;
}
////////////////////////////////////////////////////////////////////////
// methods for extracting information from the fontconfig data for 2D //
////////////////////////////////////////////////////////////////////////
/**
* Returns an array of composite font descriptors for all logical font
* faces.
* If the font configuration file doesn't specify Lucida Sans Regular
* or the given fallback font as component fonts, they are added here.
*/
// determine exclusion ranges for font
// AWT uses separate exclusion range array per component font.
// 2D packs all range boundaries into one array.
// Both use separate entries for lower and upper boundary.
int numExclusionRanges = 0;
}
int[] exclusionRanges = new int[numExclusionRanges];
int exclusionRangeIndex = 0;
int exclusionRangeLimitIndex = 0;
int[] componentRanges = exclusions[i];
int value = componentRanges[j];
}
}
// other info is per style
boolean sawDefaultFontFile = false;
if (installedFallbackFontFiles != null) {
}
// determine face names and file names of component fonts
int index;
}
if (!sawDefaultFontFile &&
sawDefaultFontFile = true;
}
/*
System.out.println(publicFontNames[fontIndex] + "." + styleNames[styleIndex] + "."
+ getString(table_scriptIDs[coreScripts[index]]) + "=" + componentFileNames[index]);
*/
}
//"Lucida Sans Regular" is not in the list, we add it here
if (!sawDefaultFontFile) {
int len = 0;
if (installedFallbackFontFiles != null) {
}
}
index++;
}
if (installedFallbackFontFiles != null) {
index++;
}
}
if (index < maxComponentFontCount) {
}
// exclusion range limit array length must match component face name
// array length - native code relies on this
clippedExclusionRangeLimits = new int[index];
//padding for various fallback fonts
}
}
/*
System.out.println(faceName + ":");
for (int i = 0; i < componentFileNames.length; i++) {
System.out.println(" " + componentFaceNames[i]
+ " -> " + componentFileNames[i]);
}
*/
= new CompositeFontDescriptor(
}
}
return result;
}
/*
public class 2dFont {
public String platformName;
public String fontfileName;
}
private 2dFont [] componentFonts = null;
*/
/* Used on Linux to test if a file referenced in a font configuration
* file exists in the location that is expected. If it does, no need
* to search for it. If it doesn't then unless its a fallback font,
* return that expensive code should be invoked to search for the font.
*/
if (!FontUtilities.isLinux) {
return false;
}
/* call getNumberCoreFonts() to ensure these are initialised, and
* if this file isn't for a core component, ie, is a for a fallback
* font which very typically isn't available, then can't afford
* to take the start-up penalty to search for it.
*/
} else {
if (FontUtilities.debugFonts() &&
}
}
}
}
/* Return the number of core fonts. Note this isn't thread safe but
* a calling thread can call this and getPlatformFontNames() in either
* order.
*/
public int getNumberCoreFonts() {
if (numCoreFonts == -1) {
int numFallbackFonts = 0;
int i;
continue;
}
}
if (compFileName != null) {
}
}
i++;
}
}
}
return numCoreFonts;
}
/* Return all platform font names used by this font configuration.
* The first getNumberCoreFonts() entries are guaranteed to be the
* core fonts - ie no fall back only fonts.
*/
if (numCoreFonts == -1) {
}
return componentFonts;
}
/**
* Returns a file name for the physical font represented by this platform font name,
* if the font configuration has such information available, or null if the
* information is unavailable. The file name returned is just a hint; a null return
* value doesn't necessarily mean that the font is unavailable, nor does a non-null
* return value guarantee that the file exists and contains the physical font.
* The file name can be an absolute or a relative path name.
*/
// get2DCompositeFontInfo
// -> getFileNameFromComponentfontName() (W/M)
// -> getFileNameFromPlatformName()
// it's a waste of time on Win32, but I have to give X11 a chance to
// call getFileNameFromXLFD()
}
/**
* Returns a configuration specific path to be appended to the font
* search path.
*/
}
}
/* subclass support */
return fontConfig;
}
protected void setFontConfiguration() {
fontConfig = this; /* static initialization */
}
//////////////////////////////////////////////////////////////////////
// FontConfig data tables and the index constants in binary file //
//////////////////////////////////////////////////////////////////////
/* The binary font configuration file begins with a short[] "head", which
* contains the offsets to the starts of the individual data table which
* immediately follow. Teh current implemention includes the tables shown
* below.
*
* (00) table_scriptIDs :stringIDs of all defined CharacterSubsetNames
* (01) table_scriptFonts :scriptID x fontIndex x styleIndex->
* PlatformFontNameID mapping. Each scriptID might
* have 1 or 20 entries depends on if it is defined
* via a "allfonts.CharacterSubsetname" or a list of
* "LogicalFontName.StyleName.CharacterSubsetName"
* entries, positive entry means it's a "allfonts"
* entry, a negative value means this is a offset to
* a NUM_FONTS x NUM_STYLES subtable.
* (02) table_elcIDs :stringIDs of all defined ELC names, string
* "NULL.NULL.NULL" is used for "default"
* (03) table_sequences :elcID x logicalFont -> scriptIDs table defined
* by "sequence.allfonts/LogicalFontName.ELC" in
* font configuration file, each "elcID" has
* NUM_FONTS (5) entries in this table.
* (04) table_fontfileNameIDs
* :stringIDs of all defined font file names
* (05) table_componentFontNameIDs
* :stringIDs of all defined PlatformFontNames
* (06) table_filenames :platformFontNamesID->fontfileNameID mapping
* table, the index is the platformFontNamesID.
* (07) table_awtfontpaths :CharacterSubsetNames->awtfontpaths mapping table,
* the index is the CharacterSubsetName's stringID
* and content is the stringID of awtfontpath.
* (08) table_exclusions :scriptID -> exclusionRanges mapping table,
* the index is the scriptID and the content is
a id of an exclusionRanges int[].
* (09) table_proportionals:list of pairs of PlatformFontNameIDs, stores
* the replacement info defined by "proportional"
* keyword.
* (10) table_scriptFontsMotif
* :same as (01) except this table stores the
* info defined with ".motif" keyword
* (11) table_alphabeticSuffix
* :elcID -> stringID of alphabetic/XXXX entries
* (12) table_stringIDs :The index of this table is the string ID, the
* content is the "start index" of this string in
* stringTable, use the start index of next entry
* as the "end index".
* (13) table_stringTable :The real storage of all character strings defined
* /used this font configuration, need a pair of
* "start" and "end" indices to access.
* (14) reserved
* (15) table_fallbackScripts
* :stringIDs of fallback CharacterSubsetnames, stored
* in the order of they are defined in sequence.fallback.
* (16) table_appendedfontpath
* :stringtID of the "appendedfontpath" defined.
* (17) table_version :stringID of the version number of this fontconfig file.
*/
private static short[] head;
private static short[] table_scriptIDs;
private static short[] table_scriptFonts;
private static short[] table_elcIDs;
private static short[] table_sequences;
private static short[] table_fontfileNameIDs;
private static short[] table_componentFontNameIDs;
private static short[] table_filenames;
protected static short[] table_awtfontpaths;
private static short[] table_exclusions;
private static short[] table_proportionals;
private static short[] table_scriptFontsMotif;
private static short[] table_alphabeticSuffix;
private static short[] table_stringIDs;
private static char[] table_stringTable;
/**
* Checks consistencies of complied fontconfig data. This method
* is called only at the build-time from
* build.tools.compilefontconfig.CompileFontConfig.
*/
private static void sanityCheck() {
int errors = 0;
//This method will only be called during build time, do we
//need do PrivilegedAction?
}
});
//componentFontNameID starts from "1"
// The corresponding finename entry for a component
// font name is mandatory on Windows, but it's
// optional on Solaris and Linux.
+ "> entry is missing!!!");
errors++;
} else {
+ "\"");
}
}
}
}
if (fid == 0) {
+ "> entry is missing!!!");
errors++;
continue;
} else if (fid < 0) {
if (ffid == 0) {
+ "> entry is missing!!!");
errors++;
}
}
}
}
}
continue;
}
+ "<awtfontpath."
+ script
+ "> entry is missing!!!");
errors++;
}
}
}
if (errors != 0) {
+ "THE FONTCONFIG FILE, PLEASE CHECK ITS CONTENT!!\n");
}
}
private static boolean isEmpty(short[] a) {
for (short s : a) {
if (s != -1) {
return false;
}
}
return true;
}
//dump the fontconfig data tables
private static void dump() {
}
if (fid >= 0) {
+ "="
}
}
if (fid < 0) {
+ "="
}
}
}
}
}
}
} else {
}
}
+ " : "
}
+ " -> "
}
int i = 0;
while (i < table_alphabeticSuffix.length) {
}
}
}
//////////////////////////////////////////////////////////////////////
// Data table access methods //
//////////////////////////////////////////////////////////////////////
/* Return the fontID of the platformFontName defined in this font config
* by "LogicalFontName.StyleName.CharacterSubsetName" entry or
* "allfonts.CharacterSubsetName" entry in properties format fc file.
*/
//System.out.println("fid=" + fid + "/ scriptID=" + scriptID + ", fi=" + fontIndex + ", si=" + styleIndex);
if (fid >= 0) {
//"allfonts"
return fid;
} else {
}
}
/* Same as getCompoentFontID() except this method returns the fontID define by
* "xxxx.motif" entry.
*/
return 0;
}
if (fid >= 0) {
//"allfonts" > 0 or "not defined" == 0
return fid;
} else {
}
}
if (exID == 0) {
return EMPTY_INT_ARRAY;
} else {
int i = 0;
}
return exInt;
}
}
for (int i = 0; i < limit; i++) {
return true;
}
}
return false;
}
/* Return the PlatformFontName from its fontID*/
if (id < 0) {
return null;
}
}
if (id < 0) {
return null;
}
}
//componentFontID -> componentFileID
return table_filenames[nameID];
}
}
short elc = getInitELC();
/*
System.out.println("getCoreScripts: elc=" + elc + ", fontIndex=" + fontIndex);
short[] ss = getShortArray(table_sequences[elc * NUM_FONTS + fontIndex]);
for (int i = 0; i < ss.length; i++) {
System.out.println(" " + getString((short)table_scriptIDs[ss[i]]));
}
*/
if (preferLocaleFonts) {
if (reorderScripts == null) {
}
}
}
}
return scripts;
}
private static short[] getFallbackScripts() {
}
}
}
throws IOException {
if (len == 0) {
return EMPTY_SHORT_ARRAY;
}
int i = 0,j = 0;
while (i < len) {
}
return data;
}
throws IOException {
}
}
}
return list;
}
//runtime cache
if (stringID == 0)
return null;
/*
if (loadingProperties) {
return stringTable.substring(stringIDs[stringID],
stringIDs[stringID+1]);
}
*/
//sync if we want it to be MT-enabled
new String (table_stringTable,
}
return stringCache[stringID];
}
char[] cc = s.toCharArray();
}
return ss;
}
if (s == null) {
return (short)0;
}
stringTable.append(s);
stringIDNum++;
}
return (short)(stringIDNum - 1);
}
}
return getStringID(s);
}
//utility "empty" objects
//////////////////////////////////////////////////////////////////////////
//Convert the FontConfig data in Properties file to binary data tables //
//////////////////////////////////////////////////////////////////////////
static class PropertiesHandler {
initHashMaps();
}
private void initBinaryTable() {
//(0)
head = new short[HEAD_LENGTH];
// b: scriptFonts scriptID -> componentFontNameID[20]
//if we have a "allfonts.script" def, then we just put
//the "-platformFontID" value in the slot, otherwise the slot
//value is "offset" which "offset" is where 20 entries located
//in the table attached.
table_scriptFonts = new short[len];
}
for (int i = 0; i < 20; i++) {
if (v[i] != null) {
table_scriptFonts[off++] = v[i];
} else {
}
}
}
//(2)
//(3) sequences elcID -> XXXX[1|5] -> scriptID[]
//table_sequences[entry.getKey().intValue()] = (short)-off;
/*
System.out.println("elc=" + k + "/" + getString((short)table_elcIDs[k]));
short[] ss = getShortArray(v[0]);
for (int i = 0; i < ss.length; i++) {
System.out.println(" " + getString((short)table_scriptIDs[ss[i]]));
}
*/
if (v.length == 1) {
//the "allfonts" entries
for (int i = 0; i < NUM_FONTS; i++) {
}
} else {
for (int i = 0; i < NUM_FONTS; i++) {
table_sequences[k * NUM_FONTS + i] = v[i];
}
}
}
//(4)
//(5)
head[INDEX_componentFontNameIDs] = (short)(head[INDEX_fontfileNameIDs] + table_fontfileNameIDs.length);
//(6)componentFontNameID -> filenameID
head[INDEX_filenames] = (short)(head[INDEX_componentFontNameIDs] + table_componentFontNameIDs.length);
}
//(7)scriptID-> awtfontpath
//the paths are stored as scriptID -> stringID in awtfontpahts
}
//(8)exclusions
int j = 0;
}
}
//(9)proportionals
int j = 0;
}
//(10) see (1) for info, the only difference is "xxx.motif"
table_scriptFontsMotif = new short[len];
}
int i = 0;
while (i < 20) {
if (v[i] != null) {
table_scriptFontsMotif[off++] = v[i];
} else {
}
i++;
}
}
} else {
}
//(11)short[] alphabeticSuffix
head[INDEX_alphabeticSuffix] = (short)(head[INDEX_scriptFontsMotif] + table_scriptFontsMotif.length);
j = 0;
}
//(15)short[] fallbackScriptIDs; just put the ID in head
//(16)appendedfontpath
//(17)version
//(12)short[] StringIDs
//(13)StringTable
//(14)
//StringTable cache
}
//////////////////////////////////////////////
//elc -> Encoding.Language.Country
//componentFontNameID starts from "1", "0" reserves for "undefined"
//componentFontNameID -> fontfileNameID
//elcID -> allfonts/logicalFont -> scriptID list
//(1)if we have a "allfonts", then the length of the
// value array is "1", otherwise it's 5, each font
// must have their own individual entry.
//scriptID list "short[]" is stored as an ID
//scriptID ->logicFontID/fontStyleID->componentFontNameID,
//a 20-entry array (5-name x 4-style) for each script
//scriptID -> componentFontNameID
//scriptID -> exclusionRanges[]
//scriptID -> fontpath
//fontID -> fontID
//scriptID -> componentFontNameID
//scriptID ->logicFontID/fontStyleID->componentFontNameID,
//elcID -> stringID of alphabetic/XXXX
private short[] fallbackScriptIDs;
private void initLogicalNameStyle() {
}
private void initHashMaps() {
/*Init these tables to allow componentFontNameID, fontfileNameIDs
to start from "1".
*/
/*
version
appendedfontpath
*/
}
if (exclusions == null) {
return EMPTY_INT_ARRAY;
}
// range format is xxxx-XXXX,yyyyyy-YYYYYY,.....
int numExclusions = 1;
int pos = 0;
pos++;
}
pos = 0;
int newPos = 0;
try {
if (newPos == -1) {
}
throw new Exception();
}
throw new Exception();
}
} catch (Exception e) {
if (FontUtilities.debugFonts() &&
" property of font configuration.");
}
return EMPTY_INT_ARRAY;
}
exclusionRanges[j++] = lo;
exclusionRanges[j++] = up;
}
return exclusionRanges;
}
}
return ret;
}
return null;
}
}
//the only special case is "MingLiu_HKSCS" which has "_" in its
//facename, we dont want to replace the "_" with " "
}
//System.out.println("faceID=" + faceID + "/" + key + " -> "
// + "fileID=" + fileID + "/" + value);
boolean hasDefault = false;
boolean has1252 = false;
//get the scriptID list
//System.out.println(key + " -> " + ss[i]);
ss[i] = "alphabetic";
hasDefault = true;
//System.out.println(key + " -> " + ss[i]);
ss[i] = "alphabetic";
has1252 = true;
}
//System.out.println("scriptID=" + si[i] + "/" + ss[i]);
}
//convert the "short[] -> string -> stringID"
if (dot == -1) {
return;
}
} else {
}
return;
}
} else {
//System.out.println("elcID=" + elcID + "/" + key.substring(dot + 1));
}
short[] scriptArrayIDs = null;
scriptArrayIDs = new short[1];
} else {
if (scriptArrayIDs == null) {
scriptArrayIDs = new short[5];
}
}
return;
}
//System.out.println("sequence." + key + "/" + id);
}
if (hasDefault) {
} else
if (has1252) {
}
//System.out.println("motif: all." + key + "=" + value);
} else {
}
//System.out.println("scriptID=" + getID(scriptIDs, key) + "/" + key);
//System.out.println(key + "=" + value);
} else {
//"name.style.script(.motif)", we dont care anything else
boolean isMotif = false;
if (dot1 == -1) {
" property of font configuration.");
}
return;
}
if (dot2 == -1) {
" property of font configuration.");
}
return;
}
isMotif = true;
//System.out.println("motif: " + key + "=" + value);
}
}
return;
}
if (isMotif) {
} else {
}
}
/*
System.out.println("key=" + key + "/<" + nameID + "><" + styleID
+ "><" + scriptID + ">=" + value
+ "/" + getID(componentFontNameIDs, value));
*/
if (isMotif) {
} else {
}
}
}
}
}