Constructs a font from a font file
Constructs a font from an already existing TTF_Font
Ensures that SDL_TTF can dispose of this font
Gets the advance offset of the glyph The advance offset is the distance the pen must be shifted after drawing a glyph Controls spacing between glyphs on an individual basis
Checks if the font supports the given glyph
Gets the maximum offset of the glyph Returns the top right corner of the rectangle in which the glyph is inscribed in Cartesian coordinates
Gets the minimum offset of the glyph Returns the bottom left corner of the rectangle in which the glyph is inscribed in Cartesian coordinates
Gets a rectangle describing the offset of the given glyph Width of the rectangle is width of the glyph
Renders a glyph very slowly but with very high quality See renderTextBlended
Renders a glyph slowly but smoothly See renderTextShaded
Renders a glyph quickly See renderTextSolid
Renders the text in high quality on a 32-bit ARGB surface, using alpha blending to dither the font with the given color The surface has alpha transparency Renders about as slowly as the Shaded render method, but blits more slowly than Solid and Shaded
Renders the text with a given color on an 8-bit palettized surface with a given background color Text is smooth but renders slowly Surface blits as fast as the Solid render method once it is made
Renders the text on an 8-bit palettized surface with the given color Background is transparent Text is less smooth than other render options This is the fastest rendering speed, and color can be changed without having to render again
Gets the maximum pixel ascent of all glyphs in this font Ascent is the distance from the top of the glyph to the baseline
Gets the maximum pixel descent of all glyphs in this font Descent is the distance from the bottom of the glyph to the baseline
Gets the number of faces in this font Faces are sub-fonts that vary slightly from the main font
Gets the font face family name (Times, Courier, etc.) Returns null if not available
Returns the raw SDL data of this object
Gets the maximum pixel height of all glyphs in this font Useful for multiline printing
Sets the font's hinting type Type is taken as a value matching one of the following: TTF_HINTING_NORMAL TTF_HINTING_LIGHT TTF_HINTING_MONO TTF_HINTING_NONE Hinting type is how the font is programmed to map onto the pixels on a screen Note: the method flushes the internal cache of glyphs in the font, even if there is no change in hinting It may be useful to first check the font's hinting type
Gets the font's hinting type Type is returned as a value matching one of the following: TTF_HINTING_NORMAL TTF_HINTING_LIGHT TTF_HINTING_MONO TTF_HINTING_NONE Type defaults to TTF_HINTING_NORMAL if no type has been set Hinting type is how the font is programmed to map onto the pixels on a screen
Checks if the current font face of this font is fixed-width Fixed-width fonts are monospace - each character is the same length The pixel length of a string of fixed-width characters is the width of the characters times the amount of characters
Sets the font's kerning setting Default for newly created fonts is true Kerning setting determines whether the spacing between individual characters is adjusted for a more pleasing result
Gets the font's kerning setting Default for a newly created fonts is true Kerning setting determines whether the spacing between individual characters is adjusted for a more pleasing result
Gets the recommended pixel height of a line of text in this font This represents the distance from the baseline to the top of the line Line skip should be larger than height in most cases
Sets the size of the font's outline Use outline = 0 to disable outlining
Gets the size of the font's outline Outline is constant across glyphs in a font
Sets the style (bold, italic, etc.) of this font Style should be inputted as a bitmask composed of: TTF_STYLE_BOLD TTF_STYLE_ITALIC TTF_STYLE_UNDERLINE TTF_STYLE_STRIKETHROUGH If the style is normal, use TTF_STYLE_NORMAL For multiple styles, use a bitwise OR operator (TTF_STYLE_BOLD|TTF_STYLE_ITALIC means both bold and italic, etc.)
Gets the style (bold, italic, etc.) of this font Style is returned as a bitmask composed of: TTF_STYLE_BOLD TTF_STYLE_ITALIC TTF_STYLE_UNDERLINE TTF_STYLE_STRIKETHROUGH If the style is normal, the value returned will be TTF_STYLE_NORMAL Otherwise, use bitwise and operations to get individual values (style&TTF_STYLE_BOLD returns whether the font is bold, etc.)
Gets the font face style name (Sans, Serif, etc.) Returns null if not available
Fonts are contexts for displaying strings Fonts describe how each character in the string looks and how they are spaced Each font includes a collection of supported glyphs and general information TODO: allow for multiline printing