Skip to content

Commit

Permalink
use TTF_GlyphIsProvided32 and TTF_GlyphMetrics32 instead of the 16 bi…
Browse files Browse the repository at this point in the history
…t ones
  • Loading branch information
antonilol committed Jul 1, 2024
1 parent 315c9e2 commit 9f5d7e5
Show file tree
Hide file tree
Showing 2 changed files with 292 additions and 14 deletions.
300 changes: 289 additions & 11 deletions sdl2-sys/sdl_ttf_bindings.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* automatically generated by rust-bindgen */
/* automatically generated by rust-bindgen 0.69.4 */

use crate::*;

pub const TTF_MAJOR_VERSION: u32 = 2;
pub const TTF_MINOR_VERSION: u32 = 0;
pub const TTF_PATCHLEVEL: u32 = 15;
pub const TTF_MINOR_VERSION: u32 = 22;
pub const TTF_PATCHLEVEL: u32 = 0;
pub const TTF_STYLE_NORMAL: u32 = 0;
pub const TTF_STYLE_BOLD: u32 = 1;
pub const TTF_STYLE_ITALIC: u32 = 2;
Expand All @@ -14,10 +14,10 @@ pub const TTF_HINTING_NORMAL: u32 = 0;
pub const TTF_HINTING_LIGHT: u32 = 1;
pub const TTF_HINTING_MONO: u32 = 2;
pub const TTF_HINTING_NONE: u32 = 3;
pub type __uint8_t = libc::c_uchar;
pub type __uint16_t = libc::c_ushort;
pub type __uint32_t = libc::c_uint;
pub type __int64_t = libc::c_long;
pub const TTF_HINTING_LIGHT_SUBPIXEL: u32 = 4;
pub const TTF_WRAPPED_ALIGN_LEFT: u32 = 0;
pub const TTF_WRAPPED_ALIGN_CENTER: u32 = 1;
pub const TTF_WRAPPED_ALIGN_RIGHT: u32 = 2;
pub type __off_t = libc::c_long;
pub type __off64_t = libc::c_long;
pub type Uint8 = u8;
Expand All @@ -28,7 +28,21 @@ extern "C" {
pub fn TTF_Linked_Version() -> *const SDL_version;
}
extern "C" {
pub fn TTF_ByteSwappedUNICODE(swapped: libc::c_int);
pub fn TTF_GetFreeTypeVersion(
major: *mut libc::c_int,
minor: *mut libc::c_int,
patch: *mut libc::c_int,
);
}
extern "C" {
pub fn TTF_GetHarfBuzzVersion(
major: *mut libc::c_int,
minor: *mut libc::c_int,
patch: *mut libc::c_int,
);
}
extern "C" {
pub fn TTF_ByteSwappedUNICODE(swapped: SDL_bool);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
Expand Down Expand Up @@ -64,6 +78,53 @@ extern "C" {
index: libc::c_long,
) -> *mut TTF_Font;
}
extern "C" {
pub fn TTF_OpenFontDPI(
file: *const libc::c_char,
ptsize: libc::c_int,
hdpi: libc::c_uint,
vdpi: libc::c_uint,
) -> *mut TTF_Font;
}
extern "C" {
pub fn TTF_OpenFontIndexDPI(
file: *const libc::c_char,
ptsize: libc::c_int,
index: libc::c_long,
hdpi: libc::c_uint,
vdpi: libc::c_uint,
) -> *mut TTF_Font;
}
extern "C" {
pub fn TTF_OpenFontDPIRW(
src: *mut SDL_RWops,
freesrc: libc::c_int,
ptsize: libc::c_int,
hdpi: libc::c_uint,
vdpi: libc::c_uint,
) -> *mut TTF_Font;
}
extern "C" {
pub fn TTF_OpenFontIndexDPIRW(
src: *mut SDL_RWops,
freesrc: libc::c_int,
ptsize: libc::c_int,
index: libc::c_long,
hdpi: libc::c_uint,
vdpi: libc::c_uint,
) -> *mut TTF_Font;
}
extern "C" {
pub fn TTF_SetFontSize(font: *mut TTF_Font, ptsize: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn TTF_SetFontSizeDPI(
font: *mut TTF_Font,
ptsize: libc::c_int,
hdpi: libc::c_uint,
vdpi: libc::c_uint,
) -> libc::c_int;
}
extern "C" {
pub fn TTF_GetFontStyle(font: *const TTF_Font) -> libc::c_int;
}
Expand All @@ -82,6 +143,12 @@ extern "C" {
extern "C" {
pub fn TTF_SetFontHinting(font: *mut TTF_Font, hinting: libc::c_int);
}
extern "C" {
pub fn TTF_GetFontWrappedAlign(font: *const TTF_Font) -> libc::c_int;
}
extern "C" {
pub fn TTF_SetFontWrappedAlign(font: *mut TTF_Font, align: libc::c_int);
}
extern "C" {
pub fn TTF_FontHeight(font: *const TTF_Font) -> libc::c_int;
}
Expand All @@ -107,13 +174,16 @@ extern "C" {
pub fn TTF_FontFaceIsFixedWidth(font: *const TTF_Font) -> libc::c_int;
}
extern "C" {
pub fn TTF_FontFaceFamilyName(font: *const TTF_Font) -> *mut libc::c_char;
pub fn TTF_FontFaceFamilyName(font: *const TTF_Font) -> *const libc::c_char;
}
extern "C" {
pub fn TTF_FontFaceStyleName(font: *const TTF_Font) -> *const libc::c_char;
}
extern "C" {
pub fn TTF_FontFaceStyleName(font: *const TTF_Font) -> *mut libc::c_char;
pub fn TTF_GlyphIsProvided(font: *mut TTF_Font, ch: Uint16) -> libc::c_int;
}
extern "C" {
pub fn TTF_GlyphIsProvided(font: *const TTF_Font, ch: Uint16) -> libc::c_int;
pub fn TTF_GlyphIsProvided32(font: *mut TTF_Font, ch: Uint32) -> libc::c_int;
}
extern "C" {
pub fn TTF_GlyphMetrics(
Expand All @@ -126,6 +196,17 @@ extern "C" {
advance: *mut libc::c_int,
) -> libc::c_int;
}
extern "C" {
pub fn TTF_GlyphMetrics32(
font: *mut TTF_Font,
ch: Uint32,
minx: *mut libc::c_int,
maxx: *mut libc::c_int,
miny: *mut libc::c_int,
maxy: *mut libc::c_int,
advance: *mut libc::c_int,
) -> libc::c_int;
}
extern "C" {
pub fn TTF_SizeText(
font: *mut TTF_Font,
Expand All @@ -150,6 +231,33 @@ extern "C" {
h: *mut libc::c_int,
) -> libc::c_int;
}
extern "C" {
pub fn TTF_MeasureText(
font: *mut TTF_Font,
text: *const libc::c_char,
measure_width: libc::c_int,
extent: *mut libc::c_int,
count: *mut libc::c_int,
) -> libc::c_int;
}
extern "C" {
pub fn TTF_MeasureUTF8(
font: *mut TTF_Font,
text: *const libc::c_char,
measure_width: libc::c_int,
extent: *mut libc::c_int,
count: *mut libc::c_int,
) -> libc::c_int;
}
extern "C" {
pub fn TTF_MeasureUNICODE(
font: *mut TTF_Font,
text: *const Uint16,
measure_width: libc::c_int,
extent: *mut libc::c_int,
count: *mut libc::c_int,
) -> libc::c_int;
}
extern "C" {
pub fn TTF_RenderText_Solid(
font: *mut TTF_Font,
Expand All @@ -171,13 +279,44 @@ extern "C" {
fg: SDL_Color,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderText_Solid_Wrapped(
font: *mut TTF_Font,
text: *const libc::c_char,
fg: SDL_Color,
wrapLength: Uint32,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderUTF8_Solid_Wrapped(
font: *mut TTF_Font,
text: *const libc::c_char,
fg: SDL_Color,
wrapLength: Uint32,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderUNICODE_Solid_Wrapped(
font: *mut TTF_Font,
text: *const Uint16,
fg: SDL_Color,
wrapLength: Uint32,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderGlyph_Solid(
font: *mut TTF_Font,
ch: Uint16,
fg: SDL_Color,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderGlyph32_Solid(
font: *mut TTF_Font,
ch: Uint32,
fg: SDL_Color,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderText_Shaded(
font: *mut TTF_Font,
Expand All @@ -202,6 +341,33 @@ extern "C" {
bg: SDL_Color,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderText_Shaded_Wrapped(
font: *mut TTF_Font,
text: *const libc::c_char,
fg: SDL_Color,
bg: SDL_Color,
wrapLength: Uint32,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderUTF8_Shaded_Wrapped(
font: *mut TTF_Font,
text: *const libc::c_char,
fg: SDL_Color,
bg: SDL_Color,
wrapLength: Uint32,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderUNICODE_Shaded_Wrapped(
font: *mut TTF_Font,
text: *const Uint16,
fg: SDL_Color,
bg: SDL_Color,
wrapLength: Uint32,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderGlyph_Shaded(
font: *mut TTF_Font,
Expand All @@ -210,6 +376,14 @@ extern "C" {
bg: SDL_Color,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderGlyph32_Shaded(
font: *mut TTF_Font,
ch: Uint32,
fg: SDL_Color,
bg: SDL_Color,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderText_Blended(
font: *mut TTF_Font,
Expand Down Expand Up @@ -262,6 +436,80 @@ extern "C" {
fg: SDL_Color,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderGlyph32_Blended(
font: *mut TTF_Font,
ch: Uint32,
fg: SDL_Color,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderText_LCD(
font: *mut TTF_Font,
text: *const libc::c_char,
fg: SDL_Color,
bg: SDL_Color,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderUTF8_LCD(
font: *mut TTF_Font,
text: *const libc::c_char,
fg: SDL_Color,
bg: SDL_Color,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderUNICODE_LCD(
font: *mut TTF_Font,
text: *const Uint16,
fg: SDL_Color,
bg: SDL_Color,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderText_LCD_Wrapped(
font: *mut TTF_Font,
text: *const libc::c_char,
fg: SDL_Color,
bg: SDL_Color,
wrapLength: Uint32,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderUTF8_LCD_Wrapped(
font: *mut TTF_Font,
text: *const libc::c_char,
fg: SDL_Color,
bg: SDL_Color,
wrapLength: Uint32,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderUNICODE_LCD_Wrapped(
font: *mut TTF_Font,
text: *const Uint16,
fg: SDL_Color,
bg: SDL_Color,
wrapLength: Uint32,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderGlyph_LCD(
font: *mut TTF_Font,
ch: Uint16,
fg: SDL_Color,
bg: SDL_Color,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_RenderGlyph32_LCD(
font: *mut TTF_Font,
ch: Uint32,
fg: SDL_Color,
bg: SDL_Color,
) -> *mut SDL_Surface;
}
extern "C" {
pub fn TTF_CloseFont(font: *mut TTF_Font);
}
Expand All @@ -285,3 +533,33 @@ extern "C" {
ch: Uint16,
) -> libc::c_int;
}
extern "C" {
pub fn TTF_GetFontKerningSizeGlyphs32(
font: *mut TTF_Font,
previous_ch: Uint32,
ch: Uint32,
) -> libc::c_int;
}
extern "C" {
pub fn TTF_SetFontSDF(font: *mut TTF_Font, on_off: SDL_bool) -> libc::c_int;
}
extern "C" {
pub fn TTF_GetFontSDF(font: *const TTF_Font) -> SDL_bool;
}
pub const TTF_Direction_TTF_DIRECTION_LTR: TTF_Direction = 0;
pub const TTF_Direction_TTF_DIRECTION_RTL: TTF_Direction = 1;
pub const TTF_Direction_TTF_DIRECTION_TTB: TTF_Direction = 2;
pub const TTF_Direction_TTF_DIRECTION_BTT: TTF_Direction = 3;
pub type TTF_Direction = libc::c_uint;
extern "C" {
pub fn TTF_SetDirection(direction: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn TTF_SetScript(script: libc::c_int) -> libc::c_int;
}
extern "C" {
pub fn TTF_SetFontDirection(font: *mut TTF_Font, direction: TTF_Direction) -> libc::c_int;
}
extern "C" {
pub fn TTF_SetFontScriptName(font: *mut TTF_Font, script: *const libc::c_char) -> libc::c_int;
}
Loading

0 comments on commit 9f5d7e5

Please sign in to comment.