| java.lang.Object org.jvnet.substance.fonts.Fonts
Fonts | final public class Fonts (Code) | | Provides static access to popular Windows fonts. The sizes of the font
constants are specified in typographic points, approximately 1/72
of an inch.
TODO: Consider changing the visibility of the package private methods to
public. As an alternative we may provide a FontPolicy that can emulate the
font choice on Windows XP/2000 and Windows Vista for different software
resolutions (96dpi/120dpi) and desktop font size settings (Normal/Large/Extra
Large).
author: Karsten Lentzsch version: $Revision: 1.4 $ See Also: FontSet See Also: FontSets See Also: FontPolicy See Also: FontPolicies since: 2.0 |
Field Summary | |
final public static Font | SEGOE_UI_12PT This is Segoe UI 9pt, the default font on western Vista with 96dpi. | final public static Font | SEGOE_UI_13PT Ascent=14, descent=4, height=18, dbuX=8, dbuY=14, 13dluY=22.75px. | final public static Font | SEGOE_UI_15PT Ascent=16, descent=5, height=21, dbuX=9, dbuY=16, 13dluY=26px. | final public static String | SEGOE_UI_NAME The name of the default dialog font on western Windows Vista. | final public static Font | TAHOMA_11PT This is the default font on western XP with 96dpi and normal fonts. | final public static Font | TAHOMA_13PT Ascent=13, descent=3, height=16, dbuX=8, dbuY=13, 14dluY=22.75px. | final public static Font | TAHOMA_14PT Ascent=14, descent=3, height=17, dbuX=8, dbuY=14, 14dluY=24.5px. | final public static String | TAHOMA_NAME The name of the default dialog font on western Windows XP. | final static String | WINDOWS_DEFAULT_GUI_FONT_KEY The desktop property key used to lookup the DEFAULTGUI font. | final static String | WINDOWS_ICON_FONT_KEY The desktop property key used to lookup Windows' icon font. | final static Font | WINDOWS_VISTA_101DPI_NORMAL The default icon font on western Windows Vista with 101dpi and the dialog
font desktop setting "Normal". | final public static Font | WINDOWS_VISTA_120DPI_NORMAL The default icon font on western Windows Vista with 120dpi and the dialog
font desktop setting "Normal". | final public static Font | WINDOWS_VISTA_96DPI_LARGE The default icon font on western Windows Vista with 96dpi and the dialog
font desktop setting "Large". | final public static Font | WINDOWS_VISTA_96DPI_NORMAL The default icon font on western Windows Vista with 96dpi and the dialog
font desktop setting "Normal". | final public static Font | WINDOWS_XP_120DPI_DEFAULT_GUI The default GUI font on western Windows XP with 120dpi and the dialog
font desktop setting "Normal". | final public static Font | WINDOWS_XP_120DPI_NORMAL The default icon font on western Windows XP with 120dpi and the dialog
font desktop setting "Normal". | final public static Font | WINDOWS_XP_96DPI_DEFAULT_GUI The default GUI font on western Windows XP with 96dpi and the dialog font
desktop setting "Normal". | final public static Font | WINDOWS_XP_96DPI_LARGE The default icon font on western Windows XP with 96dpi and the dialog
font desktop setting "Large". | final public static Font | WINDOWS_XP_96DPI_NORMAL The default icon font on western Windows XP with 96dpi and the dialog
font desktop setting "Normal". |
SEGOE_UI_12PT | final public static Font SEGOE_UI_12PT(Code) | | This is Segoe UI 9pt, the default font on western Vista with 96dpi.
Ascent=13, descent=4, height=17, dbuX=7, dbuY=13, 13dluY=21.125px.
|
SEGOE_UI_13PT | final public static Font SEGOE_UI_13PT(Code) | | Ascent=14, descent=4, height=18, dbuX=8, dbuY=14, 13dluY=22.75px.
|
SEGOE_UI_15PT | final public static Font SEGOE_UI_15PT(Code) | | Ascent=16, descent=5, height=21, dbuX=9, dbuY=16, 13dluY=26px.
|
SEGOE_UI_NAME | final public static String SEGOE_UI_NAME(Code) | | The name of the default dialog font on western Windows Vista.
|
TAHOMA_11PT | final public static Font TAHOMA_11PT(Code) | | This is the default font on western XP with 96dpi and normal fonts.
Ascent=11, descent=3, height=14, dbuX=6, dbuY=12, 14dluY=21px.
|
TAHOMA_13PT | final public static Font TAHOMA_13PT(Code) | | Ascent=13, descent=3, height=16, dbuX=8, dbuY=13, 14dluY=22.75px.
|
TAHOMA_14PT | final public static Font TAHOMA_14PT(Code) | | Ascent=14, descent=3, height=17, dbuX=8, dbuY=14, 14dluY=24.5px.
|
TAHOMA_NAME | final public static String TAHOMA_NAME(Code) | | The name of the default dialog font on western Windows XP.
|
WINDOWS_DEFAULT_GUI_FONT_KEY | final static String WINDOWS_DEFAULT_GUI_FONT_KEY(Code) | | The desktop property key used to lookup the DEFAULTGUI font. This font
scales with the software resolution only but works in western and
non-western Windows environments.
See Also: Fonts.getWindowsControlFont() |
WINDOWS_ICON_FONT_KEY | final static String WINDOWS_ICON_FONT_KEY(Code) | | The desktop property key used to lookup Windows' icon font. This font
scales with the software resolution and the desktop font size setting
(Normal/Large/Extra Large). However, in some non-western Windows
environments this font cannot display the locale's glyphs.
Implementation Note: Windows uses the icon font to label icons in the
Windows Explorer and other places. It seems to me that this works in
non-western environments due to font chaining.
See Also: Fonts.getWindowsControlFont() |
WINDOWS_VISTA_101DPI_NORMAL | final static Font WINDOWS_VISTA_101DPI_NORMAL(Code) | | The default icon font on western Windows Vista with 101dpi and the dialog
font desktop setting "Normal".
TODO: Check if this shall be removed or not.
|
WINDOWS_VISTA_120DPI_NORMAL | final public static Font WINDOWS_VISTA_120DPI_NORMAL(Code) | | The default icon font on western Windows Vista with 120dpi and the dialog
font desktop setting "Normal".
|
WINDOWS_VISTA_96DPI_LARGE | final public static Font WINDOWS_VISTA_96DPI_LARGE(Code) | | The default icon font on western Windows Vista with 96dpi and the dialog
font desktop setting "Large".
|
WINDOWS_VISTA_96DPI_NORMAL | final public static Font WINDOWS_VISTA_96DPI_NORMAL(Code) | | The default icon font on western Windows Vista with 96dpi and the dialog
font desktop setting "Normal".
|
WINDOWS_XP_120DPI_DEFAULT_GUI | final public static Font WINDOWS_XP_120DPI_DEFAULT_GUI(Code) | | The default GUI font on western Windows XP with 120dpi and the dialog
font desktop setting "Normal".
|
WINDOWS_XP_120DPI_NORMAL | final public static Font WINDOWS_XP_120DPI_NORMAL(Code) | | The default icon font on western Windows XP with 120dpi and the dialog
font desktop setting "Normal".
|
WINDOWS_XP_96DPI_DEFAULT_GUI | final public static Font WINDOWS_XP_96DPI_DEFAULT_GUI(Code) | | The default GUI font on western Windows XP with 96dpi and the dialog font
desktop setting "Normal".
|
WINDOWS_XP_96DPI_LARGE | final public static Font WINDOWS_XP_96DPI_LARGE(Code) | | The default icon font on western Windows XP with 96dpi and the dialog
font desktop setting "Large".
|
WINDOWS_XP_96DPI_NORMAL | final public static Font WINDOWS_XP_96DPI_NORMAL(Code) | | The default icon font on western Windows XP with 96dpi and the dialog
font desktop setting "Normal".
|
canDisplayLocalizedText | public static Boolean canDisplayLocalizedText(Font font, Locale locale)(Code) | | Checks and answers whether the given font can display text that is
localized for the specified locale. Returns null if we
can't test it.
First checks, if the locale's display language is available in localized
form, for example "Deutsch" for the German locale. If so, we check if the
given font can display the localized display language.
Otherwise we check some known combinations of fonts and locales and
return the associated results. For all other combinations,
null is returned to indicate that we don't know whether
the font can display text in the given locale.
Parameters: font - the font to be tested Parameters: locale - the locale to be used Boolean.TRUE if the font can display the locale'stext, Boolean.FALSE if not, null ifwe don't know since: 2.0.4 |
getDefaultGUIFontWesternModernWindowsNormal | static Font getDefaultGUIFontWesternModernWindowsNormal()(Code) | | |
getDefaultIconFontWesternModernWindowsNormal | static Font getDefaultIconFontWesternModernWindowsNormal()(Code) | | |
getDefaultIconFontWesternWindowsVistaNormal | static Font getDefaultIconFontWesternWindowsVistaNormal()(Code) | | |
getLooks1xWindowsControlFont | static Font getLooks1xWindowsControlFont()(Code) | | Returns the Windows control font used by the JGoodies Looks version 1.x.
It is intended for visual backward compatibility only. The font returned
is the default GUI font that scales with the resolution (96dpi, 120dpi,
etc) but not with the desktop font size settings (normal, large, extra
large).
On Windows Vista, the font may be completely wrong.
the Windows default GUI font that scales with the resolution, butnot the desktop font size setting throws: UnsupportedOperationException - on non-Windows platforms |
getWindowsControlFont | public static Font getWindowsControlFont()(Code) | | Looks up and returns the Windows control font. Returns the Windows icon
title font unless it is inappropriate for the Windows version, Java
renderer, or locale.
The icon title font scales with the resolution (96dpi, 101dpi, 120dpi,
etc) and the desktop font size settings (normal, large, extra large).
Older versions may return a poor font. Also, since Java 1.4 and Java 5
render the Windows Vista icon font Segoe UI poorly, we return the default
GUI font in these environments.
The last check is, if the icon font can display text in the default
locale. Therefore we test if the locale's localized display name can be
displayed by the icon font. For example, Tahoma can display "English",
"Deutsch", but not the display name for "Chinese" in Chinese.
the Windows control font throws: UnsupportedOperationException - on non-Windows platforms |
|
|