Package squidpony.squidgrid.gui.gdx
Class DefaultResources
java.lang.Object
squidpony.squidgrid.gui.gdx.DefaultResources
- All Implemented Interfaces:
com.badlogic.gdx.LifecycleListener
public class DefaultResources extends Object implements com.badlogic.gdx.LifecycleListener
Default BitmapFonts, a sample image, "stretchable" fonts and icons, and a central RNG for use with LibGDX.
All but one of the resources here need to be downloaded separately, to avoid bloating the size of the dependency jar
with many fonts that a game probably won't use. You can download assets in a jar with a release of SquidLib, or
individually from https://github.com/SquidPony/SquidLib/tree/master/assets . The assets you choose should go in the
android/assets (core/assets if you don't have an Android project) subfolder of your game if you use the normal libGDX
setup tool or SquidSetup, or the assets subfolder if you use czyzby's alternate setup tool,
https://github.com/czyzby/gdx-setup . They should not be placed in subdirectories of assets, otherwise this won't be
able to find them.
The fonts provided are mostly monospaced, with most looking rather similar (straight orthogonal lines and right-angle curves), but some that look... better than the rest. For monospaced fonts that could be used on a grid in SquidPanel or SquidLayers, it is recommended that you use a "stretchable" font (which use a signed distance field, or SDF, effect to stretch smoothly) or a "crisp" font (which use a multi-channel signed distance field, or MSDF, effect to stretch smoothly and remain sharp at very high zooms). For some usage you may want a TextFamily instead of a normal TextCellFactory or BitmapFont; these TextFamily fonts store regular, bold, italic, and bold-italic faces in one file, and
If you can't decide, go with
The most Latin script support for a monospaced font is in the font Mandrill, accessible by getDefaultUnicodeFont() and getLargeUnicodeFont() in two different sizes, and the latter should be suitable for everything from Spanish and French, to Polish to Vietnamese. You can use Gentium for even better language support with a variable-width font in TextPanel or the like; it is accessible with getStretchablePrintFont(). Google's Noto font also supports many glyphs in a variable-width format; it is accessible with getStretchableCleanFont() but may have some issues with baseline level changing and character-to-character alignment seeming too high or low.
The sample image is a tentacle taken from a public domain icon collection graciously released by Henrique Lazarini; it's fitting for SquidLib to have a tentacle as a logo or something, I guess?
The icons are from http://game-icons.net , there are over 2000 of them, and they're among the only images that should both be recolor-able easily (like chars in a font) and resize-able easily if you use a stretchable font at the same time. The stretchable font TextCellFactories do some work with shaders that makes most images look incorrect, but allow distance field fonts and these distance field icons to resize smoothly. Mixing stretchable fonts with non-stretchable images or fonts is not a great idea, and usually involves a slow shader change back and forth.
You can get a default RNG with getGuiRandom(); this should probably not be reused for non-GUI-related randomness, but is meant instead to be used wherever randomized purely-aesthetic effects are needed, such as a jiggling effect. Created by Tommy Ettinger on 7/11/2015.
The fonts provided are mostly monospaced, with most looking rather similar (straight orthogonal lines and right-angle curves), but some that look... better than the rest. For monospaced fonts that could be used on a grid in SquidPanel or SquidLayers, it is recommended that you use a "stretchable" font (which use a signed distance field, or SDF, effect to stretch smoothly) or a "crisp" font (which use a multi-channel signed distance field, or MSDF, effect to stretch smoothly and remain sharp at very high zooms). For some usage you may want a TextFamily instead of a normal TextCellFactory or BitmapFont; these TextFamily fonts store regular, bold, italic, and bold-italic faces in one file, and
GDXMarkup
can produce text that will render in those faces. Some good choices for fonts here are
Iosevka, which comes in a sans-serif version with getStretchableLeanFont()
, getCrispLeanFont()
,
getCrispLeanFamily()
, and more, as well as a slab-serif version with getStretchableSlabFont()
,
getCrispSlabFont()
, and getCrispSlabFamily()
, among others, as well as Inconsolata-LGC, which is
more geometric sans-serif accessible with getStretchableFont()
, or (well-suited for square glyphs)
getStretchableSquareFont()
(it does not have a crisp variety). Another is Computer Modern, accessible by
getStretchableTypewriterFont()
, which has a chunky, ornamented style. For variable-width fonts
that can be used in TextPanel, among others, you can use the recommended crisp font family Noto Serif
with getCrispPrintFamily()
, or for stretchable fonts there's the serif font Gentium with
getStretchablePrintFont()
or Noto Sans with getStretchableCleanFont()
(Noto Sans currently has
problems that Noto Serif does not have). All of the fonts so far support the Latin, Greek, and Cyrillic alphabets.
If you can't decide, go with
getCrispLeanFont()
or getCrispSlabFont()
, which return TextCellFactory
objects, and call their .width(int), .height(int), and .initBySize() methods to make them the size (and aspect ratio)
you want. You can use stretchable or crisp fonts with equal width and height to make
a horizontally-stretched version of a square font instead of the existing square fonts that add blank space.
The most Latin script support for a monospaced font is in the font Mandrill, accessible by getDefaultUnicodeFont() and getLargeUnicodeFont() in two different sizes, and the latter should be suitable for everything from Spanish and French, to Polish to Vietnamese. You can use Gentium for even better language support with a variable-width font in TextPanel or the like; it is accessible with getStretchablePrintFont(). Google's Noto font also supports many glyphs in a variable-width format; it is accessible with getStretchableCleanFont() but may have some issues with baseline level changing and character-to-character alignment seeming too high or low.
The sample image is a tentacle taken from a public domain icon collection graciously released by Henrique Lazarini; it's fitting for SquidLib to have a tentacle as a logo or something, I guess?
The icons are from http://game-icons.net , there are over 2000 of them, and they're among the only images that should both be recolor-able easily (like chars in a font) and resize-able easily if you use a stretchable font at the same time. The stretchable font TextCellFactories do some work with shaders that makes most images look incorrect, but allow distance field fonts and these distance field icons to resize smoothly. Mixing stretchable fonts with non-stretchable images or fonts is not a great idea, and usually involves a slow shader change back and forth.
You can get a default RNG with getGuiRandom(); this should probably not be reused for non-GUI-related randomness, but is meant instead to be used wherever randomized purely-aesthetic effects are needed, such as a jiggling effect. Created by Tommy Ettinger on 7/11/2015.
-
Field Summary
-
Method Summary
Modifier and Type Method Description void
dispose()
Called when theApplication
is about to be disposedstatic TextCellFactory
getCrispCarvedFont()
Returns a TextCellFactory already configured to use a partially-angular variable-width font with good Unicode support and an appearance as if it were carved into solid rock, that should scale cleanly to even very large sizes (using an MSDF technique).static TextCellFactory
getCrispCurvySquareFont()
Returns a TextCellFactory already configured to use an all-caps (with lighter-weight versions of upper-case letters for the lower-case glyphs) square font that should scale cleanly to many sizes.static TextCellFactory
getCrispDejaVuFont()
Returns a TextCellFactory already configured to use a fixed-width sans-serif font with excellent Unicode support, that should scale cleanly to even very large sizes.static TextCellFactory
getCrispIconFont()
Returns a TextCellFactory already configured to use a fixed-width icon font (no letters are supported) using the Font-Awesome icon set, that should scale cleanly to even very large sizes.static TextFamily
getCrispLeanFamily()
Returns a TextFamily already configured to use a highly-legible fixed-width font with good Unicode support and a sans-serif geometric style, that should scale cleanly to many sizes (using an MSDF technique) and supports 4 styles (regular, bold, italic, and bold italic).static TextCellFactory
getCrispLeanFont()
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support and a sans-serif geometric style, that should scale cleanly to even very large sizes (using an MSDF technique).static TextCellFactory
getCrispLeanItalicFont()
Deprecated.usegetCrispLeanFamily()
insteadstatic TextCellFactory
getCrispOctagonalSquareFont()
Returns a TextCellFactory already configured to use a square font with 45-degree angled sections, based on the typeface used on the Atari ST console, that should scale cleanly to many sizes.static TextFamily
getCrispPrintFamily()
Returns a TextFamily already configured to use a variable-width serif font that should look like the serif fonts used in many novels' main texts, and that should scale cleanly to many sizes using an MSDF technique, and supports 4 styles (regular, bold, italic, and bold italic).static TextCellFactory
getCrispRobotoSansFont()
Returns a TextCellFactory already configured to use a variable-width sans-serif font with good Unicode support and a no-nonsense look, that should scale cleanly to even very large or small sizes (using an MSDF technique).static TextFamily
getCrispSlabFamily()
Returns a TextFamily already configured to use a highly-legible fixed-width font with good Unicode support and a slab-serif geometric style, that should scale cleanly to many sizes (using an MSDF technique) and supports 4 styles (regular, bold, italic, and bold italic).static TextCellFactory
getCrispSlabFont()
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support and a slab-serif geometric style, that should scale cleanly to even very large sizes (using an MSDF technique).static TextCellFactory
getCrispSlabItalicFont()
Deprecated.usegetCrispSlabFamily()
insteadstatic com.badlogic.gdx.graphics.g2d.BitmapFont
getDefaultFont()
Returns a 12x12px, stretched but curvaceous font as an embedded resource.static com.badlogic.gdx.graphics.g2d.BitmapFont
getDefaultNarrowFont()
Returns a 6x12px, narrow and curving font as an embedded resource.static com.badlogic.gdx.graphics.g2d.BitmapFont
getDefaultUnicodeFont()
Returns a 6x16px, narrow and curving font with a lot of unicode chars as an embedded resource.static com.badlogic.gdx.graphics.g2d.BitmapFont
getExtraLargeNarrowFont()
Returns a 12x24px, narrow and curving font as an embedded resource.static TextFamily
getGoFamily()
Returns a TextFamily already configured to use a fixed-width font with good Unicode support and a traditional serif style, that should scale cleanly to many sizes and supports 4 styles (regular, bold, italic, and bold italic).static StatefulRNG
getGuiRandom()
This is a static global StatefulRNG that's meant for usage in cases where the seed does not matter and any changes to this RNG's state will not change behavior elsewhere in the program; this means the GUI mainly.static com.badlogic.gdx.graphics.g2d.TextureAtlas
getIconAtlas()
Gets a TextureAtlas containing many icons with a distance field effect applied, allowing them to be used with "stretchable" fonts and be resized in the same way.static com.badlogic.gdx.graphics.g2d.BitmapFont
getIncludedFont()
Gets the one font guaranteed to be included in libGDX, which is Arial at size 15 px.static com.badlogic.gdx.graphics.g2d.BitmapFont
getLargeFont()
Returns a 24x24px, stretched but curvaceous font as an embedded resource.static com.badlogic.gdx.graphics.g2d.BitmapFont
getLargeNarrowFont()
Returns a 12x24px, narrow and curving font as an embedded resource.static com.badlogic.gdx.graphics.g2d.BitmapFont
getLargeSmoothFont()
Returns a 12x24px, very smooth and generally good-looking font (based on Inconsolata) as an embedded resource.static com.badlogic.gdx.graphics.g2d.BitmapFont
getLargeUnicodeFont()
Returns a 12x32px, narrow and curving font with a lot of unicode chars as an embedded resource.static TextFamily
getLeanFamily()
Returns a TextFamily already configured to use a highly-legible fixed-width font with good Unicode support and a sans-serif geometric style, that should scale cleanly to many sizes and supports 4 styles (regular, bold, italic, and bold italic).static com.badlogic.gdx.graphics.g2d.BitmapFont
getLessTinyFont()
Returns a 8x20px, extremely thin font (that may be barely legible) as an embedded resource.static com.badlogic.gdx.graphics.g2d.BitmapFont
getOctagonalMonoFont()
Returns a 14x27px font with fairly good Unicode coverage and an octagonal, angular look, as an embedded resource.static SquidColorCenter
getSCC()
This is a static global SquidColorCenter that can be used in places that just need an existing object that can do things like analyze hue or saturation of a color.static com.badlogic.gdx.graphics.g2d.BitmapFont
getSevenTwelveFont()
Returns a 7x12px font with identical (excellent) Unicode coverage to Iosevka, as an embedded resource.static TextFamily
getSlabFamily()
Returns a TextFamily already configured to use a highly-legible fixed-width font with good Unicode support and a slab-serif geometric style, that should scale cleanly to many sizes and supports 4 styles (regular, bold, italic, and bold italic).static com.badlogic.gdx.graphics.g2d.BitmapFont
getSmoothFont()
Returns a 8x18px, very smooth and generally good-looking font (based on Inconsolata) as an embedded resource.static com.badlogic.gdx.graphics.g2d.BitmapFont
getSquareSmoothFont()
Returns a 25x25px, very smooth and generally good-looking font (based on Inconsolata) as an embedded resource.static TextCellFactory
getStretchableCleanFont()
Returns a TextCellFactory already configured to use a variable-width sans-serif font that currently looks slightly jumbled without certain layout features.static TextCellFactory
getStretchableCodeFont()
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with broad Unicode support that should scale cleanly to many sizes.static TextCellFactory
getStretchableCodeJPFont()
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with strong CJK support (in particular, very good coverage for Japanese) that should scale cleanly to many sizes.static TextCellFactory
getStretchableDejaVuFont()
Returns a TextCellFactory already configured to use a font with extremely wide Unicode support that should scale cleanly to many sizes.static TextCellFactory
getStretchableFont()
Returns a TextCellFactory already configured to use a narrow font (twice as tall as it is wide) that should scale cleanly to many sizes.static TextCellFactory
getStretchableHeavySquareFont()
Returns a TextCellFactory already configured to use an blocky, fairly-bold square font that should scale cleanly to many sizes.static TextCellFactory
getStretchableLeanFont()
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support and a thin, geometric style, that should scale cleanly to many sizes.static TextCellFactory
getStretchableLeanLightFont()
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support and a very thin, geometric style, that should scale cleanly to many sizes.static TextCellFactory
getStretchableOrbitFont()
Returns a TextCellFactory already configured to use a variable-width sans-serif font that should have a blocky, futuristic look (based on the font Orbitron), and that should scale cleanly to many sizes.static TextCellFactory
getStretchablePrintFont()
Returns a TextCellFactory already configured to use a variable-width serif font that should look like the serif fonts used in many novels' main texts, and that should scale cleanly to many sizes.static TextCellFactory
getStretchableSlabFont()
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support and a slab-serif geometric style, that should scale cleanly to many sizes.static TextCellFactory
getStretchableSlabLightFont()
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support and a very thin, slab-serif geometric style, that should scale cleanly to many sizes.static TextCellFactory
getStretchableSquareFont()
Returns a TextCellFactory already configured to use a square font that should scale cleanly to many sizes.static TextCellFactory
getStretchableTypewriterFont()
Returns a TextCellFactory already configured to use a narrow typewriter-style serif font that should scale cleanly to many sizes.static com.badlogic.gdx.graphics.g2d.TextureRegion
getTentacle()
Gets an image of a (squid-like, for SquidLib) tentacle, 32x32px.static com.badlogic.gdx.graphics.g2d.BitmapFont
getTinyFont()
Returns a 4x10px, extremely thin font (that may be barely legible) as an embedded resource.void
pause()
Called when theApplication
is about to pausevoid
resume()
Called when the Application is about to be resumed
-
Field Details
-
squareName
- See Also:
- Constant Field Values
-
squareTexture
- See Also:
- Constant Field Values
-
narrowName
- See Also:
- Constant Field Values
-
narrowTexture
- See Also:
- Constant Field Values
-
unicodeName
- See Also:
- Constant Field Values
-
unicodeTexture
- See Also:
- Constant Field Values
-
squareNameLarge
- See Also:
- Constant Field Values
-
squareTextureLarge
- See Also:
- Constant Field Values
-
narrowNameLarge
- See Also:
- Constant Field Values
-
narrowTextureLarge
- See Also:
- Constant Field Values
-
unicodeNameLarge
- See Also:
- Constant Field Values
-
unicodeTextureLarge
- See Also:
- Constant Field Values
-
narrowNameExtraLarge
- See Also:
- Constant Field Values
-
narrowTextureExtraLarge
- See Also:
- Constant Field Values
-
tinyName
- See Also:
- Constant Field Values
-
tinyTexture
- See Also:
- Constant Field Values
-
lessTinyName
- See Also:
- Constant Field Values
-
lessTinyTexture
- See Also:
- Constant Field Values
-
sevenTwelveName
- See Also:
- Constant Field Values
-
sevenTwelveTexture
- See Also:
- Constant Field Values
-
computerSaysNoName
- See Also:
- Constant Field Values
-
computerSaysNoTexture
- See Also:
- Constant Field Values
-
smoothName
- See Also:
- Constant Field Values
-
smoothTexture
- See Also:
- Constant Field Values
-
smoothNameLarge
- See Also:
- Constant Field Values
-
smoothTextureLarge
- See Also:
- Constant Field Values
-
smoothSquareName
- See Also:
- Constant Field Values
-
smoothSquareTexture
- See Also:
- Constant Field Values
-
distanceFieldSquare
- See Also:
- Constant Field Values
-
distanceFieldSquareTexture
- See Also:
- Constant Field Values
-
distanceFieldNarrow
- See Also:
- Constant Field Values
-
distanceFieldNarrowTexture
- See Also:
- Constant Field Values
-
distanceFieldHeavySquare
- See Also:
- Constant Field Values
-
distanceFieldHeavySquareTexture
- See Also:
- Constant Field Values
-
distanceFieldPrint
- See Also:
- Constant Field Values
-
distanceFieldPrintTexture
- See Also:
- Constant Field Values
-
distanceFieldClean
- See Also:
- Constant Field Values
-
distanceFieldCleanTexture
- See Also:
- Constant Field Values
-
distanceFieldTypewriterNarrow
- See Also:
- Constant Field Values
-
distanceFieldTypewriterNarrowTexture
- See Also:
- Constant Field Values
-
distanceFieldCode
- See Also:
- Constant Field Values
-
distanceFieldCodeTexture
- See Also:
- Constant Field Values
-
distanceFieldCodeJP
- See Also:
- Constant Field Values
-
distanceFieldCodeJPTexture
- See Also:
- Constant Field Values
-
distanceFieldDejaVu
- See Also:
- Constant Field Values
-
distanceFieldDejaVuTexture
- See Also:
- Constant Field Values
-
distanceFieldOrbit
- See Also:
- Constant Field Values
-
distanceFieldOrbitTexture
- See Also:
- Constant Field Values
-
distanceFieldLean
- See Also:
- Constant Field Values
-
distanceFieldLeanTexture
- See Also:
- Constant Field Values
-
distanceFieldLeanLight
- See Also:
- Constant Field Values
-
distanceFieldLeanLightTexture
- See Also:
- Constant Field Values
-
distanceFieldSlabLight
- See Also:
- Constant Field Values
-
distanceFieldSlabLightTexture
- See Also:
- Constant Field Values
-
distanceFieldSlab
- See Also:
- Constant Field Values
-
distanceFieldSlabTexture
- See Also:
- Constant Field Values
-
crispSlab
- See Also:
- Constant Field Values
-
crispSlabTexture
- See Also:
- Constant Field Values
-
crispLean
- See Also:
- Constant Field Values
-
crispLeanTexture
- See Also:
- Constant Field Values
-
crispDejaVu
- See Also:
- Constant Field Values
-
crispDejaVuTexture
- See Also:
- Constant Field Values
-
crispNotoSerif
- See Also:
- Constant Field Values
-
crispNotoSerifTexture
- See Also:
- Constant Field Values
-
crispCarved
- See Also:
- Constant Field Values
-
crispCarvedTexture
- See Also:
- Constant Field Values
-
crispCurvySquare
- See Also:
- Constant Field Values
-
crispCurvySquareTexture
- See Also:
- Constant Field Values
-
crispRobotoSans
- See Also:
- Constant Field Values
-
crispRobotoSansTexture
- See Also:
- Constant Field Values
-
crispOctagonalSquare
- See Also:
- Constant Field Values
-
crispOctagonalSquareTexture
- See Also:
- Constant Field Values
-
crispIcons
- See Also:
- Constant Field Values
-
crispIconsTexture
- See Also:
- Constant Field Values
-
vertexShader
- See Also:
- Constant Field Values
-
fragmentShader
- See Also:
- Constant Field Values
-
msdfFragmentShader
- See Also:
- Constant Field Values
-
outlineFragmentShader
An alternate shader based onfragmentShader
, but this draws outlines around characters. Only works with distance field fonts. You probably need to create a new ShaderProgram to use this, which would look likenew ShaderProgram(DefaultResources.vertexShader, DefaultResources.outlineFragmentShader)
, and would assign this to your TextCellFactory'sTextCellFactory.shader
field after the TextCellFactory is fully initialized (callingTextCellFactory.initBySize()
) will set the shader back to the default).- See Also:
- Constant Field Values
-
msdfOutlineFragmentShader
An alternate shader based onmsdfFragmentShader
, but this draws outlines around characters. This should be sharper thanoutlineFragmentShader
, but only works with MSDF (crisp) fonts. Unlike that shader, this doesn't have special behavior for negativeTextCellFactory.getSmoothingMultiplier()
values, though that may be added later. You probably need to create a new ShaderProgram to use this, which would look likenew ShaderProgram(DefaultResources.vertexShader, DefaultResources.msdfOutlineFragmentShader)
, and would assign this to your TextCellFactory'sTextCellFactory.shader
field after the TextCellFactory is fully initialized (callingTextCellFactory.initBySize()
) will set the shader back to the default).- See Also:
- Constant Field Values
-
narrowFontSymbols
Special symbols that can be used as icons if you use the narrow default font.- See Also:
- Constant Field Values
-
narrowFontAll
- See Also:
- Constant Field Values
-
iconFontAll
All of the Font-Awesome Free (solid style) characters ingetCrispIconFont()
, as a String.- See Also:
- Constant Field Values
-
-
Method Details
-
getIncludedFont
Gets the one font guaranteed to be included in libGDX, which is Arial at size 15 px.- Returns:
- the BitmapFont representing Arial.ttf at size 15 px
-
getDefaultFont
Returns a 12x12px, stretched but curvaceous font as an embedded resource. Caches it for later calls.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Zodiac-Square-12x12.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Zodiac-Square-12x12.png
- Returns:
- the BitmapFont object representing Zodiac-Square.ttf at size 16 pt
-
getLargeFont
Returns a 24x24px, stretched but curvaceous font as an embedded resource. Caches it for later calls.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Zodiac-Square-24x24.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Zodiac-Square-24x24.png
- Returns:
- the BitmapFont object representing Zodiac-Square.ttf at size 32 pt
-
getDefaultNarrowFont
Returns a 6x12px, narrow and curving font as an embedded resource. Caches it for later calls.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Rogue-Zodiac-6x12.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Rogue-Zodiac-6x12_0.png
- Returns:
- the BitmapFont object representing Rogue-Zodiac.ttf at size 16 pt
-
getLargeNarrowFont
Returns a 12x24px, narrow and curving font as an embedded resource. Caches it for later calls.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Rogue-Zodiac-12x24.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Rogue-Zodiac-12x24_0.png
- Returns:
- the BitmapFont object representing Rogue-Zodiac.ttf at size 32 pt
-
getExtraLargeNarrowFont
Returns a 12x24px, narrow and curving font as an embedded resource. Caches it for later calls.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Rogue-Zodiac-18x36.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Rogue-Zodiac-18x36_0.png
- Returns:
- the BitmapFont object representing Rogue-Zodiac.ttf at size 32 pt
-
getSmoothFont
Returns a 8x18px, very smooth and generally good-looking font (based on Inconsolata) as an embedded resource. This font fully supports Latin, Greek, Cyrillic, and of particular interest to SquidLib, Box Drawing characters. Caches the font for later calls.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-8x18.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-8x18.png
- Returns:
- the BitmapFont object representing Inconsolata-LGC.ttf at size... pretty sure it's 8x18 pixels
-
getLargeSmoothFont
Returns a 12x24px, very smooth and generally good-looking font (based on Inconsolata) as an embedded resource. This font fully supports Latin, Greek, Cyrillic, and of particular interest to SquidLib, Box Drawing characters. Caches the font for later calls.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-12x24.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-12x24.png
- Returns:
- the BitmapFont object representing Inconsolata-LGC.ttf at size... not actually sure, 12x24 pixels
-
getDefaultUnicodeFont
Returns a 6x16px, narrow and curving font with a lot of unicode chars as an embedded resource. Caches it for later calls.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Mandrill-6x16.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Mandrill-6x16.png
- Returns:
- the BitmapFont object representing Mandrill.ttf at size 16 pt
-
getLargeUnicodeFont
Returns a 12x32px, narrow and curving font with a lot of unicode chars as an embedded resource. Caches it for later calls.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Mandrill-12x32.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Mandrill-12x32.png
- Returns:
- the BitmapFont object representing Mandrill.ttf at size 32 pt
-
getSquareSmoothFont
Returns a 25x25px, very smooth and generally good-looking font (based on Inconsolata) as an embedded resource. This font fully supports Latin, Greek, Cyrillic, and of particular interest to SquidLib, Box Drawing characters. This variant is (almost) perfectly square, and box drawing characters should line up at size 25x25 px, but other glyphs will have much more horizontal spacing than in other fonts. Caches the font for later calls. You may wantgetStretchableSquareFont()
instead, which is the same font but can stretch smoothly to most sizes.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-Square-25x25.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-Square-25x25.png
- Returns:
- the BitmapFont object representing Inconsolata-LGC-Square at size 25x25 pixels
-
getTinyFont
Returns a 4x10px, extremely thin font (that may be barely legible) as an embedded resource. The font builds on work by Christian Munk in his font called Monotwist, making some changes for legibility. This font has the lowest width of any font asset distributed with SquidLib. Caches the font for later calls. Attribution to Christian Munk (or the username he used, CMunk) is required to use this font; this is in the license file linked below.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Monty-4x10.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Monty-4x10.png
- https://github.com/SquidPony/SquidLib/blob/master/assets/Monty-license.txt
- Returns:
- the BitmapFont object representing Monty.ttf at size 8 pt
-
getLessTinyFont
Returns a 8x20px, extremely thin font (that may be barely legible) as an embedded resource. The font builds on work by Christian Munk in his font called Monotwist, making some changes for legibility. A smaller version of this font,getTinyFont()
, has the lowest width of any font asset distributed with SquidLib; this doubles its resolution in case you like its appearance but don't want to go blind. Caches the font for later calls. Attribution to Christian Munk (or the username he used, CMunk) is required to use this font; this is in the license file linked below.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Monty-8x20.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Monty-8x20.png
- https://github.com/SquidPony/SquidLib/blob/master/assets/Monty-license.txt
- Returns:
- the BitmapFont object representing Monty.ttf at size 16 pt
-
getSevenTwelveFont
Returns a 7x12px font with identical (excellent) Unicode coverage to Iosevka, as an embedded resource. The font is 7-12-serif by Christian Munk, but not all of the Unicode glyphs supported in his amazingly-huge font are present here; just the subset that's compatible with Iosevka (which is way more than is required for SquidLib to present most things). Caches the font for later calls, but be aware that if you copy the BitmapFont instead of calling this method again, it won't stay monospaced because of a quirk of LibGDX. Attribution to Christian Munk (or the username he used, CMunk) is required to use this font; this is in the license file linked below.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/7-12-serif.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/7-12-serif.png
- https://github.com/SquidPony/SquidLib/blob/master/assets/7-12-serif-license.txt
- https://github.com/SquidPony/SquidLib/blob/master/assets/7-12-serif-readme.txt
- Returns:
- the BitmapFont object representing 7-12-serif.ttf at a size that gives exactly 7 px wide by 12 px tall
-
getOctagonalMonoFont
Returns a 14x27px font with fairly good Unicode coverage and an octagonal, angular look, as an embedded resource. The font is Computer Says No by Christian Munk, which has a nice clean appearance. Caches the font for later calls, but be aware that if you copy the BitmapFont instead of calling this method again, it won't stay monospaced because of a quirk of LibGDX. Attribution to Christian Munk (or the username he used, CMunk) is required to use this font; this is in the license file linked below.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/ComputerSaysNo.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/ComputerSaysNo.png
- https://github.com/SquidPony/SquidLib/blob/master/assets/ComputerSaysNo-license.txt
- https://github.com/SquidPony/SquidLib/blob/master/assets/ComputerSaysNo-readme.txt
- Returns:
- the BitmapFont object representing ComputerSaysNo.ttf at a size that gives about 14 px wide by 27 px tall
-
getStretchableSquareFont
Returns a TextCellFactory already configured to use a square font that should scale cleanly to many sizes. Caches the result for later calls.
Preview: http://i.imgur.com/DD1RkPa.png
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-Square-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-Square-distance.png
- Returns:
- the TextCellFactory object that can represent many sizes of the square font Inconsolata-LGC-Square.ttf
-
getStretchableHeavySquareFont
Returns a TextCellFactory already configured to use an blocky, fairly-bold square font that should scale cleanly to many sizes. UnlikegetStretchableSquareFont()
, the font this uses was made to be square initially, and is not a distorted/stretched version of an existing font. Caches the result for later calls.
Note: Uses a smoothing multiplier of 2.125f, instead of the default 1.2f.
Preview at 6x6 size, https://i.imgur.com/nIjgTOp.png Preview at much larger size, https://i.imgur.com/lWaSgVN.png
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/BoxedIn-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/BoxedIn-distance.png
- Returns:
- the TextCellFactory object that can represent many sizes of the square font BoxedIn.ttf
-
getCrispCurvySquareFont
Returns a TextCellFactory already configured to use an all-caps (with lighter-weight versions of upper-case letters for the lower-case glyphs) square font that should scale cleanly to many sizes. UnlikegetStretchableSquareFont()
, the font this uses was made to be square initially, and is not a distorted/stretched version of an existing font. This font only supports ASCII, and as said before, it doesn't have separate lower-case letters. Note: if you use this font as-is, most characters will overlap slightly with each other, which can be an aesthetic benefit in some styles but can also be hard to read, at least if the colors aren't different between overlapping characters. For that reason, you may want to tweak the width and height of this font after passing it to a SquidLayers or SparseLayers; often you would pass 0.875 times the original width and height toTextCellFactory.tweakWidth(float)
andTextCellFactory.tweakHeight(float)
. Caches the result for later calls. The font is "square" by Wouter van Oortmerssen; it is available under a CC-BY-3.0 license, which requires attribution to Wouter van Oortmerssen if you use it.
Note: Uses a smoothing multiplier of 6f, instead of the default 1.2f.
Preview at large size
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/square-msdf.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/square-msdf.png
- https://github.com/SquidPony/SquidLib/blob/master/assets/square-License.txt
- Returns:
- the TextCellFactory object that can represent many sizes of the font square.ttf
-
getCrispOctagonalSquareFont
Returns a TextCellFactory already configured to use a square font with 45-degree angled sections, based on the typeface used on the Atari ST console, that should scale cleanly to many sizes. UnlikegetStretchableSquareFont()
, the font this uses was made to be square initially, and is not a distorted/stretched version of an existing font. This font only supports ASCII, but it supports all of it, unlikegetCrispCurvySquareFont()
. Caches the result for later calls. The font is "a-starry", based on "Atari ST (low-res)" by Damien Guard; it is available under a CC-BY-SA-3.0 license, which requires attribution to Damien Guard (and technically Tommy Ettinger, because he made changes in a-starry) if you use it.
Note: Uses a smoothing multiplier of 3f, instead of the default 1.2f.
Preview at large size
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/a-starry-msdf.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/a-starry-msdf.png
- https://github.com/SquidPony/SquidLib/blob/master/assets/a-starry-license.txt
- Returns:
- the TextCellFactory object that can represent many sizes of the font a-starry.ttf
-
getStretchableFont
Returns a TextCellFactory already configured to use a narrow font (twice as tall as it is wide) that should scale cleanly to many sizes. Caches the result for later calls.
Preview: http://i.imgur.com/dvEEMqo.png
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-Custom-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Inconsolata-LGC-Custom-distance.png
- Returns:
- the TextCellFactory object that can represent many sizes of the font Inconsolata-LGC-Custom.ttf
-
getStretchableTypewriterFont
Returns a TextCellFactory already configured to use a narrow typewriter-style serif font that should scale cleanly to many sizes. Caches the result for later calls.
Preview: http://i.imgur.com/oN2gRci.png
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/CM-Custom-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/CM-Custom-distance.png
- Returns:
- the TextCellFactory object that can represent many sizes of the font CM-Custom.ttf
-
getStretchableCodeFont
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with broad Unicode support that should scale cleanly to many sizes. Caches the result for later calls. The font used is Source Code Pro, an open-source (SIL Open Font License) typeface by Adobe, and it has good Unicode support among the fixed-width fonts used by SquidLib. It may be a good choice for science-fiction games because of its modern feel, but the legibility enhancements made so the font could be usable in text editors also are nice for all text-based games. The high glyph count means the part of the image for each glyph is smaller, though, so this may look slightly pixelated if it starts small and is resized to much larger. A cell width of 15 and cell height of 27 is ideal; this allows the font to resize fairly well to larger sizes using Viewports.
Preview: http://i.imgur.com/VC0xn2r.png
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/SourceCodePro-Medium-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/SourceCodePro-Medium-distance.png
- Returns:
- the TextCellFactory object that can represent many sizes of the font SourceCodePro-Medium.otf
-
getStretchableCodeJPFont
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with strong CJK support (in particular, very good coverage for Japanese) that should scale cleanly to many sizes. Caches the result for later calls. The font used is Source Han Code JP, an open-source (SIL Open Font License) typeface by Adobe, and it has the best CJK char support among the fonts used by SquidLib. It is extremely wide if used only for English text, which may be desirable to make square cells. The very high glyph count means the part of the image for each glyph is smaller, though, so this may look slightly pixelated if it starts small and is resized to much larger. A cell width of 19 and cell height of 20 is ideal; this allows the font to resize fairly well to larger sizes.
Note: Uses a smoothing multiplier of 1.125f, instead of the default 1.2f.
Preview: https://i.imgur.com/g65jXxB.png
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/SourceHanCodeJP-Regular-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/SourceHanCodeJP-Regular-distance.png
- Returns:
- the TextCellFactory object that can represent many sizes of the font SourceHanCodeJP-Regular.otf
-
getStretchableLeanFont
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support and a thin, geometric style, that should scale cleanly to many sizes. Caches the result for later calls. The font used is Iosevka, an open-source (SIL Open Font License) typeface by Belleve Invis (see https://be5invis.github.io/Iosevka/ ), and it uses several customizations thanks to Iosevka's special build process. It supports a lot of glyphs, including quite a bit of extended Latin, Greek, and Cyrillic, but also circled letters and digits and the necessary box drawing characters. The high glyph count means the part of the image for each glyph is smaller, though, so this may look slightly pixelated if it starts small and is resized to much larger. A cell width of 11 and cell height of 20 is ideal (or some approximate multiple of that aspect ratio); this allows the font to resize fairly well to larger sizes using Viewports. As an aside, Luc Devroye (a true typography expert) called Iosevka "A tour de force that deserves an award." You may want to try using both this sans-serif version of Iosevka and the slab-serif version SquidLib has,getStretchableSlabFont()
, though they have subtly different sizes. There are also versions of Iosevka that use a Light weight, available bygetStretchableLeanLightFont()
andgetStretchableSlabLightFont()
.
Preview: http://i.imgur.com/sm0ULbU.png
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-distance.png
- Returns:
- the TextCellFactory object that can represent many sizes of the font Iosevka.ttf
-
getStretchableSlabFont
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support and a slab-serif geometric style, that should scale cleanly to many sizes. Caches the result for later calls. The font used is Iosevka with Slab style, an open-source (SIL Open Font License) typeface by Belleve Invis (see https://be5invis.github.io/Iosevka/ ), and it uses several customizations thanks to Iosevka's special build process. It supports a lot of glyphs, including quite a bit of extended Latin, Greek, and Cyrillic, but also circled letters and digits and the necessary box drawing characters. The high glyph count means the part of the image for each glyph is smaller, though, so this may look slightly pixelated if it starts small and is resized to much larger. A cell width of 11 and cell height of 20 is ideal (or some approximate multiple of that aspect ratio); this allows the font to resize fairly well to larger sizes using Viewports. As an aside, Luc Devroye (a true typography expert) called Iosevka "A tour de force that deserves an award." You may want to try using both this version of Iosevka with slab serifs and the other version SquidLib has,getStretchableLeanFont()
, though they have subtly different sizes. There are also versions of Iosevka that use a Light weight, available bygetStretchableLeanLightFont()
andgetStretchableSlabLightFont()
.
Preview: http://i.imgur.com/5kb697p.png
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-Slab-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-Slab-distance.png
- Returns:
- the TextCellFactory object that can represent many sizes of the font Iosevka-Slab.ttf
-
getStretchableLeanLightFont
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support and a very thin, geometric style, that should scale cleanly to many sizes. Caches the result for later calls. The font used is Iosevka (at Light weight), an open-source (SIL Open Font License) typeface by Belleve Invis (see https://be5invis.github.io/Iosevka/ ), and it uses several customizations thanks to Iosevka's special build process. It supports a lot of glyphs, including quite a bit of extended Latin, Greek, and Cyrillic, but also circled letters and digits and the necessary box drawing characters. The high glyph count means the part of the image for each glyph is smaller, though, so this may look slightly pixelated if it starts small and is resized to much larger. A cell width of 11 and cell height of 20 is ideal (or some approximate multiple of that aspect ratio); this allows the font to resize fairly well to larger sizes using Viewports. As an aside, Luc Devroye (a true typography expert) called Iosevka "A tour de force that deserves an award." You may want to try using both this sans-serif version of Iosevka and the slab-serif version SquidLib has,getStretchableSlabLightFont()
, though they have subtly different sizes. There are also versions of Iosevka that do not use this Light weight, available bygetStretchableLeanFont()
andgetStretchableSlabFont()
.
Preview: http://i.imgur.com/edKimT4.png
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-Light-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-Light-distance.png
- Returns:
- the TextCellFactory object that can represent many sizes of the font Iosevka-Light.ttf
-
getStretchableSlabLightFont
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support and a very thin, slab-serif geometric style, that should scale cleanly to many sizes. Caches the result for later calls. The font used is Iosevka with Slab style at Light weight, an open-source (SIL Open Font License) typeface by Belleve Invis (see https://be5invis.github.io/Iosevka/ ), and it uses several customizations thanks to Iosevka's special build process. It supports a lot of glyphs, including quite a bit of extended Latin, Greek, and Cyrillic, but also circled letters and digits and the necessary box drawing characters. The high glyph count means the part of the image for each glyph is smaller, though, so this may look slightly pixelated if it starts small and is resized to much larger. A cell width of 11 and cell height of 20 is ideal (or some approximate multiple of that aspect ratio); this allows the font to resize fairly well to larger sizes using Viewports. As an aside, Luc Devroye (a true typography expert) called Iosevka "A tour de force that deserves an award." You may want to try using both this version of Iosevka with slab serifs and the other version SquidLib has,getStretchableLeanLightFont()
, though they have subtly different sizes. There are also versions of Iosevka that do not use this Light weight, available bygetStretchableLeanFont()
andgetStretchableSlabFont()
.
Preview: http://i.imgur.com/B5eSGfj.png
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-Slab-Light-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-Slab-Light-distance.png
- Returns:
- the TextCellFactory object that can represent many sizes of the font Iosevka-Slab-Light.ttf
-
getStretchableDejaVuFont
Returns a TextCellFactory already configured to use a font with extremely wide Unicode support that should scale cleanly to many sizes. Caches the result for later calls. The font is DejaVu Sans Mono, a common font on Linux operating systems and a clean-looking, legible font, though it has some visual quirks like a "tail" on lower-case 'l', that take some getting used to. A possible requirement for this font is that the size of the text in a SquidPanel or SquidLayers may need to be increased 1-5 pixels past what the cell width and height are; this can be done withSquidPanel.setTextSize(float, float)
orSquidLayers.setTextSize(float, float)
, giving 1-2 more than the cell width for x and 3-5 more than the cell height for y.
Preview: http://i.imgur.com/1haETOe.png
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/DejaVuSansMono-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/DejaVuSansMono-distance.png
- Returns:
- the TextCellFactory object that can represent many sizes of the font DejaVuSansMono.ttf
-
getStretchablePrintFont
Returns a TextCellFactory already configured to use a variable-width serif font that should look like the serif fonts used in many novels' main texts, and that should scale cleanly to many sizes. Meant to be used in variable- width displays like TextPanel. Caches the result for later calls.
Preview: http://i.imgur.com/eIYYt8C.png
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Gentium-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Gentium-distance.png
- Returns:
- the TextCellFactory object that can represent many sizes of the font Gentium, by SIL
-
getStretchableOrbitFont
Returns a TextCellFactory already configured to use a variable-width sans-serif font that should have a blocky, futuristic look (based on the font Orbitron), and that should scale cleanly to many sizes. Meant to be used in variable-width displays like TextPanel. Caches the result for later calls.
Note: Uses a smoothing multiplier of 1.3f, instead of the default 1.2f.
Preview: http://i.imgur.com/grJhoMs.png
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Orbitron-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Orbitron-distance.png
- Returns:
- the TextCellFactory object that can represent many sizes of the font Orbitron, by The League of Movable Type
-
getStretchableCleanFont
Returns a TextCellFactory already configured to use a variable-width sans-serif font that currently looks slightly jumbled without certain layout features. Meant to be used in variable-width displays like TextPanel, but currently you should prefer getStretchablePrintFont() for legibility. Caches the result for later calls.
Note: Uses a smoothing multiplier of 0.8, instead of the default 1.2f. If you set the smoothing multiplier yourself, it should be similarly smaller than what other fonts use (most fonts are 1.2, so multiplying whatever you would normally set the smoothing multiplier to by 0.66f should work).
Preview: http://i.imgur.com/GF5qQxn.png
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Noto-Sans-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Noto-Sans-distance.png
- Returns:
- the TextCellFactory object that can represent many sizes of the font Noto Sans, by Google
-
getCrispSlabFont
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support and a slab-serif geometric style, that should scale cleanly to even very large sizes (using an MSDF technique). Caches the result for later calls. The font used is Iosevka with Slab style, an open-source (SIL Open Font License) typeface by Belleve Invis (see https://be5invis.github.io/Iosevka/ ), and it uses several customizations thanks to Iosevka's special build process. It supports a lot of glyphs, including quite a bit of extended Latin, Greek, and Cyrillic, but also the necessary box drawing characters. This uses the Multi-channel Signed Distance Field (MSDF) technique as opposed to the normal Signed Distance Field technique, which gives the rendered font sharper edges and precise corners instead of rounded tips on strokes. As an aside, Luc Devroye (a true typography expert) called Iosevka "A tour de force that deserves an award."
Preview: Image link
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the multi-channel distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-Slab-msdf.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-Slab-msdf.png
- Returns:
- the TextCellFactory object that can represent many sizes of the font Iosevka-Slab.ttf using MSDF
-
getCrispSlabItalicFont
Deprecated.usegetCrispSlabFamily()
instead- Returns:
- always throws an UnsupportedOperationException
-
getCrispLeanFont
Returns a TextCellFactory already configured to use a highly-legible fixed-width font with good Unicode support and a sans-serif geometric style, that should scale cleanly to even very large sizes (using an MSDF technique). Caches the result for later calls. The font used is Iosevka, an open-source (SIL Open Font License) typeface by Belleve Invis (see https://be5invis.github.io/Iosevka/ ), and it uses several customizations thanks to Iosevka's special build process. It supports a lot of glyphs, including quite a bit of extended Latin, Greek, and Cyrillic, but also the necessary box drawing characters. This uses the Multi-channel Signed Distance Field (MSDF) technique as opposed to the normal Signed Distance Field technique, which gives the rendered font sharper edges and precise corners instead of rounded tips on strokes. As an aside, Luc Devroye (a true typography expert) called Iosevka "A tour de force that deserves an award."
Preview: Image link
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the multi-channel distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-msdf.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-msdf.png
- Returns:
- the TextCellFactory object that can represent many sizes of the font Iosevka.ttf
-
getCrispLeanItalicFont
Deprecated.usegetCrispLeanFamily()
instead- Returns:
- always throws an UnsupportedOperationException
-
getCrispDejaVuFont
Returns a TextCellFactory already configured to use a fixed-width sans-serif font with excellent Unicode support, that should scale cleanly to even very large sizes. Caches the result for later calls. The font used is DejaVu Sans Mono, an open-source (SIL Open Font License) typeface that is widely used by Linux distros and other groups. It supports a lot of glyphs, including quite a bit of extended Latin, Greek, and Cyrillic, but also the necessary box drawing characters. This uses the Multi-channel Signed Distance Field technique as opposed to the normal Signed Distance Field technique, which should allow sharper edges. It has been updated so it is laid out mostly-correctly now; some glyphs may be a little wide, such as@
, but the line height, baseline, and the width for most glyphs seem correct. If you find the box drawing characters don't line up, tryTextCellFactory.tweakWidth(float)
with values like 1.125f; the exact value may depend on size.
Note: Uses a smoothing multiplier of 1f, instead of the default 1.2f.
Preview: Image link
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the multi-channel distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/DejaVuSansMono-msdf.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/DejaVuSansMono-msdf.png
- Returns:
- the TextCellFactory object that can represent many sizes of the font DejaVuSansMono.ttf with an MSDF effect
-
getSlabFamily
Returns a TextFamily already configured to use a highly-legible fixed-width font with good Unicode support and a slab-serif geometric style, that should scale cleanly to many sizes and supports 4 styles (regular, bold, italic, and bold italic). Caches the result for later calls. The font used is Iosevka with Slab style, an open-source (SIL Open Font License) typeface by Belleve Invis (see https://be5invis.github.io/Iosevka/ ), and it uses several customizations thanks to Iosevka's special build process, applied to the 4 styles. It supports a lot of glyphs, including quite a bit of extended Latin, Greek, and Cyrillic, but also circled letters and digits and the necessary box drawing characters (which line up even for italic text). The high glyph count means the part of the image for each glyph is smaller, though, so this may look slightly pixelated if it starts small and is resized to much larger. A cell width of 11 and cell height of 20 is ideal (or some approximate multiple of that aspect ratio); this allows the font to resize fairly well to larger sizes using Viewports. As an aside, Luc Devroye (a true typography expert) called Iosevka "A tour de force that deserves an award." You may want to try using both this version of Iosevka with slab serifs and the other version SquidLib has,getLeanFamily()
.
This creates a TextFamily instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work, but it can also be used as a TextCellFactory.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-Slab-Family-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-Slab-Family-distance.png
- Returns:
- the TextFamily object that can represent many sizes of the font Iosevka-Slab.ttf with 4 styles
-
getLeanFamily
Returns a TextFamily already configured to use a highly-legible fixed-width font with good Unicode support and a sans-serif geometric style, that should scale cleanly to many sizes and supports 4 styles (regular, bold, italic, and bold italic). Caches the result for later calls. The font used is Iosevka, an open-source (SIL Open Font License) typeface by Belleve Invis (see https://be5invis.github.io/Iosevka/ ), and it uses several customizations thanks to Iosevka's special build process, applied to the 4 styles. It supports a lot of glyphs, including quite a bit of extended Latin, Greek, and Cyrillic, but also circled letters and digits and the necessary box drawing characters (which line up even for italic text). The high glyph count means the part of the image for each glyph is smaller, though, so this may look slightly pixelated if it starts small and is resized to much larger. A cell width of 11 and cell height of 20 is ideal (or some approximate multiple of that aspect ratio); this allows the font to resize fairly well to larger sizes using Viewports. As an aside, Luc Devroye (a true typography expert) called Iosevka "A tour de force that deserves an award." You may want to try using both this version of Iosevka without serifs and the other version SquidLib has,getSlabFamily()
.
This creates a TextFamily instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work, but it can also be used as a TextCellFactory.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-Family-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-Family-distance.png
- Returns:
- the TextFamily object that can represent many sizes of the font Iosevka.ttf with 4 styles
-
getGoFamily
Returns a TextFamily already configured to use a fixed-width font with good Unicode support and a traditional serif style, that should scale cleanly to many sizes and supports 4 styles (regular, bold, italic, and bold italic). Caches the result for later calls. The font used is Go Mono, a typeface released by the team behind the Go programming language as open-source (3-clause BSD, the same license as the Go language; the license is included with the assets). It supports a lot of glyphs, including quite a bit of extended Latin, Greek, and Cyrillic, bu also the necessary box drawing characters (which line up even for italic text). There's more information about this font available where it was introduced, on the Go blog. You may want to try using this Go font family and contrasting it with Iosevka with and without slab serifs, which aregetSlabFamily()
andgetLeanFamily()
respectively.
This creates a TextFamily instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work, but it can also be used as a TextCellFactory.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/GoMono-Family-distance.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/GoMono-Family-distance.png
- https://github.com/SquidPony/SquidLib/blob/master/assets/GoMono-License.txt
- Returns:
- the TextFamily object that can represent many sizes of the font GoMono.ttf with 4 styles
-
getCrispLeanFamily
Returns a TextFamily already configured to use a highly-legible fixed-width font with good Unicode support and a sans-serif geometric style, that should scale cleanly to many sizes (using an MSDF technique) and supports 4 styles (regular, bold, italic, and bold italic). Caches the result for later calls. The font used is Iosevka, an open-source (SIL Open Font License) typeface by Belleve Invis (see https://be5invis.github.io/Iosevka/ ), and it uses several customizations thanks to Iosevka's special build process, applied to the 4 styles. It supports a lot of glyphs, including quite a bit of extended Latin, Greek, and Cyrillic, but also circled letters and digits and the necessary box drawing characters (which line up even for italic text). The high glyph count means the texture that holds all four faces of the font is larger than normal, at 4096x4096; this may be too large for some devices to load correctly (mostly older phones or tablets). A cell width of 11 and cell height of 20 is ideal (or some approximate multiple of that aspect ratio); this allows the font to resize fairly well to larger sizes using Viewports. This uses the Multi-channel Signed Distance Field (MSDF) technique as opposed to the normal Signed Distance Field technique, which gives the rendered font sharper edges and precise corners instead of rounded tips on strokes. As an aside, Luc Devroye (a true typography expert) called Iosevka "A tour de force that deserves an award." You may want to try using both this version of Iosevka without serifs and the other version SquidLib has with an MSDF effect,getCrispSlabFamily()
.
Preview: image link, with bold at the bottom.
This creates a TextFamily instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work, but it can also be used as a TextCellFactory.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-Family-msdf.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-Family-msdf.png
- Returns:
- the TextFamily object that can represent many sizes of the font Iosevka.ttf with 4 styles and an MSDF effect
-
getCrispSlabFamily
Returns a TextFamily already configured to use a highly-legible fixed-width font with good Unicode support and a slab-serif geometric style, that should scale cleanly to many sizes (using an MSDF technique) and supports 4 styles (regular, bold, italic, and bold italic). Caches the result for later calls. The font used is Iosevka with slab style, an open-source (SIL Open Font License) typeface by Belleve Invis (see https://be5invis.github.io/Iosevka/ ), and it uses several customizations thanks to Iosevka's special build process, applied to the 4 styles. It supports a lot of glyphs, including quite a bit of extended Latin, Greek, and Cyrillic, but also circled letters and digits and the necessary box drawing characters (which line up even for italic text). The high glyph count means the texture that holds all four faces of the font is larger than normal, at 4096x4096; this may be too large for some devices to load correctly (mostly older phones or tablets). A cell width of 11 and cell height of 20 is ideal (or some approximate multiple of that aspect ratio); this allows the font to resize fairly well to larger sizes using Viewports. This uses the Multi-channel Signed Distance Field (MSDF) technique as opposed to the normal Signed Distance Field technique, which gives the rendered font sharper edges and precise corners instead of rounded tips on strokes. As an aside, Luc Devroye (a true typography expert) called Iosevka "A tour de force that deserves an award." You may want to try using both this version of Iosevka with slab serifs and the other version SquidLib has with an MSDF effect,getCrispLeanFamily()
.
Note: Uses a smoothing multiplier of 1.55f, instead of the default 1.2f.
Preview: image link, with bold at the bottom.
This creates a TextFamily instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work, but it can also be used as a TextCellFactory.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-Slab-Family-msdf.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Iosevka-Slab-Family-msdf.png
- Returns:
- the TextFamily object that can represent many sizes of the font Iosevka-Slab.ttf with 4 styles and an MSDF effect
-
getCrispPrintFamily
Returns a TextFamily already configured to use a variable-width serif font that should look like the serif fonts used in many novels' main texts, and that should scale cleanly to many sizes using an MSDF technique, and supports 4 styles (regular, bold, italic, and bold italic). Caches the result for later calls. The font used is Noto Serif, which is OFL-licensed by Google, and looks very legible in normal use. Meant to be used in variable-width displays like TextPanel.
Note: Uses a smoothing multiplier of 1.5f, instead of the default 1.2f.
Preview: In the foreground message box in ZoneDemo
This creates a TextFamily instead of a BitmapFont because it needs to set some extra information so the distance field font technique this uses can work, but it can also be used as a TextCellFactory.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/NotoSerif-Family-msdf.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/NotoSerif-Family-msdf.png
- https://github.com/SquidPony/SquidLib/blob/master/assets/NotoSerif-license.txt
- Returns:
- the TextCellFactory object that can represent many sizes of the font Noto Serif, made available by Google
-
getCrispCarvedFont
Returns a TextCellFactory already configured to use a partially-angular variable-width font with good Unicode support and an appearance as if it were carved into solid rock, that should scale cleanly to even very large sizes (using an MSDF technique). Caches the result for later calls. The font used is Bloccus by Christian Munk. It supports a lot of glyphs, including most of extended Latin, Greek, Cyrillic, and the International Phonetic Alphabet (IPA), but not box drawing characters because this is variable-width. This uses the Multi-channel Signed Distance Field (MSDF) technique as opposed to the normal Signed Distance Field technique, which gives the rendered font sharper edges and precise corners instead of rounded tips on strokes.
Note: Uses a smoothing multiplier of 1f, instead of the default 1.2f.
Preview: Image link
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the multi-channel distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/bloccus-msdf.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/bloccus-msdf.png
- https://github.com/SquidPony/SquidLib/blob/master/assets/bloccus-license.txt
- Returns:
- the TextCellFactory object that can represent many sizes of the font bloccus.ttf
-
getCrispRobotoSansFont
Returns a TextCellFactory already configured to use a variable-width sans-serif font with good Unicode support and a no-nonsense look, that should scale cleanly to even very large or small sizes (using an MSDF technique). Caches the result for later calls. The font used is Roboto Regular by Christian Robertson. It supports a lot of glyphs, including most Latin, Greek, and Cyrillic, but not box drawing characters because this is variable-width. This uses the Multi-channel Signed Distance Field (MSDF) technique as opposed to the normal Signed Distance Field technique, which gives the rendered font sharper edges and precise corners instead of rounded tips on strokes.
Note: Uses a smoothing multiplier of 2f, instead of the default 1.2f.
Preview: Image link when scaled to a small size
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the multi-channel distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/Roboto-Regular-msdf.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/Roboto-Regular-msdf.png
- https://github.com/SquidPony/SquidLib/blob/master/assets/Roboto-License.txt
- Returns:
- the TextCellFactory object that can represent many sizes of the font Roboto-Regular.ttf
-
getCrispIconFont
Returns a TextCellFactory already configured to use a fixed-width icon font (no letters are supported) using the Font-Awesome icon set, that should scale cleanly to even very large sizes. Caches the result for later calls. The icon font used is the popular Font-Awesome free set (solid style), an open-source (SIL Open Font License) typeface that is often used online. You will probably want to consult the cheatsheet for what chars are actually supported; the cheatsheet is here. This uses the Multi-channel Signed Distance Field technique as opposed to the normal Signed Distance Field technique, which should allow sharper edges. You may also want the list of all chars in this icon font;iconFontAll
has that.
Preview: Image link
This creates a TextCellFactory instead of a BitmapFont because it needs to set some extra information so the multi-channel distance field font technique this uses can work.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/awesome-solid-msdf.fnt
- https://github.com/SquidPony/SquidLib/blob/master/assets/awesome-solid-msdf.png
- https://github.com/SquidPony/SquidLib/blob/master/assets/Font-Awesome-license.txt
- Returns:
- the TextCellFactory object that can represent many sizes of Font Awesome Free (solid) with an MSDF effect
-
getTentacle
Gets an image of a (squid-like, for SquidLib) tentacle, 32x32px. Source is public domain: http://opengameart.org/content/496-pixel-art-icons-for-medievalfantasy-rpg Created by Henrique Lazarini (7Soul1, http://7soul1.deviantart.com/ )
Needs file:- https://github.com/SquidPony/SquidLib/blob/master/assets/Tentacle.png
- Returns:
- a TextureRegion containing an image of a tentacle.
-
getIconAtlas
Gets a TextureAtlas containing many icons with a distance field effect applied, allowing them to be used with "stretchable" fonts and be resized in the same way. These will not look as-expected if stretchable fonts are not in use, and will seem hazy and indistinct if the shader hasn't been set up for a distance field effect by TextCellFactory (which stretchable fonts will do automatically). The one page of the TextureAtlas is 2048x2048, which may be too large for some old, low-end Android phones, and possibly integrated graphics with fairly old processors on desktop. It has over 2000 icons.
The icons are CC-BY and the license is distributed with them, though the icons are not necessarily included with SquidLib. If you use the icon atlas, be sure to include icons-license.txt with it and reference it with your game's license and/or credits information.
Needs files:- https://github.com/SquidPony/SquidLib/blob/master/assets/icons.atlas
- https://github.com/SquidPony/SquidLib/blob/master/assets/icons.png
- https://github.com/SquidPony/SquidLib/blob/master/assets/icons-license.txt Needed to credit artists
- Returns:
- a TextureAtlas containing over 2000 icons with a distance field effect
-
getGuiRandom
This is a static global StatefulRNG that's meant for usage in cases where the seed does not matter and any changes to this RNG's state will not change behavior elsewhere in the program; this means the GUI mainly. -
getSCC
This is a static global SquidColorCenter that can be used in places that just need an existing object that can do things like analyze hue or saturation of a color. -
pause
Called when theApplication
is about to pause- Specified by:
pause
in interfacecom.badlogic.gdx.LifecycleListener
-
resume
Called when the Application is about to be resumed- Specified by:
resume
in interfacecom.badlogic.gdx.LifecycleListener
-
dispose
Called when theApplication
is about to be disposed- Specified by:
dispose
in interfacecom.badlogic.gdx.LifecycleListener
-