diff --git a/Cargo.lock b/Cargo.lock index 130c898..bd2242b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -133,7 +133,7 @@ dependencies = [ [[package]] name = "sdl3-ttf-src" -version = "2.20.0-release-456-g099520d" +version = "3.1.0-preview-0" [[package]] name = "sdl3-ttf-sys" diff --git a/sdl3-ttf-src/Cargo.toml b/sdl3-ttf-src/Cargo.toml index 72a7056..0a6921b 100644 --- a/sdl3-ttf-src/Cargo.toml +++ b/sdl3-ttf-src/Cargo.toml @@ -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" diff --git a/sdl3-ttf-src/SDL_ttf b/sdl3-ttf-src/SDL_ttf index 099520d..07e4d12 160000 --- a/sdl3-ttf-src/SDL_ttf +++ b/sdl3-ttf-src/SDL_ttf @@ -1 +1 @@ -Subproject commit 099520d9bf907a38e16ed3f1d22a0d98035c9c57 +Subproject commit 07e4d1241817f2c0f81749183fac5ec82d7bbd72 diff --git a/sdl3-ttf-src/src/lib.rs b/sdl3-ttf-src/src/lib.rs index 970ab21..7916f6d 100644 --- a/sdl3-ttf-src/src/lib.rs +++ b/sdl3-ttf-src/src/lib.rs @@ -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"; diff --git a/sdl3-ttf-sys/Cargo.toml b/sdl3-ttf-sys/Cargo.toml index 242ebac..24d0665 100644 --- a/sdl3-ttf-sys/Cargo.toml +++ b/sdl3-ttf-sys/Cargo.toml @@ -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 diff --git a/sdl3-ttf-sys/README.md b/sdl3-ttf-sys/README.md index 5a20d2c..6f3a504 100644 --- a/sdl3-ttf-sys/README.md +++ b/sdl3-ttf-sys/README.md @@ -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. diff --git a/sdl3-ttf-sys/src/generated/ttf.rs b/sdl3-ttf-sys/src/generated/ttf.rs index 6fb5e6b..c02337e 100644 --- a/sdl3-ttf-sys/src/generated/ttf.rs +++ b/sdl3-ttf-sys/src/generated/ttf.rs @@ -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 @@ -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. @@ -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. ///