public class TextFamily extends TextCellFactory
TextCellFactory
that allows switching between regular, bold, italic, and bold italic styles.
It adds only one field to TextCellFactory, and is interchangeable except that (potentially importantly) it does not
correctly render chars above '\\u3fff'
due to using some of the bits that normally represent late-in-Unicode
character codes to instead represent bold and italic modes. Two TextFamily values are present in DefaultResources,
DefaultResources.getLeanFamily()
and DefaultResources.getSlabFamily()
; using them is currently the
recommended way to use this class.
GDXMarkup.colorString(CharSequence)
to produce an IColoredString
that contains the specially-altered chars that store bold and italic mode data.
TextCellFactory.Glyph
Modifier and Type | Field and Description |
---|---|
static int |
BOLD |
static int |
BOLD_ITALIC |
static int |
ITALIC |
static int |
REGULAR |
actualCellHeight, actualCellWidth, assetManager, block, bmpFont, bottomPadding, DEFAULT_FITTING, descent, directionGlyph, dirMarker, distanceField, distanceFieldScaleX, distanceFieldScaleY, fitting, glyphTextures, height, initialized, initializedByFont, initializedBySize, leftPadding, lineHeight, msdf, mut, rightPadding, scc, shader, smoothingMultiplier, SQUID_FITTING, style, swap, topPadding, width
Constructor and Description |
---|
TextFamily()
Creates a default valued factory.
|
TextFamily(com.badlogic.gdx.assets.AssetManager assetManager)
A default valued factory that uses the given
AssetManager to load
the font file. |
Modifier and Type | Method and Description |
---|---|
TextFamily |
copy() |
TextFamily |
defaultFamilyLeanDistance() |
TextFamily |
defaultFamilySlabDistance() |
int |
supportedStyles()
How many styles are supported by this TextCellFactory; always 4 in TextFamily.
|
addFit, addSwap, addSwap, addSwaps, antialias, antialias, bottomPadding, bottomPadding, clearSwaps, configureShader, defaultDistanceFieldFont, defaultFont, defaultNarrowDistanceFieldFont, defaultNarrowFont, defaultSquareFont, dispose, draw, draw, draw, draw, draw, draw, draw, draw, draw, draw, draw, draw, draw, draw, draw, draw, draw, draw, fit, fit, fitAll, font, font, font, fontDistanceField, fontMultiDistanceField, getAllSwaps, getDescent, getDirectionGlyph, getDistanceFieldScaleX, getDistanceFieldScaleY, getGlyphs, getSmoothingMultiplier, getSolid, glyph, glyph, height, height, includedFont, initByFont, initBySize, initialized, initVerbatim, isDistanceField, isMultiDistanceField, leftPadding, leftPadding, makeActor, makeActor, makeActor, makeActor, makeActor, makeActor, makeActor, makeActor, makeActor, makeActor, makeActor, makeActor, makeActor, makeActor, makeActor, makeDirectionMarker, makeDirectionMarker, makeGlyphImage, makeGlyphImage, makeGlyphImage, makeWrappingString, padding, removeSwap, removeSwap, resetSize, resetSize, rightPadding, rightPadding, setAllFixedWidth, setAllSwaps, setColorCenter, setDirectionGlyph, setSmoothingMultiplier, setStyle, topPadding, topPadding, tweakHeight, tweakWidth, width, width, willFit
public static final int REGULAR
public static final int BOLD
public static final int ITALIC
public static final int BOLD_ITALIC
public TextFamily()
public TextFamily(com.badlogic.gdx.assets.AssetManager assetManager)
AssetManager
to load
the font file. Use this constructor if you are likely to load the same
font over and over (recall that, without an AssetManager
, each
instance of TextCellFactory
will load its font from disk). This
primarily matters if you are using fonts not bundled with SquidLib, since
accessing a BitmapFont with a method (not a String) from DefaultResources
caches the BitmapFont already.assetManager
- an ordinary libGDX AssetManagerpublic int supportedStyles()
supportedStyles
in class TextCellFactory
public TextFamily copy()
copy
in class TextCellFactory
public TextFamily defaultFamilyLeanDistance()
public TextFamily defaultFamilySlabDistance()
Copyright © Eben Howard 2012–2022. All rights reserved.