public class FontPreferences
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_FONT_NAME |
static int |
DEFAULT_FONT_SIZE |
static float |
DEFAULT_LINE_SPACING |
static java.lang.String |
FALLBACK_FONT_FAMILY |
static java.lang.String |
JETBRAINS_MONO |
static java.lang.String |
LINUX_DEFAULT_FONT_FAMILY |
static java.lang.String |
MAC_OS_DEFAULT_FONT_FAMILY |
static java.lang.String |
WINDOWS_DEFAULT_FONT_FAMILY |
Constructor and Description |
---|
FontPreferences() |
Modifier and Type | Method and Description |
---|---|
void |
copyTo(FontPreferences preferences) |
static java.lang.String |
getDefaultFontName() |
java.util.List<java.lang.String> |
getEffectiveFontFamilies() |
static java.lang.String |
getFallbackName(java.lang.String fontName,
int fontSize,
EditorColorsScheme fallbackScheme)
There is a possible case that particular font family is not available at particular environment (e.g.
|
java.lang.String |
getFontFamily() |
float |
getLineSpacing() |
java.util.List<java.lang.String> |
getRealFontFamilies() |
int |
getSize(java.lang.String fontFamily) |
boolean |
hasSize(java.lang.String fontName) |
boolean |
useLigatures() |
public static final java.lang.String DEFAULT_FONT_NAME
public static final java.lang.String JETBRAINS_MONO
public static final int DEFAULT_FONT_SIZE
public static final float DEFAULT_LINE_SPACING
public static final java.lang.String FALLBACK_FONT_FAMILY
public static final java.lang.String MAC_OS_DEFAULT_FONT_FAMILY
public static final java.lang.String LINUX_DEFAULT_FONT_FAMILY
public static final java.lang.String WINDOWS_DEFAULT_FONT_FAMILY
public java.util.List<java.lang.String> getEffectiveFontFamilies()
public java.util.List<java.lang.String> getRealFontFamilies()
public java.lang.String getFontFamily()
public int getSize(java.lang.String fontFamily)
public void copyTo(FontPreferences preferences)
public boolean useLigatures()
public boolean hasSize(java.lang.String fontName)
public float getLineSpacing()
public static java.lang.String getFallbackName(java.lang.String fontName, int fontSize, EditorColorsScheme fallbackScheme)
new Font("Monaco", style, size)
, it creates a font object which has font family "Monaco" but is a "Dialog" font.
That's why we have a special check for such a situation.fontName
- font family name to checkfontSize
- target font sizefallbackScheme
- colors scheme to use for fallback fonts retrieval (if necessary);null
if font family with the given name is registered at the current environmentpublic static java.lang.String getDefaultFontName()