Skip to content

Commit

Permalink
update SDL_ttf to 3.1.0-preview-0
Browse files Browse the repository at this point in the history
  • Loading branch information
maia-s committed Feb 2, 2025
1 parent b7d1451 commit 8bf2555
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdl3-ttf-src/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sdl3-ttf-src"
version = "2.20.0-release-456-g099520d"
version = "3.1.0-preview-0"
edition = "2021"
authors = ["SDL developers"]
license = "Zlib"
Expand Down
2 changes: 1 addition & 1 deletion sdl3-ttf-src/SDL_ttf
12 changes: 6 additions & 6 deletions sdl3-ttf-src/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ pub const SOURCE_DIR: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/SDL_ttf");
pub const SOURCE_DIR: &str = concat!(env!("CARGO_MANIFEST_DIR"), "\\SDL_ttf");

/// Revision
pub const REVISION: &str = "SDL3_ttf-release-2.20.0-456-g099520d";
pub const REVISION: &str = "SDL3_ttf-preview-3.1.0";

/// Version part of the revision
pub const VERSION: &str = "2.20.0";
pub const VERSION: &str = "3.1.0";

/// Tag part of the revision
pub const REVISION_TAG: &str = "release-2.20.0";
pub const REVISION_TAG: &str = "preview-3.1.0";

/// Tag part of the revision without version
pub const REVISION_TAG_BASE: &str = "release";
pub const REVISION_TAG_BASE: &str = "preview";

/// Offset from tag part of the revision
pub const REVISION_OFFSET: &str = "456";
pub const REVISION_OFFSET: &str = "0";

/// Hash part of the revision
pub const REVISION_HASH: &str = "g099520d";
pub const REVISION_HASH: &str = "g07e4d12";
2 changes: 1 addition & 1 deletion sdl3-ttf-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ version = "0.1.2"
optional = true

[build-dependencies.sdl3-ttf-src]
version = "2.20.0-release-456-g099520d"
version = "3.1.0-preview-0"
path = "../sdl3-ttf-src"
optional = true

Expand Down
2 changes: 1 addition & 1 deletion sdl3-ttf-sys/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# sdl3-ttf-sys

This version of `sdl3-ttf-sys` has bindings for SDL_ttf version `2.20.0-release-456-g099520d` and earlier.
This version of `sdl3-ttf-sys` has bindings for SDL_ttf version `3.1.0-preview` and earlier.
39 changes: 37 additions & 2 deletions sdl3-ttf-sys/src/generated/ttf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,12 @@ extern "C" {
///
/// - [`TTF_PROP_FONT_CREATE_FILENAME_STRING`]\: the font file to open, if an
/// [`SDL_IOStream`] isn't being used. This is required if
/// [`TTF_PROP_FONT_CREATE_IOSTREAM_POINTER`] isn't set.
/// [`TTF_PROP_FONT_CREATE_IOSTREAM_POINTER`] and
/// [`TTF_PROP_FONT_CREATE_EXISTING_FONT`] aren't set.
/// - [`TTF_PROP_FONT_CREATE_IOSTREAM_POINTER`]\: an [`SDL_IOStream`] containing the
/// font to be opened. This should not be closed until the font is closed.
/// This is required if [`TTF_PROP_FONT_CREATE_FILENAME_STRING`] isn't set.
/// This is required if [`TTF_PROP_FONT_CREATE_FILENAME_STRING`] and
/// [`TTF_PROP_FONT_CREATE_EXISTING_FONT`] aren't set.
/// - [`TTF_PROP_FONT_CREATE_IOSTREAM_OFFSET_NUMBER`]\: the offset in the iostream
/// for the beginning of the font, defaults to 0.
/// - [`TTF_PROP_FONT_CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN`]\: true if closing the
Expand All @@ -209,6 +211,9 @@ extern "C" {
/// - [`TTF_PROP_FONT_CREATE_VERTICAL_DPI_NUMBER`]\: the vertical DPI to use for
/// font rendering, defaults to [`TTF_PROP_FONT_CREATE_HORIZONTAL_DPI_NUMBER`]
/// if set, or 72 otherwise.
/// - [`TTF_PROP_FONT_CREATE_EXISTING_FONT`]\: an optional [`TTF_Font`] that, if set,
/// will be used as the font data source and the initial size and style of
/// the new font.
///
/// ### Parameters
/// - `props`: the properties to use.
Expand Down Expand Up @@ -252,6 +257,36 @@ pub const TTF_PROP_FONT_CREATE_HORIZONTAL_DPI_NUMBER: *const ::core::ffi::c_char
pub const TTF_PROP_FONT_CREATE_VERTICAL_DPI_NUMBER: *const ::core::ffi::c_char =
c"SDL_ttf.font.create.vdpi".as_ptr();

pub const TTF_PROP_FONT_CREATE_EXISTING_FONT: *const ::core::ffi::c_char =
c"SDL_ttf.font.create.existing_font".as_ptr();

extern "C" {
/// Create a copy of an existing font.
///
/// The copy will be distinct from the original, but will share the font file
/// and have the same size and style as the original.
///
/// When done with the returned [`TTF_Font`], use [`TTF_CloseFont()`] to dispose of it.
///
/// ### Parameters
/// - `existing_font`: the font to copy.
///
/// ### Return value
/// Returns a valid [`TTF_Font`], or NULL on failure; call [`SDL_GetError()`] for more
/// information.
///
/// ### Thread safety
/// This function should be called on the thread that created the
/// original font.
///
/// ### Availability
/// This function is available since SDL_ttf 3.0.0.
///
/// ### See also
/// - [`TTF_CloseFont`]
pub fn TTF_CopyFont(existing_font: *mut TTF_Font) -> *mut TTF_Font;
}

extern "C" {
/// Get the properties associated with a font.
///
Expand Down

0 comments on commit 8bf2555

Please sign in to comment.