| Modifier and Type | Field and Description |
|---|---|
| private static volatile SoftReference | compMapRef
This method is provided for internal and exclusive use by Swing. |
| private static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| private static PlatformLogger | |
| private static boolean | |
| public static final int | MAX_LAYOUT_CHARCODE
Referenced by code in the JDK which wants to test for the maximum char code for which layout may be required. |
| public static final int | MIN_LAYOUT_CHARCODE
Referenced by code in the JDK which wants to test for the minimum char code for which layout may be required. |
| private static final String[][] | |
| public static boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | |
| public static boolean | |
| public static FontUIResource | |
| public static Font2D | |
| public static FontUIResource | |
| public static PlatformLogger | |
| private static void | |
| public static boolean | |
| public static boolean | isComplexScript(char[] chs, int start, int limit)
Return true if there any characters which would trigger layout. |
| public static boolean | isComplexText(char[] chs, int start, int limit)
If there is anything in the text which triggers a case where char->glyph does not map 1:1 in straightforward left->right ordering, then this method returns true. |
| public static boolean | isDefaultIgnorable(int charCode)
Checks whether or not the specified codepoint is ignorable by default, per the Unicode standard (with exceptions for HarfBuzz and Uniscribe compatibility). |
| public static boolean | Returns: whether the specified codepoint is ignorable whitespacethe codepoint to check ch)Checks whether or not the specified codepoint is whitespace which is ignorable at the shaping stage of text rendering. |
| public static boolean | |
| public static boolean | |
| public static void | |
| public static void | |
| public static void | |
| public static String | |
| public static boolean | textLayoutIsCompatible(Font font)
Used by windows printing to assess if a font is likely to be layout compatible with JDK TrueType fonts should be, but if they have no GPOS table, but do have a GSUB table, then they are probably older fonts GDI handles differently. |
| compMapRef | back to summary |
|---|---|
| private static volatile SoftReference<ConcurrentHashMap<PhysicalFont, CompositeFont>> compMapRef This method is provided for internal and exclusive use by Swing. It may be used in conjunction with fontSupportsDefaultEncoding(Font) In the event that a desktop properties font doesn't directly support the default encoding, (ie because the host OS supports adding support for the current locale automatically for native apps), then Swing calls this method to get a font which uses the specified font for the code points it covers, but also supports this locale just as the standard composite fonts do. Note this will over-ride any setting where an application specifies it prefers locale specific composite fonts. The logic for this, is that this method is used only where the user or application has specified that the native L&F be used, and that we should honour that request to use the same font as native apps use. The behaviour of this method is to construct a new composite Font object that uses the specified physical font as its first component, and adds all the components of "dialog" as fall back components. The method currently assumes that only the size and style attributes are set on the specified font. It doesn't copy the font transform or other attributes because they aren't set on a font created from the desktop. This will need to be fixed if use is broadened. Operations such as Font.deriveFont will work properly on the font returned by this method for deriving a different point size. Additionally it tries to support a different style by calling getNewComposite() below. That also supports replacing slot zero with a different physical font but that is expected to be "rare". Deriving with a different style is needed because its been shown that some applications try to do this for Swing FontUIResources. Also operations such as new Font(font.getFontName(..), Font.PLAIN, 14); will NOT yield the same result, as the new underlying CompositeFont cannot be "looked up" in the font registry. This returns a FontUIResource as that is the Font sub-class needed by Swing. Suggested usage is something like : FontUIResource fuir; Font desktopFont = getDesktopFont(..); if (FontManager.fontSupportsDefaultEncoding(desktopFont)) { fuir = new FontUIResource(desktopFont); } else { fuir = FontManager.getCompositeFontUIResource(desktopFont); } return fuir; | |
| debugFonts | back to summary |
|---|---|
| private static boolean debugFonts | |
| isLinux | back to summary |
|---|---|
| public static boolean isLinux | |
| isMacOSX | back to summary |
|---|---|
| public static boolean isMacOSX | |
| isMacOSX14 | back to summary |
|---|---|
| public static boolean isMacOSX14 | |
| isWindows | back to summary |
|---|---|
| public static boolean isWindows | |
| logger | back to summary |
|---|---|
| private static PlatformLogger logger | |
| logging | back to summary |
|---|---|
| private static boolean logging | |
| MAX_LAYOUT_CHARCODE | back to summary |
|---|---|
| public static final int MAX_LAYOUT_CHARCODE Referenced by code in the JDK which wants to test for the maximum char code for which layout may be required. Note this does not account for supplementary characters where the caller interprets 'layout' to mean any case where one 'char' (ie the java type char) does not map to one glyph | |
| MIN_LAYOUT_CHARCODE | back to summary |
|---|---|
| public static final int MIN_LAYOUT_CHARCODE Referenced by code in the JDK which wants to test for the minimum char code for which layout may be required. Note that even basic latin text can benefit from ligatures, eg "ffi" but we presently apply those only if explicitly requested with TextAttribute.LIGATURES_ON. The value here indicates the lowest char code for which failing to invoke layout would prevent acceptable rendering. | |
| nameMap | back to summary |
|---|---|
| private static final String[][] nameMap | |
| useJDKScaler | back to summary |
|---|---|
| public static boolean useJDKScaler | |
| FontUtilities | back to summary |
|---|---|
| public FontUtilities() | |
| debugFonts | back to summary |
|---|---|
| public static boolean debugFonts() | |
| fontSupportsDefaultEncoding | back to summary |
|---|---|
| public static boolean fontSupportsDefaultEncoding(Font font) | |
| getCompositeFontUIResource | back to summary |
|---|---|
| public static FontUIResource getCompositeFontUIResource(Font font) | |
| getFont2D | back to summary |
|---|---|
| public static Font2D getFont2D(Font font) Calls the private getFont2D() method in java.awt.Font objects. | |
| getFontConfigFUIR | back to summary |
|---|---|
| public static FontUIResource getFontConfigFUIR(String fcFamily, int style, int size) | |
| getLogger | back to summary |
|---|---|
| public static PlatformLogger getLogger() | |
| initStatic | back to summary |
|---|---|
private static void initStatic()
| |
| isComplexCharCode | back to summary |
|---|---|
| public static boolean isComplexCharCode(int code) | |
| isComplexScript | back to summary |
|---|---|
| public static boolean isComplexScript(char[] chs, int start, int limit) Return true if there any characters which would trigger layout. This method considers supplementary characters to be simple, since we do not presently invoke layout on any code points in outside the BMP. | |
| isComplexText | back to summary |
|---|---|
| public static boolean isComplexText(char[] chs, int start, int limit) If there is anything in the text which triggers a case where char->glyph does not map 1:1 in straightforward left->right ordering, then this method returns true. Scripts which might require it but are not treated as such due to JDK implementations will not return true. ie a 'true' return is an indication of the treatment by the implementation. Whether supplementary characters should be considered is dependent on the needs of the caller. Since this method accepts the 'char' type then such chars are always represented by a pair. From a rendering perspective these will all (in the cases I know of) still be one unicode character -> one glyph. But if a caller is using this to discover any case where it cannot make naive assumptions about the number of chars, and how to index through them, then it may need the option to have a 'true' return in such a case. | |
| isDefaultIgnorable | back to summary |
|---|---|
| public static boolean isDefaultIgnorable(int charCode) Checks whether or not the specified codepoint is ignorable by default, per the Unicode standard (with exceptions for HarfBuzz and Uniscribe compatibility). The codepoints categorized as ignorable should remain in sync with HarfBuzz's is_default_ignorable() in hb-unicode.hh. See the original Unicode list of default-ignorable codepoints here: 00AD # Cf SOFT HYPHEN 034F # Mn COMBINING GRAPHEME JOINER 061C # Cf ARABIC LETTER MARK 115F..1160 # Lo [2] HANGUL CHOSEONG FILLER..HANGUL JUNGSEONG FILLER 17B4..17B5 # Mn [2] KHMER VOWEL INHERENT AQ..KHMER VOWEL INHERENT AA 180B..180D # Mn [3] MONGOLIAN FREE VARIATION SELECTOR ONE..MONGOLIAN FREE VARIATION SELECTOR THREE 180E # Cf MONGOLIAN VOWEL SEPARATOR 180F # Mn MONGOLIAN FREE VARIATION SELECTOR FOUR 200B..200F # Cf [5] ZERO WIDTH SPACE..RIGHT-TO-LEFT MARK 202A..202E # Cf [5] LEFT-TO-RIGHT EMBEDDING..RIGHT-TO-LEFT OVERRIDE 2060..2064 # Cf [5] WORD JOINER..INVISIBLE PLUS 2065 # Cn | |
| isIgnorableWhitespace | back to summary |
|---|---|
| public static boolean isIgnorableWhitespace(int ch) Checks whether or not the specified codepoint is whitespace which is ignorable at the shaping stage of text rendering. These ignorable whitespace characters should be used prior to text shaping and rendering to determine the position of the text, but are not themselves rendered. Includes 0x0009 (horizontal tab / TAB), 0x000A (line feed / LF), 0x000B (vertical tab / VT), 0x000C (form feed / FF), 0x000D (carriage return / CR), 0x0085 (next line / NEL), 0x2028 (line separator / LS), 0x2029 (paragraph separator / PS).
| |
| isLogging | back to summary |
|---|---|
| public static boolean isLogging() | |
| isNonSimpleChar | back to summary |
|---|---|
| public static boolean isNonSimpleChar(char ch) | |
| logInfo | back to summary |
|---|---|
| public static void logInfo(String s) | |
| logSevere | back to summary |
|---|---|
| public static void logSevere(String s) | |
| logWarning | back to summary |
|---|---|
| public static void logWarning(String s) | |
| mapFcName | back to summary |
|---|---|
| public static String mapFcName(String name) | |
| textLayoutIsCompatible | back to summary |
|---|---|
| public static boolean textLayoutIsCompatible(Font font) Used by windows printing to assess if a font is likely to be layout compatible with JDK TrueType fonts should be, but if they have no GPOS table, but do have a GSUB table, then they are probably older fonts GDI handles differently. | |