public static class Font.FontFamily
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
Font[] |
connected
Stores this Font and up to 15 other connected Fonts that can be switched between using [@Name] syntax.
|
com.badlogic.gdx.utils.ObjectIntMap<java.lang.String> |
fontAliases
Stores the names of Fonts (or aliases for those Fonts) as keys, mapped to ints between 0 and 15 inclusive.
|
| Constructor and Description |
|---|
FontFamily()
Creates a FontFamily that only allows staying on the same font, unless later configured otherwise.
|
FontFamily(Font.FontFamily other)
Copy constructor for another FontFamily.
|
FontFamily(Font[] fonts)
Creates a FontFamily given an array of Font values, using the
Font.name of each Font as its alias. |
FontFamily(Font[] fonts,
int offset,
int length)
Creates a FontFamily given an array of Font values that and offset/length values for those arrays (allowing
Array to sometimes be used to get the items for fonts). |
FontFamily(com.badlogic.gdx.utils.OrderedMap<java.lang.String,Font> map)
Constructs a FontFamily given an OrderedMap of String keys (names of Fonts) to Font values (the Fonts that
can be switched between).
|
FontFamily(java.lang.String[] aliases,
Font[] fonts)
Creates a FontFamily given an array of String names and a (almost-always same-sized) array of Font values
that those names will refer to.
|
FontFamily(java.lang.String[] aliases,
Font[] fonts,
int offset,
int length)
Creates a FontFamily given an array of String names, a (almost-always same-sized) array of Font values that
those names will refer to, and offset/length values for those arrays (allowing
Array to sometimes be
used to get the items for aliases and fonts). |
| Modifier and Type | Method and Description |
|---|---|
Font |
get(java.lang.String name)
Gets the corresponding Font for a name/alias, or null if it was not found.
|
public final Font[] connected
public final com.badlogic.gdx.utils.ObjectIntMap<java.lang.String> fontAliases
connected.public FontFamily()
public FontFamily(Font[] fonts)
Font.name of each Font as its alias.
This allows switching to different fonts using the [@Name] syntax. This also registers aliases for the
Strings "0" through up to "15" to refer to the Font values with the same indices (it can register fewer
aliases than up to "15" if there are fewer than 16 Fonts). You should avoid using more than 16 fonts here.fonts - a non-null array of Font values that should each have their name set (as by Font.setName(String)public FontFamily(Font[] fonts, int offset, int length)
Array to sometimes be used to get the items for fonts). This uses the Font.name of each Font
as its alias. This allows switching to different fonts using the [@Name] syntax. This registers aliases for
the Strings "0" through up to "15" to refer to the Font values with the same indices (it can register fewer
aliases than up to "15" if there are fewer than 16 Fonts). You should avoid using more than 16 fonts here.fonts - an array of Font values that should have the same length as aliases (no more than 16)offset - where to start accessing fonts, as a non-negative indexlength - how many items to use from fonts, if that many are providedpublic FontFamily(java.lang.String[] aliases,
Font[] fonts)
Font.name of each Font as an alias. You should avoid using more than 16 fonts here. You should avoid
using more than 16 fonts with this.aliases - a non-null array of up to 16 String names to use for fonts (individual items may be null)fonts - a non-null array of Font values that should have the same length as aliases (no more than 16)public FontFamily(java.lang.String[] aliases,
Font[] fonts,
int offset,
int length)
Array to sometimes be
used to get the items for aliases and fonts). This allows switching to different fonts using the [@Name]
syntax. This registers aliases for the Strings "0" through up to "15" to refer to the Font values with the
same indices (it can register fewer aliases than up to "15" if there are fewer than 16 Fonts). It also
registers the Font.name of each Font as an alias. You should avoid using more than 16 fonts here.aliases - an array of up to 16 String names to use for fonts (individual items may be null)fonts - an array of Font values that should have the same length as aliases (no more than 16)offset - where to start accessing aliases and fonts, as a non-negative indexlength - how many items to use from aliases and fonts, if that many are providedpublic FontFamily(com.badlogic.gdx.utils.OrderedMap<java.lang.String,Font> map)
Font.name of each Font as an alias. This only uses up to
the first 16 keys of map.map - an OrderedMap of String keys to Font valuespublic FontFamily(Font.FontFamily other)
connected will not be copied, and the same
references will be used.other - another, non-null, FontFamily to copy into this.public Font get(java.lang.String name)
name - a name or alias for a font, such as "Gentium" or "2"