Module ttf
Available on crate feature
dep_sdl2
only.Expand description
A binding for the library SDL2_ttf
Note that you need to build with the
feature ttf
for this module to be enabled,
like so:
$ cargo build --features "ttf"
If you want to use this with from inside your own crate, you will need to add this in your Cargo.toml
[dependencies.sdl2]
version = ...
default-features = false
features = ["ttf"]
Structs§
- Font
- A loaded TTF font.
- Font
Style - The styling of a font.
- Glyph
Metrics - Information about a specific glyph (character) in a font face.
- Partial
Rendering - A builder for a font rendering.
- Sdl2
TtfContext - A context manager for
SDL2_TTF
to manage C code initialization and clean-up.
Enums§
- Font
Error - A font-related error.
- Hinting
- Information about the hinting of a font. See wikipedia
- Init
Error - An error for when
sdl2_ttf
is attempted initialized twice Necessary for context management, unless we find a way to have a singleton
Functions§
- get_
linked_ version - Returns the version of the dynamically linked
SDL_TTF
library - has_
been_ initialized - Returns whether library has been initialized already.
- init
- Initializes the truetype font API and returns a context manager which will clean up the library once it goes out of scope.
Type Aliases§
- Font
Result - The result of an
SDL2_TTF
font operation.