diff --git a/.gitmodules b/.gitmodules index 330b8a4ab..a7e3df633 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,12 @@ [submodule "harfbuzz/harfbuzz"] - path = ci/harfbuzz + path = deps/harfbuzz/harfbuzz url = https://github.com/harfbuzz/harfbuzz.git [submodule "ci/esctest"] path = ci/esctest url = https://gitlab.freedesktop.org/terminal-wg/esctest +[submodule "freetype/freetype2"] + path = deps/freetype/freetype2 + url = git://git.savannah.gnu.org/freetype/freetype2.git +[submodule "freetype/libpng"] + path = deps/freetype/libpng + url = https://github.com/glennrp/libpng.git diff --git a/.travis.yml b/.travis.yml index 519c9a65c..2366f3349 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,6 @@ matrix: before_script: - rustup component add rustfmt-preview - - PREFIX=$TRAVIS_BUILD_DIR ./ci/build_harfbuzz.sh script: - "if [[ \"$TRAVIS_RUST_VERSION\" == \"stable\" ]] ; then cargo fmt --all -- --check ; else true ; fi" @@ -50,7 +49,3 @@ addons: - libxkbcommon-dev - libxkbcommon-x11-dev - ragel - -env: - global: - - PKG_CONFIG_PATH=$TRAVIS_BUILD_DIR/lib/pkgconfig diff --git a/Cargo.toml b/Cargo.toml index 601664ef7..26fca4544 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,11 +17,10 @@ serde_derive = "~1.0" toml = "~0.4" unicode-width = "~0.1" dirs = "~1.0" -font-loader = "0.8" rusttype = "0.7" clipboard = "0.5" unicode-normalization = "~0.1" -freetype = "~0.4" +freetype = { path = "deps/freetype" } open = "1.2" structopt = "0.2" foreign-types = "0.3" @@ -36,16 +35,25 @@ leb128 = "0.2" zstd = "0.4" [target.'cfg(unix)'.dependencies] -harfbuzz-sys = { git = "https://github.com/wez/rust-harfbuzz", branch="coretext" } +harfbuzz = { path = "deps/harfbuzz" } mio = "~0.6" mio-extras = "~2.0" +[dependencies.fontconfig] +optional = true +path = "deps/fontconfig" + [dependencies.term] path = "term" [dependencies.termwiz] path = "termwiz" +[target.'cfg(any(windows, target_os = "macos"))'.dependencies.font-loader] +# on linux, font-loader pulls in servo-font* crates which conflict with +# our newer font related deps, so we avoid it on linux +version = "0.8" + [target."cfg(windows)".dependencies.uds_windows] version = "0.1" @@ -61,7 +69,7 @@ features = [ version = "~0.3" [target.'cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))'.dependencies] -servo-fontconfig = "~0.4" +fontconfig = { path = "deps/fontconfig" } egli = "~0.4" x11 = {version ="~2.18", features = ["xlib_xcb"]} @@ -94,11 +102,11 @@ core-foundation = "0.6" debug-escape-sequences = ["term/debug-escape-sequences"] force-glutin = [] force-rusttype = [] +force-fontconfig = ["fontconfig"] [patch.crates-io] # We need https://github.com/tomaka/glutin/pull/1099 glutin = { git = "https://github.com/yvt/glutin", branch="patch-macos-iscurrent" } -harfbuzz-sys = { git = "https://github.com/wez/rust-harfbuzz", branch="coretext" } [workspace] diff --git a/ci/harfbuzz b/ci/harfbuzz deleted file mode 160000 index f0b700db3..000000000 --- a/ci/harfbuzz +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f0b700db394ccdff30ff83961a3e2ea9ff4ea472 diff --git a/deps/fontconfig/Cargo.toml b/deps/fontconfig/Cargo.toml new file mode 100644 index 000000000..36b0966a0 --- /dev/null +++ b/deps/fontconfig/Cargo.toml @@ -0,0 +1,13 @@ +[package] +authors = ["Wez Furlong "] +name = "fontconfig" +version = "0.1.0" +edition = "2018" +links = "fontconfig" +build = "build.rs" + +[dependencies] +libc = "~0.2" + +[build-dependencies] +pkg-config = "0.3" diff --git a/deps/fontconfig/build.rs b/deps/fontconfig/build.rs new file mode 100644 index 000000000..ed24bed6b --- /dev/null +++ b/deps/fontconfig/build.rs @@ -0,0 +1,23 @@ +use pkg_config; +use std::env; + +fn main() { + let out_dir = env::var("OUT_DIR").unwrap(); + + if let Ok(lib) = pkg_config::Config::new() + .atleast_version("2.11.1") + .find("fontconfig") + { + println!( + "cargo:incdir={}", + lib.include_paths[0] + .clone() + .into_os_string() + .into_string() + .unwrap() + ); + return; + } + + panic!("You need to install fontconfig"); +} diff --git a/deps/fontconfig/src/lib.rs b/deps/fontconfig/src/lib.rs new file mode 100644 index 000000000..984daa309 --- /dev/null +++ b/deps/fontconfig/src/lib.rs @@ -0,0 +1,736 @@ +// Copyright 2013 The Servo Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] + +use libc::*; + +pub type FcChar8 = c_uchar; +pub type FcChar16 = c_ushort; +pub type FcChar32 = c_uint; +pub type FcBool = c_int; + +pub type enum__FcType = c_uint; +pub const FcTypeVoid: u32 = 0_u32; +pub const FcTypeInteger: u32 = 1_u32; +pub const FcTypeDouble: u32 = 2_u32; +pub const FcTypeString: u32 = 3_u32; +pub const FcTypeBool: u32 = 4_u32; +pub const FcTypeMatrix: u32 = 5_u32; +pub const FcTypeCharSet: u32 = 6_u32; +pub const FcTypeFTFace: u32 = 7_u32; +pub const FcTypeLangSet: u32 = 8_u32; + +pub type FcType = enum__FcType; + +pub const FC_WEIGHT_THIN: c_int = 0; +pub const FC_WEIGHT_EXTRALIGHT: c_int = 40; +pub const FC_WEIGHT_ULTRALIGHT: c_int = FC_WEIGHT_EXTRALIGHT; +pub const FC_WEIGHT_LIGHT: c_int = 50; +pub const FC_WEIGHT_BOOK: c_int = 75; +pub const FC_WEIGHT_REGULAR: c_int = 80; +pub const FC_WEIGHT_NORMAL: c_int = FC_WEIGHT_REGULAR; +pub const FC_WEIGHT_MEDIUM: c_int = 100; +pub const FC_WEIGHT_DEMIBOLD: c_int = 180; +pub const FC_WEIGHT_SEMIBOLD: c_int = FC_WEIGHT_DEMIBOLD; +pub const FC_WEIGHT_BOLD: c_int = 200; +pub const FC_WEIGHT_EXTRABOLD: c_int = 205; +pub const FC_WEIGHT_ULTRABOLD: c_int = FC_WEIGHT_EXTRABOLD; +pub const FC_WEIGHT_BLACK: c_int = 210; +pub const FC_WEIGHT_HEAVY: c_int = FC_WEIGHT_BLACK; +pub const FC_WEIGHT_EXTRABLACK: c_int = 215; +pub const FC_WEIGHT_ULTRABLACK: c_int = FC_WEIGHT_EXTRABLACK; + +pub const FC_SLANT_ROMAN: c_int = 0; +pub const FC_SLANT_ITALIC: c_int = 100; +pub const FC_SLANT_OBLIQUE: c_int = 110; + +#[repr(C)] +#[derive(Copy, Clone)] +pub struct struct__FcMatrix { + pub xx: c_double, + pub xy: c_double, + pub yx: c_double, + pub yy: c_double, +} + +pub type FcMatrix = struct__FcMatrix; + +pub type struct__FcCharSet = c_void; + +pub type FcCharSet = struct__FcCharSet; + +#[repr(C)] +#[allow(missing_copy_implementations)] +pub struct struct__FcObjectType { + pub object: *mut c_char, + pub _type: FcType, +} + +pub type FcObjectType = struct__FcObjectType; + +#[repr(C)] +#[allow(missing_copy_implementations)] +pub struct struct__FcConstant { + pub name: *mut FcChar8, + pub object: *mut c_char, + pub value: c_int, +} + +pub type FcConstant = struct__FcConstant; + +pub type enum__FcResult = c_uint; +pub const FcResultMatch: u32 = 0_u32; +pub const FcResultNoMatch: u32 = 1_u32; +pub const FcResultTypeMismatch: u32 = 2_u32; +pub const FcResultNoId: u32 = 3_u32; +pub const FcResultOutOfMemory: u32 = 4_u32; + +pub type FcResult = enum__FcResult; + +pub type struct__FcPattern = c_void; + +pub type FcPattern = struct__FcPattern; + +pub type struct__FcLangSet = c_void; + +pub type FcLangSet = struct__FcLangSet; + +#[repr(C)] +#[allow(missing_copy_implementations)] +pub struct struct__FcValue { + pub _type: FcType, + pub u: union_unnamed1, +} + +pub type FcValue = struct__FcValue; + +#[repr(C)] +#[allow(missing_copy_implementations)] +pub struct struct__FcFontSet { + pub nfont: c_int, + pub sfont: c_int, + pub fonts: *mut *mut FcPattern, +} + +pub type FcFontSet = struct__FcFontSet; + +#[repr(C)] +#[allow(missing_copy_implementations)] +pub struct struct__FcObjectSet { + pub nobject: c_int, + pub sobject: c_int, + pub objects: *mut *mut c_char, +} + +pub type FcObjectSet = struct__FcObjectSet; + +pub type enum__FcMatchKind = c_uint; +pub const FcMatchPattern: u32 = 0_u32; +pub const FcMatchFont: u32 = 1_u32; +pub const FcMatchScan: u32 = 2_u32; + +pub type FcMatchKind = enum__FcMatchKind; + +pub type enum__FcLangResult = c_uint; +pub const FcLangEqual: u32 = 0_u32; +pub const FcLangDifferentCountry: u32 = 1_u32; +pub const FcLangDifferentTerritory: u32 = 1_u32; +pub const FcLangDifferentLang: u32 = 2_u32; + +pub type FcLangResult = enum__FcLangResult; + +pub type enum__FcSetName = c_uint; +pub const FcSetSystem: u32 = 0_u32; +pub const FcSetApplication: u32 = 1_u32; + +pub type FcSetName = enum__FcSetName; + +pub type struct__FcAtomic = c_void; + +pub type FcAtomic = struct__FcAtomic; + +pub type FcEndian = c_uint; +pub const FcEndianBig: u32 = 0_u32; +pub const FcEndianLittle: u32 = 1_u32; + +pub type struct__FcConfig = c_void; + +pub type FcConfig = struct__FcConfig; + +pub type struct__FcGlobalCache = c_void; + +pub type FcFileCache = struct__FcGlobalCache; + +pub type struct__FcBlanks = c_void; + +pub type FcBlanks = struct__FcBlanks; + +pub type struct__FcStrList = c_void; + +pub type FcStrList = struct__FcStrList; + +pub type struct__FcStrSet = c_void; + +pub type FcStrSet = struct__FcStrSet; + +pub type struct__FcCache = c_void; + +pub type FcCache = struct__FcCache; + +pub type union_unnamed1 = c_void; + +extern "C" { + + pub fn FcBlanksCreate() -> *mut FcBlanks; + + pub fn FcBlanksDestroy(b: *mut FcBlanks); + + pub fn FcBlanksAdd(b: *mut FcBlanks, ucs4: FcChar32) -> FcBool; + + pub fn FcBlanksIsMember(b: *mut FcBlanks, ucs4: FcChar32) -> FcBool; + + pub fn FcCacheDir(c: *mut FcCache) -> *const FcChar8; + + pub fn FcCacheCopySet(c: *const FcCache) -> *mut FcFontSet; + + pub fn FcCacheSubdir(c: *const FcCache, i: c_int) -> *const FcChar8; + + pub fn FcCacheNumSubdir(c: *const FcCache) -> c_int; + + pub fn FcCacheNumFont(c: *const FcCache) -> c_int; + + pub fn FcDirCacheUnlink(dir: *const FcChar8, config: *mut FcConfig) -> FcBool; + + pub fn FcDirCacheValid(cache_file: *const FcChar8) -> FcBool; + + pub fn FcConfigHome() -> *mut FcChar8; + + pub fn FcConfigEnableHome(enable: FcBool) -> FcBool; + + pub fn FcConfigFilename(url: *const FcChar8) -> *mut FcChar8; + + pub fn FcConfigCreate() -> *mut FcConfig; + + pub fn FcConfigReference(config: *mut FcConfig) -> *mut FcConfig; + + pub fn FcConfigDestroy(config: *mut FcConfig); + + pub fn FcConfigSetCurrent(config: *mut FcConfig) -> FcBool; + + pub fn FcConfigGetCurrent() -> *mut FcConfig; + + pub fn FcConfigUptoDate(config: *mut FcConfig) -> FcBool; + + pub fn FcConfigBuildFonts(config: *mut FcConfig) -> FcBool; + + pub fn FcConfigGetFontDirs(config: *mut FcConfig) -> *mut FcStrList; + + pub fn FcConfigGetConfigDirs(config: *mut FcConfig) -> *mut FcStrList; + + pub fn FcConfigGetConfigFiles(config: *mut FcConfig) -> *mut FcStrList; + + pub fn FcConfigGetCache(config: *mut FcConfig) -> *mut FcChar8; + + pub fn FcConfigGetBlanks(config: *mut FcConfig) -> *mut FcBlanks; + + pub fn FcConfigGetCacheDirs(config: *const FcConfig) -> *mut FcStrList; + + pub fn FcConfigGetRescanInterval(config: *mut FcConfig) -> c_int; + + pub fn FcConfigSetRescanInterval(config: *mut FcConfig, rescanInterval: c_int) -> FcBool; + + pub fn FcConfigGetFonts(config: *mut FcConfig, set: FcSetName) -> *mut FcFontSet; + + pub fn FcConfigAppFontAddFile(config: *mut FcConfig, file: *const FcChar8) -> FcBool; + + pub fn FcConfigAppFontAddDir(config: *mut FcConfig, dir: *const FcChar8) -> FcBool; + + pub fn FcConfigAppFontClear(config: *mut FcConfig); + + pub fn FcConfigSubstituteWithPat( + config: *mut FcConfig, + p: *mut FcPattern, + p_pat: *mut FcPattern, + kind: FcMatchKind, + ) -> FcBool; + + pub fn FcConfigSubstitute( + config: *mut FcConfig, + p: *mut FcPattern, + kind: FcMatchKind, + ) -> FcBool; + + pub fn FcCharSetCreate() -> *mut FcCharSet; + + pub fn FcCharSetNew() -> *mut FcCharSet; + + pub fn FcCharSetDestroy(fcs: *mut FcCharSet); + + pub fn FcCharSetAddChar(fcs: *mut FcCharSet, ucs4: FcChar32) -> FcBool; + + pub fn FcCharSetCopy(src: *mut FcCharSet) -> *mut FcCharSet; + + pub fn FcCharSetEqual(a: *const FcCharSet, b: *const FcCharSet) -> FcBool; + + pub fn FcCharSetIntersect(a: *const FcCharSet, b: *const FcCharSet) -> *mut FcCharSet; + + pub fn FcCharSetUnion(a: *const FcCharSet, b: *const FcCharSet) -> *mut FcCharSet; + + pub fn FcCharSetSubtract(a: *const FcCharSet, b: *const FcCharSet) -> *mut FcCharSet; + + pub fn FcCharSetMerge(a: *mut FcCharSet, b: *const FcCharSet, changed: *mut FcBool) -> FcBool; + + pub fn FcCharSetHasChar(fcs: *const FcCharSet, ucs4: FcChar32) -> FcBool; + + pub fn FcCharSetCount(a: *const FcCharSet) -> FcChar32; + + pub fn FcCharSetIntersectCount(a: *const FcCharSet, b: *const FcCharSet) -> FcChar32; + + pub fn FcCharSetSubtractCount(a: *const FcCharSet, b: *const FcCharSet) -> FcChar32; + + pub fn FcCharSetIsSubset(a: *const FcCharSet, bi: *const FcCharSet) -> FcBool; + + pub fn FcCharSetFirstPage( + a: *const FcCharSet, + map: *mut FcChar32, + next: *mut FcChar32, + ) -> FcChar32; + + pub fn FcCharSetNextPage( + a: *const FcCharSet, + map: *mut FcChar32, + next: *mut FcChar32, + ) -> FcChar32; + + pub fn FcCharSetCoverage( + a: *const FcCharSet, + page: FcChar32, + result: *mut FcChar32, + ) -> FcChar32; + + pub fn FcValuePrint(v: FcValue); + + pub fn FcPatternPrint(p: *const FcPattern); + + pub fn FcFontSetPrint(s: *mut FcFontSet); + + pub fn FcDefaultSubstitute(pattern: *mut FcPattern); + + pub fn FcFileIsDir(file: *const FcChar8) -> FcBool; + + pub fn FcFileScan( + set: *mut FcFontSet, + dirs: *mut FcStrSet, + cache: *mut FcFileCache, + blanks: *mut FcBlanks, + file: *const FcChar8, + force: FcBool, + ) -> FcBool; + + pub fn FcDirScan( + set: *mut FcFontSet, + dirs: *mut FcStrSet, + cache: *mut FcFileCache, + blanks: *mut FcBlanks, + dir: *const FcChar8, + force: FcBool, + ) -> FcBool; + + pub fn FcDirSave(set: *mut FcFontSet, dirs: *const FcStrSet, dir: *mut FcChar8) -> FcBool; + + pub fn FcDirCacheLoad( + dir: *const FcChar8, + config: *mut FcConfig, + cache_file: *mut *mut FcChar8, + ) -> *mut FcCache; + + pub fn FcDirCacheRead( + dir: *const FcChar8, + force: FcBool, + config: *mut FcConfig, + ) -> *mut FcCache; + + //pub fn FcDirCacheLoadFile(cache_file: *mut FcChar8, file_stat: *mut struct_stat) -> *mut FcCache; + + pub fn FcDirCacheUnload(cache: *mut FcCache); + + pub fn FcFreeTypeQuery( + file: *const FcChar8, + id: c_int, + blanks: *mut FcBlanks, + count: *mut c_int, + ) -> *mut FcPattern; + + pub fn FcFontSetCreate() -> *mut FcFontSet; + + pub fn FcFontSetDestroy(s: *mut FcFontSet); + + pub fn FcFontSetAdd(s: *mut FcFontSet, font: *mut FcPattern) -> FcBool; + + pub fn FcInitLoadConfig() -> *mut FcConfig; + + pub fn FcInitLoadConfigAndFonts() -> *mut FcConfig; + + pub fn FcInit() -> FcBool; + + pub fn FcFini(); + + pub fn FcGetVersion() -> c_int; + + pub fn FcInitReinitialize() -> FcBool; + + pub fn FcInitBringUptoDate() -> FcBool; + + pub fn FcGetLangs() -> *mut FcStrSet; + + pub fn FcLangGetCharSet(lang: *const FcChar8) -> *mut FcCharSet; + + pub fn FcLangSetCreate() -> *mut FcLangSet; + + pub fn FcLangSetDestroy(ls: *mut FcLangSet); + + pub fn FcLangSetCopy(ls: *const FcLangSet) -> *mut FcLangSet; + + pub fn FcLangSetAdd(ls: *mut FcLangSet, lang: *const FcChar8) -> FcBool; + + pub fn FcLangSetHasLang(ls: *const FcLangSet, lang: *const FcChar8) -> FcLangResult; + + pub fn FcLangSetCompare(lsa: *const FcLangSet, lsb: *const FcLangSet) -> FcLangResult; + + pub fn FcLangSetContains(lsa: *const FcLangSet, lsb: *const FcLangSet) -> FcBool; + + pub fn FcLangSetEqual(lsa: *const FcLangSet, lsb: *const FcLangSet) -> FcBool; + + pub fn FcLangSetHash(ls: *const FcLangSet) -> FcChar32; + + pub fn FcLangSetGetLangs(ls: *const FcLangSet) -> *mut FcStrSet; + + pub fn FcObjectSetCreate() -> *mut FcObjectSet; + + pub fn FcObjectSetAdd(os: *mut FcObjectSet, object: *const c_char) -> FcBool; + + pub fn FcObjectSetDestroy(os: *mut FcObjectSet); + + //pub fn FcObjectSetVaBuild(first: *mut c_char, va: *mut __va_list_tag) -> *mut FcObjectSet; + + pub fn FcObjectSetBuild(first: *mut c_char, ...) -> *mut FcObjectSet; + + pub fn FcFontSetList( + config: *mut FcConfig, + sets: *mut *mut FcFontSet, + nsets: c_int, + p: *mut FcPattern, + os: *mut FcObjectSet, + ) -> *mut FcFontSet; + + pub fn FcFontList( + config: *mut FcConfig, + p: *mut FcPattern, + os: *mut FcObjectSet, + ) -> *mut FcFontSet; + + pub fn FcAtomicCreate(file: *const FcChar8) -> *mut FcAtomic; + + pub fn FcAtomicLock(atomic: *mut FcAtomic) -> FcBool; + + pub fn FcAtomicNewFile(atomic: *mut FcAtomic) -> *mut FcChar8; + + pub fn FcAtomicOrigFile(atomic: *mut FcAtomic) -> *mut FcChar8; + + pub fn FcAtomicReplaceOrig(atomic: *mut FcAtomic) -> FcBool; + + pub fn FcAtomicDeleteNew(atomic: *mut FcAtomic); + + pub fn FcAtomicUnlock(atomic: *mut FcAtomic); + + pub fn FcAtomicDestroy(atomic: *mut FcAtomic); + + pub fn FcFontSetMatch( + config: *mut FcConfig, + sets: *mut *mut FcFontSet, + nsets: c_int, + p: *mut FcPattern, + result: *mut FcResult, + ) -> *mut FcPattern; + + pub fn FcFontMatch( + config: *mut FcConfig, + p: *mut FcPattern, + result: *mut FcResult, + ) -> *mut FcPattern; + + pub fn FcFontRenderPrepare( + config: *mut FcConfig, + pat: *mut FcPattern, + font: *mut FcPattern, + ) -> *mut FcPattern; + + pub fn FcFontSetSort( + config: *mut FcConfig, + sets: *mut *mut FcFontSet, + nsets: c_int, + p: *mut FcPattern, + trim: FcBool, + csp: *mut *mut FcCharSet, + result: *mut FcResult, + ) -> *mut FcFontSet; + + pub fn FcFontSort( + config: *mut FcConfig, + p: *mut FcPattern, + trim: FcBool, + csp: *mut *mut FcCharSet, + result: *mut FcResult, + ) -> *mut FcFontSet; + + pub fn FcFontSetSortDestroy(fs: *mut FcFontSet); + + pub fn FcMatrixCopy(mat: *const FcMatrix) -> *mut FcMatrix; + + pub fn FcMatrixEqual(mat1: *const FcMatrix, mat2: *const FcMatrix) -> FcBool; + + pub fn FcMatrixMultiply(result: *mut FcMatrix, a: *const FcMatrix, b: *const FcMatrix); + + pub fn FcMatrixRotate(m: *mut FcMatrix, c: c_double, s: c_double); + + pub fn FcMatrixScale(m: *mut FcMatrix, sx: c_double, sy: c_double); + + pub fn FcMatrixShear(m: *mut FcMatrix, sh: c_double, sv: c_double); + + pub fn FcNameRegisterObjectTypes(types: *const FcObjectType, ntype: c_int) -> FcBool; + + pub fn FcNameUnregisterObjectTypes(types: *const FcObjectType, ntype: c_int) -> FcBool; + + pub fn FcNameGetObjectType(object: *const c_char) -> *const FcObjectType; + + pub fn FcNameRegisterConstants(consts: *const FcConstant, nconsts: c_int) -> FcBool; + + pub fn FcNameUnregisterConstants(consts: *const FcConstant, nconsts: c_int) -> FcBool; + + pub fn FcNameGetConstant(string: *mut FcChar8) -> *const FcConstant; + + pub fn FcNameConstant(string: *mut FcChar8, result: *mut c_int) -> FcBool; + + pub fn FcNameParse(name: *const FcChar8) -> *mut FcPattern; + + pub fn FcNameUnparse(pat: *mut FcPattern) -> *mut FcChar8; + + pub fn FcPatternCreate() -> *mut FcPattern; + + pub fn FcPatternDuplicate(p: *const FcPattern) -> *mut FcPattern; + + pub fn FcPatternReference(p: *mut FcPattern); + + pub fn FcPatternFilter(p: *mut FcPattern, os: *const FcObjectSet) -> *mut FcPattern; + + pub fn FcValueDestroy(v: FcValue); + + pub fn FcValueEqual(va: FcValue, vb: FcValue) -> FcBool; + + pub fn FcValueSave(v: FcValue) -> FcValue; + + pub fn FcPatternDestroy(p: *mut FcPattern); + + pub fn FcPatternEqual(pa: *const FcPattern, pb: *const FcPattern) -> FcBool; + + pub fn FcPatternEqualSubset( + pa: *const FcPattern, + pb: *const FcPattern, + os: *const FcObjectSet, + ) -> FcBool; + + pub fn FcPatternHash(p: *const FcPattern) -> FcChar32; + + pub fn FcPatternAdd( + p: *mut FcPattern, + object: *const c_char, + value: FcValue, + append: FcBool, + ) -> FcBool; + + pub fn FcPatternAddWeak( + p: *mut FcPattern, + object: *const c_char, + value: FcValue, + append: FcBool, + ) -> FcBool; + + pub fn FcPatternGet( + p: *mut FcPattern, + object: *const c_char, + id: c_int, + v: *mut FcValue, + ) -> FcResult; + + pub fn FcPatternDel(p: *mut FcPattern, object: *const c_char) -> FcBool; + + pub fn FcPatternRemove(p: *mut FcPattern, object: *const c_char, id: c_int) -> FcBool; + + pub fn FcPatternAddInteger(p: *mut FcPattern, object: *const c_char, i: c_int) -> FcBool; + + pub fn FcPatternAddDouble(p: *mut FcPattern, object: *const c_char, d: c_double) -> FcBool; + + pub fn FcPatternAddString( + p: *mut FcPattern, + object: *const c_char, + s: *const FcChar8, + ) -> FcBool; + + pub fn FcPatternAddMatrix( + p: *mut FcPattern, + object: *const c_char, + s: *const FcMatrix, + ) -> FcBool; + + pub fn FcPatternAddCharSet( + p: *mut FcPattern, + object: *const c_char, + c: *const FcCharSet, + ) -> FcBool; + + pub fn FcPatternAddBool(p: *mut FcPattern, object: *const c_char, b: FcBool) -> FcBool; + + pub fn FcPatternAddLangSet( + p: *mut FcPattern, + object: *const c_char, + ls: *const FcLangSet, + ) -> FcBool; + + pub fn FcPatternGetInteger( + p: *mut FcPattern, + object: *const c_char, + n: c_int, + i: *mut c_int, + ) -> FcResult; + + pub fn FcPatternGetDouble( + p: *mut FcPattern, + object: *const c_char, + n: c_int, + d: *mut c_double, + ) -> FcResult; + + pub fn FcPatternGetString( + p: *mut FcPattern, + object: *const c_char, + n: c_int, + s: *mut *mut FcChar8, + ) -> FcResult; + + pub fn FcPatternGetMatrix( + p: *mut FcPattern, + object: *const c_char, + n: c_int, + s: *mut *mut FcMatrix, + ) -> FcResult; + + pub fn FcPatternGetCharSet( + p: *mut FcPattern, + object: *const c_char, + n: c_int, + c: *mut *mut FcCharSet, + ) -> FcResult; + + pub fn FcPatternGetBool( + p: *mut FcPattern, + object: *const c_char, + n: c_int, + b: *mut FcBool, + ) -> FcResult; + + pub fn FcPatternGetLangSet( + p: *mut FcPattern, + object: *const c_char, + n: c_int, + ls: *mut *mut FcLangSet, + ) -> FcResult; + + //pub fn FcPatternVaBuild(p: *mut FcPattern, va: *mut __va_list_tag) -> *mut FcPattern; + + pub fn FcPatternBuild(p: *mut FcPattern, ...) -> *mut FcPattern; + + pub fn FcPatternFormat(pat: *mut FcPattern, format: *const FcChar8) -> *mut FcChar8; + + pub fn FcStrCopy(s: *const FcChar8) -> *mut FcChar8; + + pub fn FcStrCopyFilename(s: *const FcChar8) -> *mut FcChar8; + + pub fn FcStrPlus(s1: *const FcChar8, s2: *const FcChar8) -> *mut FcChar8; + + pub fn FcStrFree(s: *mut FcChar8); + + pub fn FcStrDowncase(s: *const FcChar8) -> *mut FcChar8; + + pub fn FcStrCmpIgnoreCase(s1: *const FcChar8, s2: *const FcChar8) -> c_int; + + pub fn FcStrCmp(s1: *const FcChar8, s2: *const FcChar8) -> c_int; + + pub fn FcStrStrIgnoreCase(s1: *const FcChar8, s2: *const FcChar8) -> *mut FcChar8; + + pub fn FcStrStr(s1: *const FcChar8, s2: *const FcChar8) -> *mut FcChar8; + + pub fn FcUtf8ToUcs4(src_orig: *mut FcChar8, dst: *mut FcChar32, len: c_int) -> c_int; + + pub fn FcUtf8Len( + string: *mut FcChar8, + len: c_int, + nchar: *mut c_int, + wchar: *mut c_int, + ) -> FcBool; + + pub fn FcUcs4ToUtf8(ucs4: FcChar32, dest: *mut FcChar8) -> c_int; + + pub fn FcUtf16ToUcs4( + src_orig: *mut FcChar8, + endian: FcEndian, + dst: *mut FcChar32, + len: c_int, + ) -> c_int; + + pub fn FcUtf16Len( + string: *mut FcChar8, + endian: FcEndian, + len: c_int, + nchar: *mut c_int, + wchar: *mut c_int, + ) -> FcBool; + + pub fn FcStrDirname(file: *const FcChar8) -> *mut FcChar8; + + pub fn FcStrBasename(file: *const FcChar8) -> *mut FcChar8; + + pub fn FcStrSetCreate() -> *mut FcStrSet; + + pub fn FcStrSetMember(set: *mut FcStrSet, s: *const FcChar8) -> FcBool; + + pub fn FcStrSetEqual(sa: *mut FcStrSet, sb: *mut FcStrSet) -> FcBool; + + pub fn FcStrSetAdd(set: *mut FcStrSet, s: *const FcChar8) -> FcBool; + + pub fn FcStrSetAddFilename(set: *mut FcStrSet, s: *const FcChar8) -> FcBool; + + pub fn FcStrSetDel(set: *mut FcStrSet, s: *const FcChar8) -> FcBool; + + pub fn FcStrSetDestroy(set: *mut FcStrSet); + + pub fn FcStrListCreate(set: *mut FcStrSet) -> *mut FcStrList; + + pub fn FcStrListNext(list: *mut FcStrList) -> *mut FcChar8; + + pub fn FcStrListDone(list: *mut FcStrList); + + pub fn FcConfigParseAndLoad( + config: *mut FcConfig, + file: *const FcChar8, + complain: FcBool, + ) -> FcBool; + +} diff --git a/deps/freetype/Cargo.toml b/deps/freetype/Cargo.toml new file mode 100644 index 000000000..b94d8611a --- /dev/null +++ b/deps/freetype/Cargo.toml @@ -0,0 +1,12 @@ +[package] +authors = ["Wez Furlong "] +name = "freetype" +version = "0.1.0" +edition = "2018" +links = "freetype" +build = "build.rs" + +[dependencies] + +[build-dependencies] +cmake = "0.1" diff --git a/deps/freetype/bindings.h b/deps/freetype/bindings.h new file mode 100644 index 000000000..b6eb35835 --- /dev/null +++ b/deps/freetype/bindings.h @@ -0,0 +1,6 @@ +#include +#include +#include +#include +#include +#include diff --git a/deps/freetype/build.rs b/deps/freetype/build.rs new file mode 100644 index 000000000..d4142486e --- /dev/null +++ b/deps/freetype/build.rs @@ -0,0 +1,31 @@ +use cmake::Config; +use std::env; + +fn libpng() { + let mut config = Config::new("libpng"); + let dst = config.profile("Release").build(); + println!("cargo:rustc-link-search=native={}/lib", dst.display()); + println!("cargo:rustc-link-lib=static=png"); +} + +fn freetype() { + let mut config = Config::new("freetype2"); + let dst = config + .define("FT_WITH_PNG", "ON") + .profile("Release") + .build(); + println!("cargo:rustc-link-search=native={}/lib", dst.display()); + println!("cargo:rustc-link-lib=static=freetype"); + println!("cargo:rustc-link-search=native=/usr/lib"); + println!("cargo:rustc-link-lib=bz2"); + println!("cargo:rustc-link-lib=z"); + println!("cargo:include={}/include/freetype2", dst.display()); + println!("cargo:lib={}/lib/libfreetype.a", dst.display()); +} + +fn main() { + libpng(); + freetype(); + let out_dir = env::var("OUT_DIR").unwrap(); + println!("cargo:outdir={}", out_dir); +} diff --git a/deps/freetype/freetype2 b/deps/freetype/freetype2 new file mode 160000 index 000000000..fdb10e8b5 --- /dev/null +++ b/deps/freetype/freetype2 @@ -0,0 +1 @@ +Subproject commit fdb10e8b50cfff7be2ec2b77cb4a695f3d77643c diff --git a/deps/freetype/libpng b/deps/freetype/libpng new file mode 160000 index 000000000..8439534da --- /dev/null +++ b/deps/freetype/libpng @@ -0,0 +1 @@ +Subproject commit 8439534daa1d3a5705ba92e653eda9251246dd61 diff --git a/deps/freetype/regenerate.sh b/deps/freetype/regenerate.sh new file mode 100755 index 000000000..7a10d8545 --- /dev/null +++ b/deps/freetype/regenerate.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +bindgen bindings.h -o src/lib.rs \ + --no-doc-comments \ + --blacklist-type "FT_(Int16|UInt16|Int32|UInt32|Int16|Int64|UInt64)" \ + --raw-line "#![allow(non_snake_case)]" \ + --raw-line "#![allow(non_camel_case_types)]" \ + --raw-line "#![allow(non_upper_case_globals)]" \ + --raw-line "pub type FT_Int16 = i16;" \ + --raw-line "pub type FT_UInt16 = u16;" \ + --raw-line "pub type FT_Int32 = i32;" \ + --raw-line "pub type FT_UInt32 = u32;" \ + --raw-line "pub type FT_Int64= i64;" \ + --raw-line "pub type FT_UInt64= u64;" \ + --default-enum-style rust \ + --generate=functions,types,vars \ + --whitelist-function="FT_.*" \ + --whitelist-type="FT_.*" \ + --whitelist-var="FT_.*" \ + -- -Ifreetype2/include diff --git a/deps/freetype/src/lib.rs b/deps/freetype/src/lib.rs new file mode 100644 index 000000000..73fb39599 --- /dev/null +++ b/deps/freetype/src/lib.rs @@ -0,0 +1,3710 @@ +/* automatically generated by rust-bindgen */ + +#![allow(non_snake_case)] +#![allow(non_camel_case_types)] +#![allow(non_upper_case_globals)] +pub type FT_Int16 = i16; +pub type FT_UInt16 = u16; +pub type FT_Int32 = i32; +pub type FT_UInt32 = u32; +pub type FT_Int64 = i64; +pub type FT_UInt64 = u64; + +pub const FT_RENDER_POOL_SIZE: u32 = 16384; +pub const FT_MAX_MODULES: u32 = 32; +pub const FT_CHAR_BIT: u32 = 8; +pub const FT_USHORT_MAX: u32 = 65535; +pub const FT_INT_MAX: u32 = 2147483647; +pub const FT_INT_MIN: i32 = -2147483648; +pub const FT_UINT_MAX: u32 = 4294967295; +pub const FT_LONG_MIN: i64 = -9223372036854775808; +pub const FT_LONG_MAX: u64 = 9223372036854775807; +pub const FT_ULONG_MAX: i32 = -1; +pub const FT_SIZEOF_INT: u32 = 4; +pub const FT_SIZEOF_LONG: u32 = 8; +pub const FT_OUTLINE_CONTOURS_MAX: u32 = 32767; +pub const FT_OUTLINE_POINTS_MAX: u32 = 32767; +pub const FT_OUTLINE_NONE: u32 = 0; +pub const FT_OUTLINE_OWNER: u32 = 1; +pub const FT_OUTLINE_EVEN_ODD_FILL: u32 = 2; +pub const FT_OUTLINE_REVERSE_FILL: u32 = 4; +pub const FT_OUTLINE_IGNORE_DROPOUTS: u32 = 8; +pub const FT_OUTLINE_SMART_DROPOUTS: u32 = 16; +pub const FT_OUTLINE_INCLUDE_STUBS: u32 = 32; +pub const FT_OUTLINE_HIGH_PRECISION: u32 = 256; +pub const FT_OUTLINE_SINGLE_PASS: u32 = 512; +pub const FT_CURVE_TAG_ON: u32 = 1; +pub const FT_CURVE_TAG_CONIC: u32 = 0; +pub const FT_CURVE_TAG_CUBIC: u32 = 2; +pub const FT_CURVE_TAG_HAS_SCANMODE: u32 = 4; +pub const FT_CURVE_TAG_TOUCH_X: u32 = 8; +pub const FT_CURVE_TAG_TOUCH_Y: u32 = 16; +pub const FT_CURVE_TAG_TOUCH_BOTH: u32 = 24; +pub const FT_Curve_Tag_On: u32 = 1; +pub const FT_Curve_Tag_Conic: u32 = 0; +pub const FT_Curve_Tag_Cubic: u32 = 2; +pub const FT_Curve_Tag_Touch_X: u32 = 8; +pub const FT_Curve_Tag_Touch_Y: u32 = 16; +pub const FT_RASTER_FLAG_DEFAULT: u32 = 0; +pub const FT_RASTER_FLAG_AA: u32 = 1; +pub const FT_RASTER_FLAG_DIRECT: u32 = 2; +pub const FT_RASTER_FLAG_CLIP: u32 = 4; +pub const FT_ERR_BASE: u32 = 0; +pub const FT_FACE_FLAG_SCALABLE: u32 = 1; +pub const FT_FACE_FLAG_FIXED_SIZES: u32 = 2; +pub const FT_FACE_FLAG_FIXED_WIDTH: u32 = 4; +pub const FT_FACE_FLAG_SFNT: u32 = 8; +pub const FT_FACE_FLAG_HORIZONTAL: u32 = 16; +pub const FT_FACE_FLAG_VERTICAL: u32 = 32; +pub const FT_FACE_FLAG_KERNING: u32 = 64; +pub const FT_FACE_FLAG_FAST_GLYPHS: u32 = 128; +pub const FT_FACE_FLAG_MULTIPLE_MASTERS: u32 = 256; +pub const FT_FACE_FLAG_GLYPH_NAMES: u32 = 512; +pub const FT_FACE_FLAG_EXTERNAL_STREAM: u32 = 1024; +pub const FT_FACE_FLAG_HINTER: u32 = 2048; +pub const FT_FACE_FLAG_CID_KEYED: u32 = 4096; +pub const FT_FACE_FLAG_TRICKY: u32 = 8192; +pub const FT_FACE_FLAG_COLOR: u32 = 16384; +pub const FT_FACE_FLAG_VARIATION: u32 = 32768; +pub const FT_STYLE_FLAG_ITALIC: u32 = 1; +pub const FT_STYLE_FLAG_BOLD: u32 = 2; +pub const FT_OPEN_MEMORY: u32 = 1; +pub const FT_OPEN_STREAM: u32 = 2; +pub const FT_OPEN_PATHNAME: u32 = 4; +pub const FT_OPEN_DRIVER: u32 = 8; +pub const FT_OPEN_PARAMS: u32 = 16; +pub const FT_LOAD_DEFAULT: u32 = 0; +pub const FT_LOAD_NO_SCALE: u32 = 1; +pub const FT_LOAD_NO_HINTING: u32 = 2; +pub const FT_LOAD_RENDER: u32 = 4; +pub const FT_LOAD_NO_BITMAP: u32 = 8; +pub const FT_LOAD_VERTICAL_LAYOUT: u32 = 16; +pub const FT_LOAD_FORCE_AUTOHINT: u32 = 32; +pub const FT_LOAD_CROP_BITMAP: u32 = 64; +pub const FT_LOAD_PEDANTIC: u32 = 128; +pub const FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH: u32 = 512; +pub const FT_LOAD_NO_RECURSE: u32 = 1024; +pub const FT_LOAD_IGNORE_TRANSFORM: u32 = 2048; +pub const FT_LOAD_MONOCHROME: u32 = 4096; +pub const FT_LOAD_LINEAR_DESIGN: u32 = 8192; +pub const FT_LOAD_NO_AUTOHINT: u32 = 32768; +pub const FT_LOAD_COLOR: u32 = 1048576; +pub const FT_LOAD_COMPUTE_METRICS: u32 = 2097152; +pub const FT_LOAD_BITMAP_METRICS_ONLY: u32 = 4194304; +pub const FT_LOAD_ADVANCE_ONLY: u32 = 256; +pub const FT_LOAD_SBITS_ONLY: u32 = 16384; +pub const FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS: u32 = 1; +pub const FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES: u32 = 2; +pub const FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID: u32 = 4; +pub const FT_SUBGLYPH_FLAG_SCALE: u32 = 8; +pub const FT_SUBGLYPH_FLAG_XY_SCALE: u32 = 64; +pub const FT_SUBGLYPH_FLAG_2X2: u32 = 128; +pub const FT_SUBGLYPH_FLAG_USE_MY_METRICS: u32 = 512; +pub const FT_FSTYPE_INSTALLABLE_EMBEDDING: u32 = 0; +pub const FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING: u32 = 2; +pub const FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING: u32 = 4; +pub const FT_FSTYPE_EDITABLE_EMBEDDING: u32 = 8; +pub const FT_FSTYPE_NO_SUBSETTING: u32 = 256; +pub const FT_FSTYPE_BITMAP_EMBEDDING_ONLY: u32 = 512; +pub const FT_LCD_FILTER_FIVE_TAPS: u32 = 5; +pub const FT_MODULE_FONT_DRIVER: u32 = 1; +pub const FT_MODULE_RENDERER: u32 = 2; +pub const FT_MODULE_HINTER: u32 = 4; +pub const FT_MODULE_STYLER: u32 = 8; +pub const FT_MODULE_DRIVER_SCALABLE: u32 = 256; +pub const FT_MODULE_DRIVER_NO_OUTLINES: u32 = 512; +pub const FT_MODULE_DRIVER_HAS_HINTER: u32 = 1024; +pub const FT_MODULE_DRIVER_HINTS_LIGHTLY: u32 = 2048; +pub const FT_DEBUG_HOOK_TRUETYPE: u32 = 0; +pub type FT_Fast = ::std::os::raw::c_int; +pub type FT_UFast = ::std::os::raw::c_uint; +pub type FT_Memory = *mut FT_MemoryRec_; +pub type FT_Alloc_Func = ::std::option::Option< + unsafe extern "C" fn( + memory: FT_Memory, + size: ::std::os::raw::c_long, + ) -> *mut ::std::os::raw::c_void, +>; +pub type FT_Free_Func = ::std::option::Option< + unsafe extern "C" fn(memory: FT_Memory, block: *mut ::std::os::raw::c_void), +>; +pub type FT_Realloc_Func = ::std::option::Option< + unsafe extern "C" fn( + memory: FT_Memory, + cur_size: ::std::os::raw::c_long, + new_size: ::std::os::raw::c_long, + block: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_MemoryRec_ { + pub user: *mut ::std::os::raw::c_void, + pub alloc: FT_Alloc_Func, + pub free: FT_Free_Func, + pub realloc: FT_Realloc_Func, +} +#[test] +fn bindgen_test_layout_FT_MemoryRec_() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(FT_MemoryRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_MemoryRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).user as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_MemoryRec_), + "::", + stringify!(user) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).alloc as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_MemoryRec_), + "::", + stringify!(alloc) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).free as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_MemoryRec_), + "::", + stringify!(free) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).realloc as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_MemoryRec_), + "::", + stringify!(realloc) + ) + ); +} +pub type FT_Stream = *mut FT_StreamRec_; +#[repr(C)] +#[derive(Copy, Clone)] +pub union FT_StreamDesc_ { + pub value: ::std::os::raw::c_long, + pub pointer: *mut ::std::os::raw::c_void, + _bindgen_union_align: u64, +} +#[test] +fn bindgen_test_layout_FT_StreamDesc_() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(FT_StreamDesc_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_StreamDesc_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamDesc_), + "::", + stringify!(value) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pointer as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamDesc_), + "::", + stringify!(pointer) + ) + ); +} +pub type FT_StreamDesc = FT_StreamDesc_; +pub type FT_Stream_IoFunc = ::std::option::Option< + unsafe extern "C" fn( + stream: FT_Stream, + offset: ::std::os::raw::c_ulong, + buffer: *mut ::std::os::raw::c_uchar, + count: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_ulong, +>; +pub type FT_Stream_CloseFunc = ::std::option::Option; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct FT_StreamRec_ { + pub base: *mut ::std::os::raw::c_uchar, + pub size: ::std::os::raw::c_ulong, + pub pos: ::std::os::raw::c_ulong, + pub descriptor: FT_StreamDesc, + pub pathname: FT_StreamDesc, + pub read: FT_Stream_IoFunc, + pub close: FT_Stream_CloseFunc, + pub memory: FT_Memory, + pub cursor: *mut ::std::os::raw::c_uchar, + pub limit: *mut ::std::os::raw::c_uchar, +} +#[test] +fn bindgen_test_layout_FT_StreamRec_() { + assert_eq!( + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(FT_StreamRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_StreamRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).base as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(base) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pos as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(pos) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).descriptor as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(descriptor) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pathname as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(pathname) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).read as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(read) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).close as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(close) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).memory as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(memory) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cursor as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(cursor) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).limit as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(limit) + ) + ); +} +pub type FT_StreamRec = FT_StreamRec_; +pub type FT_Pos = ::std::os::raw::c_long; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Vector_ { + pub x: FT_Pos, + pub y: FT_Pos, +} +#[test] +fn bindgen_test_layout_FT_Vector_() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(FT_Vector_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Vector_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Vector_), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Vector_), + "::", + stringify!(y) + ) + ); +} +pub type FT_Vector = FT_Vector_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_BBox_ { + pub xMin: FT_Pos, + pub yMin: FT_Pos, + pub xMax: FT_Pos, + pub yMax: FT_Pos, +} +#[test] +fn bindgen_test_layout_FT_BBox_() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(FT_BBox_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_BBox_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).xMin as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_BBox_), + "::", + stringify!(xMin) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).yMin as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_BBox_), + "::", + stringify!(yMin) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).xMax as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_BBox_), + "::", + stringify!(xMax) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).yMax as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_BBox_), + "::", + stringify!(yMax) + ) + ); +} +pub type FT_BBox = FT_BBox_; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum FT_Pixel_Mode_ { + FT_PIXEL_MODE_NONE = 0, + FT_PIXEL_MODE_MONO = 1, + FT_PIXEL_MODE_GRAY = 2, + FT_PIXEL_MODE_GRAY2 = 3, + FT_PIXEL_MODE_GRAY4 = 4, + FT_PIXEL_MODE_LCD = 5, + FT_PIXEL_MODE_LCD_V = 6, + FT_PIXEL_MODE_BGRA = 7, + FT_PIXEL_MODE_MAX = 8, +} +pub use self::FT_Pixel_Mode_ as FT_Pixel_Mode; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Bitmap_ { + pub rows: ::std::os::raw::c_uint, + pub width: ::std::os::raw::c_uint, + pub pitch: ::std::os::raw::c_int, + pub buffer: *mut ::std::os::raw::c_uchar, + pub num_grays: ::std::os::raw::c_ushort, + pub pixel_mode: ::std::os::raw::c_uchar, + pub palette_mode: ::std::os::raw::c_uchar, + pub palette: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_FT_Bitmap_() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(FT_Bitmap_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Bitmap_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rows as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_), + "::", + stringify!(rows) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pitch as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_), + "::", + stringify!(pitch) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buffer as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_), + "::", + stringify!(buffer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).num_grays as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_), + "::", + stringify!(num_grays) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pixel_mode as *const _ as usize }, + 26usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_), + "::", + stringify!(pixel_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).palette_mode as *const _ as usize }, + 27usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_), + "::", + stringify!(palette_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).palette as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_), + "::", + stringify!(palette) + ) + ); +} +pub type FT_Bitmap = FT_Bitmap_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Outline_ { + pub n_contours: ::std::os::raw::c_short, + pub n_points: ::std::os::raw::c_short, + pub points: *mut FT_Vector, + pub tags: *mut ::std::os::raw::c_char, + pub contours: *mut ::std::os::raw::c_short, + pub flags: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_FT_Outline_() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(FT_Outline_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Outline_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).n_contours as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_), + "::", + stringify!(n_contours) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).n_points as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_), + "::", + stringify!(n_points) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).points as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_), + "::", + stringify!(points) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tags as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_), + "::", + stringify!(tags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).contours as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_), + "::", + stringify!(contours) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_), + "::", + stringify!(flags) + ) + ); +} +pub type FT_Outline = FT_Outline_; +pub type FT_Outline_MoveToFunc = ::std::option::Option< + unsafe extern "C" fn( + to: *const FT_Vector, + user: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, +>; +pub type FT_Outline_LineToFunc = ::std::option::Option< + unsafe extern "C" fn( + to: *const FT_Vector, + user: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, +>; +pub type FT_Outline_ConicToFunc = ::std::option::Option< + unsafe extern "C" fn( + control: *const FT_Vector, + to: *const FT_Vector, + user: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, +>; +pub type FT_Outline_CubicToFunc = ::std::option::Option< + unsafe extern "C" fn( + control1: *const FT_Vector, + control2: *const FT_Vector, + to: *const FT_Vector, + user: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Outline_Funcs_ { + pub move_to: FT_Outline_MoveToFunc, + pub line_to: FT_Outline_LineToFunc, + pub conic_to: FT_Outline_ConicToFunc, + pub cubic_to: FT_Outline_CubicToFunc, + pub shift: ::std::os::raw::c_int, + pub delta: FT_Pos, +} +#[test] +fn bindgen_test_layout_FT_Outline_Funcs_() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(FT_Outline_Funcs_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Outline_Funcs_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).move_to as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_Funcs_), + "::", + stringify!(move_to) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).line_to as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_Funcs_), + "::", + stringify!(line_to) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).conic_to as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_Funcs_), + "::", + stringify!(conic_to) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cubic_to as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_Funcs_), + "::", + stringify!(cubic_to) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).shift as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_Funcs_), + "::", + stringify!(shift) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).delta as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_Funcs_), + "::", + stringify!(delta) + ) + ); +} +pub type FT_Outline_Funcs = FT_Outline_Funcs_; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum FT_Glyph_Format_ { + FT_GLYPH_FORMAT_NONE = 0, + FT_GLYPH_FORMAT_COMPOSITE = 1668246896, + FT_GLYPH_FORMAT_BITMAP = 1651078259, + FT_GLYPH_FORMAT_OUTLINE = 1869968492, + FT_GLYPH_FORMAT_PLOTTER = 1886154612, +} +pub use self::FT_Glyph_Format_ as FT_Glyph_Format; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_RasterRec_ { + _unused: [u8; 0], +} +pub type FT_Raster = *mut FT_RasterRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Span_ { + pub x: ::std::os::raw::c_short, + pub len: ::std::os::raw::c_ushort, + pub coverage: ::std::os::raw::c_uchar, +} +#[test] +fn bindgen_test_layout_FT_Span_() { + assert_eq!( + ::std::mem::size_of::(), + 6usize, + concat!("Size of: ", stringify!(FT_Span_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(FT_Span_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Span_), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).len as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(FT_Span_), + "::", + stringify!(len) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).coverage as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(FT_Span_), + "::", + stringify!(coverage) + ) + ); +} +pub type FT_Span = FT_Span_; +pub type FT_SpanFunc = ::std::option::Option< + unsafe extern "C" fn( + y: ::std::os::raw::c_int, + count: ::std::os::raw::c_int, + spans: *const FT_Span, + user: *mut ::std::os::raw::c_void, + ), +>; +pub type FT_Raster_BitTest_Func = ::std::option::Option< + unsafe extern "C" fn( + y: ::std::os::raw::c_int, + x: ::std::os::raw::c_int, + user: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, +>; +pub type FT_Raster_BitSet_Func = ::std::option::Option< + unsafe extern "C" fn( + y: ::std::os::raw::c_int, + x: ::std::os::raw::c_int, + user: *mut ::std::os::raw::c_void, + ), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Raster_Params_ { + pub target: *const FT_Bitmap, + pub source: *const ::std::os::raw::c_void, + pub flags: ::std::os::raw::c_int, + pub gray_spans: FT_SpanFunc, + pub black_spans: FT_SpanFunc, + pub bit_test: FT_Raster_BitTest_Func, + pub bit_set: FT_Raster_BitSet_Func, + pub user: *mut ::std::os::raw::c_void, + pub clip_box: FT_BBox, +} +#[test] +fn bindgen_test_layout_FT_Raster_Params_() { + assert_eq!( + ::std::mem::size_of::(), + 96usize, + concat!("Size of: ", stringify!(FT_Raster_Params_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Raster_Params_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).target as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Raster_Params_), + "::", + stringify!(target) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).source as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Raster_Params_), + "::", + stringify!(source) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Raster_Params_), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).gray_spans as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Raster_Params_), + "::", + stringify!(gray_spans) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).black_spans as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_Raster_Params_), + "::", + stringify!(black_spans) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bit_test as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(FT_Raster_Params_), + "::", + stringify!(bit_test) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bit_set as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(FT_Raster_Params_), + "::", + stringify!(bit_set) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).user as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(FT_Raster_Params_), + "::", + stringify!(user) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).clip_box as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(FT_Raster_Params_), + "::", + stringify!(clip_box) + ) + ); +} +pub type FT_Raster_Params = FT_Raster_Params_; +pub type FT_Raster_NewFunc = ::std::option::Option< + unsafe extern "C" fn( + memory: *mut ::std::os::raw::c_void, + raster: *mut FT_Raster, + ) -> ::std::os::raw::c_int, +>; +pub type FT_Raster_DoneFunc = ::std::option::Option; +pub type FT_Raster_ResetFunc = ::std::option::Option< + unsafe extern "C" fn( + raster: FT_Raster, + pool_base: *mut ::std::os::raw::c_uchar, + pool_size: ::std::os::raw::c_ulong, + ), +>; +pub type FT_Raster_SetModeFunc = ::std::option::Option< + unsafe extern "C" fn( + raster: FT_Raster, + mode: ::std::os::raw::c_ulong, + args: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, +>; +pub type FT_Raster_RenderFunc = ::std::option::Option< + unsafe extern "C" fn( + raster: FT_Raster, + params: *const FT_Raster_Params, + ) -> ::std::os::raw::c_int, +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Raster_Funcs_ { + pub glyph_format: FT_Glyph_Format, + pub raster_new: FT_Raster_NewFunc, + pub raster_reset: FT_Raster_ResetFunc, + pub raster_set_mode: FT_Raster_SetModeFunc, + pub raster_render: FT_Raster_RenderFunc, + pub raster_done: FT_Raster_DoneFunc, +} +#[test] +fn bindgen_test_layout_FT_Raster_Funcs_() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(FT_Raster_Funcs_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Raster_Funcs_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).glyph_format as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Raster_Funcs_), + "::", + stringify!(glyph_format) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).raster_new as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Raster_Funcs_), + "::", + stringify!(raster_new) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).raster_reset as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Raster_Funcs_), + "::", + stringify!(raster_reset) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).raster_set_mode as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Raster_Funcs_), + "::", + stringify!(raster_set_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).raster_render as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_Raster_Funcs_), + "::", + stringify!(raster_render) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).raster_done as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(FT_Raster_Funcs_), + "::", + stringify!(raster_done) + ) + ); +} +pub type FT_Raster_Funcs = FT_Raster_Funcs_; +pub type FT_Bool = ::std::os::raw::c_uchar; +pub type FT_FWord = ::std::os::raw::c_short; +pub type FT_UFWord = ::std::os::raw::c_ushort; +pub type FT_Char = ::std::os::raw::c_schar; +pub type FT_Byte = ::std::os::raw::c_uchar; +pub type FT_Bytes = *const FT_Byte; +pub type FT_Tag = FT_UInt32; +pub type FT_String = ::std::os::raw::c_char; +pub type FT_Short = ::std::os::raw::c_short; +pub type FT_UShort = ::std::os::raw::c_ushort; +pub type FT_Int = ::std::os::raw::c_int; +pub type FT_UInt = ::std::os::raw::c_uint; +pub type FT_Long = ::std::os::raw::c_long; +pub type FT_ULong = ::std::os::raw::c_ulong; +pub type FT_F2Dot14 = ::std::os::raw::c_short; +pub type FT_F26Dot6 = ::std::os::raw::c_long; +pub type FT_Fixed = ::std::os::raw::c_long; +pub type FT_Error = ::std::os::raw::c_int; +pub type FT_Pointer = *mut ::std::os::raw::c_void; +pub type FT_Offset = usize; +pub type FT_PtrDist = isize; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_UnitVector_ { + pub x: FT_F2Dot14, + pub y: FT_F2Dot14, +} +#[test] +fn bindgen_test_layout_FT_UnitVector_() { + assert_eq!( + ::std::mem::size_of::(), + 4usize, + concat!("Size of: ", stringify!(FT_UnitVector_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(FT_UnitVector_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_UnitVector_), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(FT_UnitVector_), + "::", + stringify!(y) + ) + ); +} +pub type FT_UnitVector = FT_UnitVector_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Matrix_ { + pub xx: FT_Fixed, + pub xy: FT_Fixed, + pub yx: FT_Fixed, + pub yy: FT_Fixed, +} +#[test] +fn bindgen_test_layout_FT_Matrix_() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(FT_Matrix_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Matrix_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).xx as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Matrix_), + "::", + stringify!(xx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).xy as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Matrix_), + "::", + stringify!(xy) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).yx as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Matrix_), + "::", + stringify!(yx) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).yy as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Matrix_), + "::", + stringify!(yy) + ) + ); +} +pub type FT_Matrix = FT_Matrix_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Data_ { + pub pointer: *const FT_Byte, + pub length: FT_Int, +} +#[test] +fn bindgen_test_layout_FT_Data_() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(FT_Data_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Data_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pointer as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Data_), + "::", + stringify!(pointer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).length as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Data_), + "::", + stringify!(length) + ) + ); +} +pub type FT_Data = FT_Data_; +pub type FT_Generic_Finalizer = + ::std::option::Option; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Generic_ { + pub data: *mut ::std::os::raw::c_void, + pub finalizer: FT_Generic_Finalizer, +} +#[test] +fn bindgen_test_layout_FT_Generic_() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(FT_Generic_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Generic_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Generic_), + "::", + stringify!(data) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).finalizer as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Generic_), + "::", + stringify!(finalizer) + ) + ); +} +pub type FT_Generic = FT_Generic_; +pub type FT_ListNode = *mut FT_ListNodeRec_; +pub type FT_List = *mut FT_ListRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_ListNodeRec_ { + pub prev: FT_ListNode, + pub next: FT_ListNode, + pub data: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_FT_ListNodeRec_() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(FT_ListNodeRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_ListNodeRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).prev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_ListNodeRec_), + "::", + stringify!(prev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_ListNodeRec_), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_ListNodeRec_), + "::", + stringify!(data) + ) + ); +} +pub type FT_ListNodeRec = FT_ListNodeRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_ListRec_ { + pub head: FT_ListNode, + pub tail: FT_ListNode, +} +#[test] +fn bindgen_test_layout_FT_ListRec_() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(FT_ListRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_ListRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).head as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_ListRec_), + "::", + stringify!(head) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tail as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_ListRec_), + "::", + stringify!(tail) + ) + ); +} +pub type FT_ListRec = FT_ListRec_; +pub const FT_Mod_Err_Base: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_Autofit: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_BDF: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_Bzip2: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_Cache: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_CFF: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_CID: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_Gzip: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_LZW: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_OTvalid: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_PCF: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_PFR: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_PSaux: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_PShinter: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_PSnames: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_Raster: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_SFNT: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_Smooth: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_TrueType: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_Type1: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_Type42: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_Winfonts: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_GXvalid: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Base; +pub const FT_Mod_Err_Max: _bindgen_ty_1 = _bindgen_ty_1::FT_Mod_Err_Max; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_1 { + FT_Mod_Err_Base = 0, + FT_Mod_Err_Max = 1, +} +pub const FT_Err_Ok: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Ok; +pub const FT_Err_Cannot_Open_Resource: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Cannot_Open_Resource; +pub const FT_Err_Unknown_File_Format: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Unknown_File_Format; +pub const FT_Err_Invalid_File_Format: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_File_Format; +pub const FT_Err_Invalid_Version: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Version; +pub const FT_Err_Lower_Module_Version: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Lower_Module_Version; +pub const FT_Err_Invalid_Argument: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Argument; +pub const FT_Err_Unimplemented_Feature: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Unimplemented_Feature; +pub const FT_Err_Invalid_Table: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Table; +pub const FT_Err_Invalid_Offset: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Offset; +pub const FT_Err_Array_Too_Large: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Array_Too_Large; +pub const FT_Err_Missing_Module: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Missing_Module; +pub const FT_Err_Missing_Property: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Missing_Property; +pub const FT_Err_Invalid_Glyph_Index: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Glyph_Index; +pub const FT_Err_Invalid_Character_Code: _bindgen_ty_2 = + _bindgen_ty_2::FT_Err_Invalid_Character_Code; +pub const FT_Err_Invalid_Glyph_Format: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Glyph_Format; +pub const FT_Err_Cannot_Render_Glyph: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Cannot_Render_Glyph; +pub const FT_Err_Invalid_Outline: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Outline; +pub const FT_Err_Invalid_Composite: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Composite; +pub const FT_Err_Too_Many_Hints: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Too_Many_Hints; +pub const FT_Err_Invalid_Pixel_Size: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Pixel_Size; +pub const FT_Err_Invalid_Handle: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Handle; +pub const FT_Err_Invalid_Library_Handle: _bindgen_ty_2 = + _bindgen_ty_2::FT_Err_Invalid_Library_Handle; +pub const FT_Err_Invalid_Driver_Handle: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Driver_Handle; +pub const FT_Err_Invalid_Face_Handle: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Face_Handle; +pub const FT_Err_Invalid_Size_Handle: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Size_Handle; +pub const FT_Err_Invalid_Slot_Handle: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Slot_Handle; +pub const FT_Err_Invalid_CharMap_Handle: _bindgen_ty_2 = + _bindgen_ty_2::FT_Err_Invalid_CharMap_Handle; +pub const FT_Err_Invalid_Cache_Handle: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Cache_Handle; +pub const FT_Err_Invalid_Stream_Handle: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Stream_Handle; +pub const FT_Err_Too_Many_Drivers: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Too_Many_Drivers; +pub const FT_Err_Too_Many_Extensions: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Too_Many_Extensions; +pub const FT_Err_Out_Of_Memory: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Out_Of_Memory; +pub const FT_Err_Unlisted_Object: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Unlisted_Object; +pub const FT_Err_Cannot_Open_Stream: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Cannot_Open_Stream; +pub const FT_Err_Invalid_Stream_Seek: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Stream_Seek; +pub const FT_Err_Invalid_Stream_Skip: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Stream_Skip; +pub const FT_Err_Invalid_Stream_Read: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Stream_Read; +pub const FT_Err_Invalid_Stream_Operation: _bindgen_ty_2 = + _bindgen_ty_2::FT_Err_Invalid_Stream_Operation; +pub const FT_Err_Invalid_Frame_Operation: _bindgen_ty_2 = + _bindgen_ty_2::FT_Err_Invalid_Frame_Operation; +pub const FT_Err_Nested_Frame_Access: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Nested_Frame_Access; +pub const FT_Err_Invalid_Frame_Read: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Frame_Read; +pub const FT_Err_Raster_Uninitialized: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Raster_Uninitialized; +pub const FT_Err_Raster_Corrupted: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Raster_Corrupted; +pub const FT_Err_Raster_Overflow: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Raster_Overflow; +pub const FT_Err_Raster_Negative_Height: _bindgen_ty_2 = + _bindgen_ty_2::FT_Err_Raster_Negative_Height; +pub const FT_Err_Too_Many_Caches: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Too_Many_Caches; +pub const FT_Err_Invalid_Opcode: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Opcode; +pub const FT_Err_Too_Few_Arguments: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Too_Few_Arguments; +pub const FT_Err_Stack_Overflow: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Stack_Overflow; +pub const FT_Err_Code_Overflow: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Code_Overflow; +pub const FT_Err_Bad_Argument: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Bad_Argument; +pub const FT_Err_Divide_By_Zero: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Divide_By_Zero; +pub const FT_Err_Invalid_Reference: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Reference; +pub const FT_Err_Debug_OpCode: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Debug_OpCode; +pub const FT_Err_ENDF_In_Exec_Stream: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_ENDF_In_Exec_Stream; +pub const FT_Err_Nested_DEFS: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Nested_DEFS; +pub const FT_Err_Invalid_CodeRange: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_CodeRange; +pub const FT_Err_Execution_Too_Long: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Execution_Too_Long; +pub const FT_Err_Too_Many_Function_Defs: _bindgen_ty_2 = + _bindgen_ty_2::FT_Err_Too_Many_Function_Defs; +pub const FT_Err_Too_Many_Instruction_Defs: _bindgen_ty_2 = + _bindgen_ty_2::FT_Err_Too_Many_Instruction_Defs; +pub const FT_Err_Table_Missing: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Table_Missing; +pub const FT_Err_Horiz_Header_Missing: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Horiz_Header_Missing; +pub const FT_Err_Locations_Missing: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Locations_Missing; +pub const FT_Err_Name_Table_Missing: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Name_Table_Missing; +pub const FT_Err_CMap_Table_Missing: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_CMap_Table_Missing; +pub const FT_Err_Hmtx_Table_Missing: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Hmtx_Table_Missing; +pub const FT_Err_Post_Table_Missing: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Post_Table_Missing; +pub const FT_Err_Invalid_Horiz_Metrics: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Horiz_Metrics; +pub const FT_Err_Invalid_CharMap_Format: _bindgen_ty_2 = + _bindgen_ty_2::FT_Err_Invalid_CharMap_Format; +pub const FT_Err_Invalid_PPem: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_PPem; +pub const FT_Err_Invalid_Vert_Metrics: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Vert_Metrics; +pub const FT_Err_Could_Not_Find_Context: _bindgen_ty_2 = + _bindgen_ty_2::FT_Err_Could_Not_Find_Context; +pub const FT_Err_Invalid_Post_Table_Format: _bindgen_ty_2 = + _bindgen_ty_2::FT_Err_Invalid_Post_Table_Format; +pub const FT_Err_Invalid_Post_Table: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Invalid_Post_Table; +pub const FT_Err_DEF_In_Glyf_Bytecode: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_DEF_In_Glyf_Bytecode; +pub const FT_Err_Missing_Bitmap: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Missing_Bitmap; +pub const FT_Err_Syntax_Error: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Syntax_Error; +pub const FT_Err_Stack_Underflow: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Stack_Underflow; +pub const FT_Err_Ignore: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Ignore; +pub const FT_Err_No_Unicode_Glyph_Name: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_No_Unicode_Glyph_Name; +pub const FT_Err_Glyph_Too_Big: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Glyph_Too_Big; +pub const FT_Err_Missing_Startfont_Field: _bindgen_ty_2 = + _bindgen_ty_2::FT_Err_Missing_Startfont_Field; +pub const FT_Err_Missing_Font_Field: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Missing_Font_Field; +pub const FT_Err_Missing_Size_Field: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Missing_Size_Field; +pub const FT_Err_Missing_Fontboundingbox_Field: _bindgen_ty_2 = + _bindgen_ty_2::FT_Err_Missing_Fontboundingbox_Field; +pub const FT_Err_Missing_Chars_Field: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Missing_Chars_Field; +pub const FT_Err_Missing_Startchar_Field: _bindgen_ty_2 = + _bindgen_ty_2::FT_Err_Missing_Startchar_Field; +pub const FT_Err_Missing_Encoding_Field: _bindgen_ty_2 = + _bindgen_ty_2::FT_Err_Missing_Encoding_Field; +pub const FT_Err_Missing_Bbx_Field: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Missing_Bbx_Field; +pub const FT_Err_Bbx_Too_Big: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Bbx_Too_Big; +pub const FT_Err_Corrupted_Font_Header: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Corrupted_Font_Header; +pub const FT_Err_Corrupted_Font_Glyphs: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Corrupted_Font_Glyphs; +pub const FT_Err_Max: _bindgen_ty_2 = _bindgen_ty_2::FT_Err_Max; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum _bindgen_ty_2 { + FT_Err_Ok = 0, + FT_Err_Cannot_Open_Resource = 1, + FT_Err_Unknown_File_Format = 2, + FT_Err_Invalid_File_Format = 3, + FT_Err_Invalid_Version = 4, + FT_Err_Lower_Module_Version = 5, + FT_Err_Invalid_Argument = 6, + FT_Err_Unimplemented_Feature = 7, + FT_Err_Invalid_Table = 8, + FT_Err_Invalid_Offset = 9, + FT_Err_Array_Too_Large = 10, + FT_Err_Missing_Module = 11, + FT_Err_Missing_Property = 12, + FT_Err_Invalid_Glyph_Index = 16, + FT_Err_Invalid_Character_Code = 17, + FT_Err_Invalid_Glyph_Format = 18, + FT_Err_Cannot_Render_Glyph = 19, + FT_Err_Invalid_Outline = 20, + FT_Err_Invalid_Composite = 21, + FT_Err_Too_Many_Hints = 22, + FT_Err_Invalid_Pixel_Size = 23, + FT_Err_Invalid_Handle = 32, + FT_Err_Invalid_Library_Handle = 33, + FT_Err_Invalid_Driver_Handle = 34, + FT_Err_Invalid_Face_Handle = 35, + FT_Err_Invalid_Size_Handle = 36, + FT_Err_Invalid_Slot_Handle = 37, + FT_Err_Invalid_CharMap_Handle = 38, + FT_Err_Invalid_Cache_Handle = 39, + FT_Err_Invalid_Stream_Handle = 40, + FT_Err_Too_Many_Drivers = 48, + FT_Err_Too_Many_Extensions = 49, + FT_Err_Out_Of_Memory = 64, + FT_Err_Unlisted_Object = 65, + FT_Err_Cannot_Open_Stream = 81, + FT_Err_Invalid_Stream_Seek = 82, + FT_Err_Invalid_Stream_Skip = 83, + FT_Err_Invalid_Stream_Read = 84, + FT_Err_Invalid_Stream_Operation = 85, + FT_Err_Invalid_Frame_Operation = 86, + FT_Err_Nested_Frame_Access = 87, + FT_Err_Invalid_Frame_Read = 88, + FT_Err_Raster_Uninitialized = 96, + FT_Err_Raster_Corrupted = 97, + FT_Err_Raster_Overflow = 98, + FT_Err_Raster_Negative_Height = 99, + FT_Err_Too_Many_Caches = 112, + FT_Err_Invalid_Opcode = 128, + FT_Err_Too_Few_Arguments = 129, + FT_Err_Stack_Overflow = 130, + FT_Err_Code_Overflow = 131, + FT_Err_Bad_Argument = 132, + FT_Err_Divide_By_Zero = 133, + FT_Err_Invalid_Reference = 134, + FT_Err_Debug_OpCode = 135, + FT_Err_ENDF_In_Exec_Stream = 136, + FT_Err_Nested_DEFS = 137, + FT_Err_Invalid_CodeRange = 138, + FT_Err_Execution_Too_Long = 139, + FT_Err_Too_Many_Function_Defs = 140, + FT_Err_Too_Many_Instruction_Defs = 141, + FT_Err_Table_Missing = 142, + FT_Err_Horiz_Header_Missing = 143, + FT_Err_Locations_Missing = 144, + FT_Err_Name_Table_Missing = 145, + FT_Err_CMap_Table_Missing = 146, + FT_Err_Hmtx_Table_Missing = 147, + FT_Err_Post_Table_Missing = 148, + FT_Err_Invalid_Horiz_Metrics = 149, + FT_Err_Invalid_CharMap_Format = 150, + FT_Err_Invalid_PPem = 151, + FT_Err_Invalid_Vert_Metrics = 152, + FT_Err_Could_Not_Find_Context = 153, + FT_Err_Invalid_Post_Table_Format = 154, + FT_Err_Invalid_Post_Table = 155, + FT_Err_DEF_In_Glyf_Bytecode = 156, + FT_Err_Missing_Bitmap = 157, + FT_Err_Syntax_Error = 160, + FT_Err_Stack_Underflow = 161, + FT_Err_Ignore = 162, + FT_Err_No_Unicode_Glyph_Name = 163, + FT_Err_Glyph_Too_Big = 164, + FT_Err_Missing_Startfont_Field = 176, + FT_Err_Missing_Font_Field = 177, + FT_Err_Missing_Size_Field = 178, + FT_Err_Missing_Fontboundingbox_Field = 179, + FT_Err_Missing_Chars_Field = 180, + FT_Err_Missing_Startchar_Field = 181, + FT_Err_Missing_Encoding_Field = 182, + FT_Err_Missing_Bbx_Field = 183, + FT_Err_Bbx_Too_Big = 184, + FT_Err_Corrupted_Font_Header = 185, + FT_Err_Corrupted_Font_Glyphs = 186, + FT_Err_Max = 187, +} +extern "C" { + #[link_name = "\u{1}_FT_Error_String"] + pub fn FT_Error_String(error_code: FT_Error) -> *const ::std::os::raw::c_char; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Glyph_Metrics_ { + pub width: FT_Pos, + pub height: FT_Pos, + pub horiBearingX: FT_Pos, + pub horiBearingY: FT_Pos, + pub horiAdvance: FT_Pos, + pub vertBearingX: FT_Pos, + pub vertBearingY: FT_Pos, + pub vertAdvance: FT_Pos, +} +#[test] +fn bindgen_test_layout_FT_Glyph_Metrics_() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(FT_Glyph_Metrics_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Glyph_Metrics_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Glyph_Metrics_), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Glyph_Metrics_), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).horiBearingX as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Glyph_Metrics_), + "::", + stringify!(horiBearingX) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).horiBearingY as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Glyph_Metrics_), + "::", + stringify!(horiBearingY) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).horiAdvance as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_Glyph_Metrics_), + "::", + stringify!(horiAdvance) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vertBearingX as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(FT_Glyph_Metrics_), + "::", + stringify!(vertBearingX) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vertBearingY as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(FT_Glyph_Metrics_), + "::", + stringify!(vertBearingY) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vertAdvance as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(FT_Glyph_Metrics_), + "::", + stringify!(vertAdvance) + ) + ); +} +pub type FT_Glyph_Metrics = FT_Glyph_Metrics_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Bitmap_Size_ { + pub height: FT_Short, + pub width: FT_Short, + pub size: FT_Pos, + pub x_ppem: FT_Pos, + pub y_ppem: FT_Pos, +} +#[test] +fn bindgen_test_layout_FT_Bitmap_Size_() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(FT_Bitmap_Size_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Bitmap_Size_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_Size_), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_Size_), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_Size_), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x_ppem as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_Size_), + "::", + stringify!(x_ppem) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y_ppem as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_Size_), + "::", + stringify!(y_ppem) + ) + ); +} +pub type FT_Bitmap_Size = FT_Bitmap_Size_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_LibraryRec_ { + _unused: [u8; 0], +} +pub type FT_Library = *mut FT_LibraryRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_ModuleRec_ { + _unused: [u8; 0], +} +pub type FT_Module = *mut FT_ModuleRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_DriverRec_ { + _unused: [u8; 0], +} +pub type FT_Driver = *mut FT_DriverRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_RendererRec_ { + _unused: [u8; 0], +} +pub type FT_Renderer = *mut FT_RendererRec_; +pub type FT_Face = *mut FT_FaceRec_; +pub type FT_Size = *mut FT_SizeRec_; +pub type FT_GlyphSlot = *mut FT_GlyphSlotRec_; +pub type FT_CharMap = *mut FT_CharMapRec_; +impl FT_Encoding_ { + pub const FT_ENCODING_GB2312: FT_Encoding_ = FT_Encoding_::FT_ENCODING_PRC; +} +impl FT_Encoding_ { + pub const FT_ENCODING_MS_SJIS: FT_Encoding_ = FT_Encoding_::FT_ENCODING_SJIS; +} +impl FT_Encoding_ { + pub const FT_ENCODING_MS_GB2312: FT_Encoding_ = FT_Encoding_::FT_ENCODING_PRC; +} +impl FT_Encoding_ { + pub const FT_ENCODING_MS_BIG5: FT_Encoding_ = FT_Encoding_::FT_ENCODING_BIG5; +} +impl FT_Encoding_ { + pub const FT_ENCODING_MS_WANSUNG: FT_Encoding_ = FT_Encoding_::FT_ENCODING_WANSUNG; +} +impl FT_Encoding_ { + pub const FT_ENCODING_MS_JOHAB: FT_Encoding_ = FT_Encoding_::FT_ENCODING_JOHAB; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum FT_Encoding_ { + FT_ENCODING_NONE = 0, + FT_ENCODING_MS_SYMBOL = 1937337698, + FT_ENCODING_UNICODE = 1970170211, + FT_ENCODING_SJIS = 1936353651, + FT_ENCODING_PRC = 1734484000, + FT_ENCODING_BIG5 = 1651074869, + FT_ENCODING_WANSUNG = 2002873971, + FT_ENCODING_JOHAB = 1785686113, + FT_ENCODING_ADOBE_STANDARD = 1094995778, + FT_ENCODING_ADOBE_EXPERT = 1094992453, + FT_ENCODING_ADOBE_CUSTOM = 1094992451, + FT_ENCODING_ADOBE_LATIN_1 = 1818326065, + FT_ENCODING_OLD_LATIN_2 = 1818326066, + FT_ENCODING_APPLE_ROMAN = 1634889070, +} +pub use self::FT_Encoding_ as FT_Encoding; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_CharMapRec_ { + pub face: FT_Face, + pub encoding: FT_Encoding, + pub platform_id: FT_UShort, + pub encoding_id: FT_UShort, +} +#[test] +fn bindgen_test_layout_FT_CharMapRec_() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(FT_CharMapRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_CharMapRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).face as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_CharMapRec_), + "::", + stringify!(face) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).encoding as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_CharMapRec_), + "::", + stringify!(encoding) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).platform_id as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(FT_CharMapRec_), + "::", + stringify!(platform_id) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).encoding_id as *const _ as usize }, + 14usize, + concat!( + "Offset of field: ", + stringify!(FT_CharMapRec_), + "::", + stringify!(encoding_id) + ) + ); +} +pub type FT_CharMapRec = FT_CharMapRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Face_InternalRec_ { + _unused: [u8; 0], +} +pub type FT_Face_Internal = *mut FT_Face_InternalRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_FaceRec_ { + pub num_faces: FT_Long, + pub face_index: FT_Long, + pub face_flags: FT_Long, + pub style_flags: FT_Long, + pub num_glyphs: FT_Long, + pub family_name: *mut FT_String, + pub style_name: *mut FT_String, + pub num_fixed_sizes: FT_Int, + pub available_sizes: *mut FT_Bitmap_Size, + pub num_charmaps: FT_Int, + pub charmaps: *mut FT_CharMap, + pub generic: FT_Generic, + pub bbox: FT_BBox, + pub units_per_EM: FT_UShort, + pub ascender: FT_Short, + pub descender: FT_Short, + pub height: FT_Short, + pub max_advance_width: FT_Short, + pub max_advance_height: FT_Short, + pub underline_position: FT_Short, + pub underline_thickness: FT_Short, + pub glyph: FT_GlyphSlot, + pub size: FT_Size, + pub charmap: FT_CharMap, + pub driver: FT_Driver, + pub memory: FT_Memory, + pub stream: FT_Stream, + pub sizes_list: FT_ListRec, + pub autohint: FT_Generic, + pub extensions: *mut ::std::os::raw::c_void, + pub internal: FT_Face_Internal, +} +#[test] +fn bindgen_test_layout_FT_FaceRec_() { + assert_eq!( + ::std::mem::size_of::(), + 248usize, + concat!("Size of: ", stringify!(FT_FaceRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_FaceRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).num_faces as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(num_faces) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).face_index as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(face_index) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).face_flags as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(face_flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).style_flags as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(style_flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).num_glyphs as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(num_glyphs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).family_name as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(family_name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).style_name as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(style_name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).num_fixed_sizes as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(num_fixed_sizes) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).available_sizes as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(available_sizes) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).num_charmaps as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(num_charmaps) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).charmaps as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(charmaps) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).generic as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(generic) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bbox as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(bbox) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).units_per_EM as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(units_per_EM) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ascender as *const _ as usize }, + 138usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(ascender) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).descender as *const _ as usize }, + 140usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(descender) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 142usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).max_advance_width as *const _ as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(max_advance_width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).max_advance_height as *const _ as usize }, + 146usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(max_advance_height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).underline_position as *const _ as usize }, + 148usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(underline_position) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).underline_thickness as *const _ as usize }, + 150usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(underline_thickness) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).glyph as *const _ as usize }, + 152usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(glyph) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 160usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).charmap as *const _ as usize }, + 168usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(charmap) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).driver as *const _ as usize }, + 176usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(driver) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).memory as *const _ as usize }, + 184usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(memory) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stream as *const _ as usize }, + 192usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(stream) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sizes_list as *const _ as usize }, + 200usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(sizes_list) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).autohint as *const _ as usize }, + 216usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(autohint) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).extensions as *const _ as usize }, + 232usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(extensions) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).internal as *const _ as usize }, + 240usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(internal) + ) + ); +} +pub type FT_FaceRec = FT_FaceRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Size_InternalRec_ { + _unused: [u8; 0], +} +pub type FT_Size_Internal = *mut FT_Size_InternalRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Size_Metrics_ { + pub x_ppem: FT_UShort, + pub y_ppem: FT_UShort, + pub x_scale: FT_Fixed, + pub y_scale: FT_Fixed, + pub ascender: FT_Pos, + pub descender: FT_Pos, + pub height: FT_Pos, + pub max_advance: FT_Pos, +} +#[test] +fn bindgen_test_layout_FT_Size_Metrics_() { + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(FT_Size_Metrics_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Size_Metrics_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x_ppem as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_Metrics_), + "::", + stringify!(x_ppem) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y_ppem as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_Metrics_), + "::", + stringify!(y_ppem) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x_scale as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_Metrics_), + "::", + stringify!(x_scale) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y_scale as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_Metrics_), + "::", + stringify!(y_scale) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ascender as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_Metrics_), + "::", + stringify!(ascender) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).descender as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_Metrics_), + "::", + stringify!(descender) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_Metrics_), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).max_advance as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_Metrics_), + "::", + stringify!(max_advance) + ) + ); +} +pub type FT_Size_Metrics = FT_Size_Metrics_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_SizeRec_ { + pub face: FT_Face, + pub generic: FT_Generic, + pub metrics: FT_Size_Metrics, + pub internal: FT_Size_Internal, +} +#[test] +fn bindgen_test_layout_FT_SizeRec_() { + assert_eq!( + ::std::mem::size_of::(), + 88usize, + concat!("Size of: ", stringify!(FT_SizeRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_SizeRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).face as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_SizeRec_), + "::", + stringify!(face) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).generic as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_SizeRec_), + "::", + stringify!(generic) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).metrics as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_SizeRec_), + "::", + stringify!(metrics) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).internal as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(FT_SizeRec_), + "::", + stringify!(internal) + ) + ); +} +pub type FT_SizeRec = FT_SizeRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_SubGlyphRec_ { + _unused: [u8; 0], +} +pub type FT_SubGlyph = *mut FT_SubGlyphRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Slot_InternalRec_ { + _unused: [u8; 0], +} +pub type FT_Slot_Internal = *mut FT_Slot_InternalRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_GlyphSlotRec_ { + pub library: FT_Library, + pub face: FT_Face, + pub next: FT_GlyphSlot, + pub glyph_index: FT_UInt, + pub generic: FT_Generic, + pub metrics: FT_Glyph_Metrics, + pub linearHoriAdvance: FT_Fixed, + pub linearVertAdvance: FT_Fixed, + pub advance: FT_Vector, + pub format: FT_Glyph_Format, + pub bitmap: FT_Bitmap, + pub bitmap_left: FT_Int, + pub bitmap_top: FT_Int, + pub outline: FT_Outline, + pub num_subglyphs: FT_UInt, + pub subglyphs: FT_SubGlyph, + pub control_data: *mut ::std::os::raw::c_void, + pub control_len: ::std::os::raw::c_long, + pub lsb_delta: FT_Pos, + pub rsb_delta: FT_Pos, + pub other: *mut ::std::os::raw::c_void, + pub internal: FT_Slot_Internal, +} +#[test] +fn bindgen_test_layout_FT_GlyphSlotRec_() { + assert_eq!( + ::std::mem::size_of::(), + 304usize, + concat!("Size of: ", stringify!(FT_GlyphSlotRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_GlyphSlotRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).library as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(library) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).face as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(face) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).glyph_index as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(glyph_index) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).generic as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(generic) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).metrics as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(metrics) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).linearHoriAdvance as *const _ as usize + }, + 112usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(linearHoriAdvance) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).linearVertAdvance as *const _ as usize + }, + 120usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(linearVertAdvance) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).advance as *const _ as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(advance) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(format) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bitmap as *const _ as usize }, + 152usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(bitmap) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bitmap_left as *const _ as usize }, + 192usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(bitmap_left) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bitmap_top as *const _ as usize }, + 196usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(bitmap_top) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).outline as *const _ as usize }, + 200usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(outline) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).num_subglyphs as *const _ as usize }, + 240usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(num_subglyphs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).subglyphs as *const _ as usize }, + 248usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(subglyphs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).control_data as *const _ as usize }, + 256usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(control_data) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).control_len as *const _ as usize }, + 264usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(control_len) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lsb_delta as *const _ as usize }, + 272usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(lsb_delta) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rsb_delta as *const _ as usize }, + 280usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(rsb_delta) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).other as *const _ as usize }, + 288usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(other) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).internal as *const _ as usize }, + 296usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(internal) + ) + ); +} +pub type FT_GlyphSlotRec = FT_GlyphSlotRec_; +extern "C" { + #[link_name = "\u{1}_FT_Init_FreeType"] + pub fn FT_Init_FreeType(alibrary: *mut FT_Library) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Done_FreeType"] + pub fn FT_Done_FreeType(library: FT_Library) -> FT_Error; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Parameter_ { + pub tag: FT_ULong, + pub data: FT_Pointer, +} +#[test] +fn bindgen_test_layout_FT_Parameter_() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(FT_Parameter_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Parameter_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tag as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Parameter_), + "::", + stringify!(tag) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Parameter_), + "::", + stringify!(data) + ) + ); +} +pub type FT_Parameter = FT_Parameter_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Open_Args_ { + pub flags: FT_UInt, + pub memory_base: *const FT_Byte, + pub memory_size: FT_Long, + pub pathname: *mut FT_String, + pub stream: FT_Stream, + pub driver: FT_Module, + pub num_params: FT_Int, + pub params: *mut FT_Parameter, +} +#[test] +fn bindgen_test_layout_FT_Open_Args_() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(FT_Open_Args_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Open_Args_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Open_Args_), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).memory_base as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Open_Args_), + "::", + stringify!(memory_base) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).memory_size as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Open_Args_), + "::", + stringify!(memory_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pathname as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Open_Args_), + "::", + stringify!(pathname) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stream as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_Open_Args_), + "::", + stringify!(stream) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).driver as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(FT_Open_Args_), + "::", + stringify!(driver) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).num_params as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(FT_Open_Args_), + "::", + stringify!(num_params) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).params as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(FT_Open_Args_), + "::", + stringify!(params) + ) + ); +} +pub type FT_Open_Args = FT_Open_Args_; +extern "C" { + #[link_name = "\u{1}_FT_New_Face"] + pub fn FT_New_Face( + library: FT_Library, + filepathname: *const ::std::os::raw::c_char, + face_index: FT_Long, + aface: *mut FT_Face, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_New_Memory_Face"] + pub fn FT_New_Memory_Face( + library: FT_Library, + file_base: *const FT_Byte, + file_size: FT_Long, + face_index: FT_Long, + aface: *mut FT_Face, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Open_Face"] + pub fn FT_Open_Face( + library: FT_Library, + args: *const FT_Open_Args, + face_index: FT_Long, + aface: *mut FT_Face, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Attach_File"] + pub fn FT_Attach_File(face: FT_Face, filepathname: *const ::std::os::raw::c_char) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Attach_Stream"] + pub fn FT_Attach_Stream(face: FT_Face, parameters: *mut FT_Open_Args) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Reference_Face"] + pub fn FT_Reference_Face(face: FT_Face) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Done_Face"] + pub fn FT_Done_Face(face: FT_Face) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Select_Size"] + pub fn FT_Select_Size(face: FT_Face, strike_index: FT_Int) -> FT_Error; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum FT_Size_Request_Type_ { + FT_SIZE_REQUEST_TYPE_NOMINAL = 0, + FT_SIZE_REQUEST_TYPE_REAL_DIM = 1, + FT_SIZE_REQUEST_TYPE_BBOX = 2, + FT_SIZE_REQUEST_TYPE_CELL = 3, + FT_SIZE_REQUEST_TYPE_SCALES = 4, + FT_SIZE_REQUEST_TYPE_MAX = 5, +} +pub use self::FT_Size_Request_Type_ as FT_Size_Request_Type; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Size_RequestRec_ { + pub type_: FT_Size_Request_Type, + pub width: FT_Long, + pub height: FT_Long, + pub horiResolution: FT_UInt, + pub vertResolution: FT_UInt, +} +#[test] +fn bindgen_test_layout_FT_Size_RequestRec_() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(FT_Size_RequestRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Size_RequestRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_RequestRec_), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_RequestRec_), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_RequestRec_), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).horiResolution as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_RequestRec_), + "::", + stringify!(horiResolution) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).vertResolution as *const _ as usize + }, + 28usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_RequestRec_), + "::", + stringify!(vertResolution) + ) + ); +} +pub type FT_Size_RequestRec = FT_Size_RequestRec_; +pub type FT_Size_Request = *mut FT_Size_RequestRec_; +extern "C" { + #[link_name = "\u{1}_FT_Request_Size"] + pub fn FT_Request_Size(face: FT_Face, req: FT_Size_Request) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Set_Char_Size"] + pub fn FT_Set_Char_Size( + face: FT_Face, + char_width: FT_F26Dot6, + char_height: FT_F26Dot6, + horz_resolution: FT_UInt, + vert_resolution: FT_UInt, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Set_Pixel_Sizes"] + pub fn FT_Set_Pixel_Sizes( + face: FT_Face, + pixel_width: FT_UInt, + pixel_height: FT_UInt, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Load_Glyph"] + pub fn FT_Load_Glyph(face: FT_Face, glyph_index: FT_UInt, load_flags: FT_Int32) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Load_Char"] + pub fn FT_Load_Char(face: FT_Face, char_code: FT_ULong, load_flags: FT_Int32) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Set_Transform"] + pub fn FT_Set_Transform(face: FT_Face, matrix: *mut FT_Matrix, delta: *mut FT_Vector); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum FT_Render_Mode_ { + FT_RENDER_MODE_NORMAL = 0, + FT_RENDER_MODE_LIGHT = 1, + FT_RENDER_MODE_MONO = 2, + FT_RENDER_MODE_LCD = 3, + FT_RENDER_MODE_LCD_V = 4, + FT_RENDER_MODE_MAX = 5, +} +pub use self::FT_Render_Mode_ as FT_Render_Mode; +extern "C" { + #[link_name = "\u{1}_FT_Render_Glyph"] + pub fn FT_Render_Glyph(slot: FT_GlyphSlot, render_mode: FT_Render_Mode) -> FT_Error; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum FT_Kerning_Mode_ { + FT_KERNING_DEFAULT = 0, + FT_KERNING_UNFITTED = 1, + FT_KERNING_UNSCALED = 2, +} +pub use self::FT_Kerning_Mode_ as FT_Kerning_Mode; +extern "C" { + #[link_name = "\u{1}_FT_Get_Kerning"] + pub fn FT_Get_Kerning( + face: FT_Face, + left_glyph: FT_UInt, + right_glyph: FT_UInt, + kern_mode: FT_UInt, + akerning: *mut FT_Vector, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Get_Track_Kerning"] + pub fn FT_Get_Track_Kerning( + face: FT_Face, + point_size: FT_Fixed, + degree: FT_Int, + akerning: *mut FT_Fixed, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Get_Glyph_Name"] + pub fn FT_Get_Glyph_Name( + face: FT_Face, + glyph_index: FT_UInt, + buffer: FT_Pointer, + buffer_max: FT_UInt, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Get_Postscript_Name"] + pub fn FT_Get_Postscript_Name(face: FT_Face) -> *const ::std::os::raw::c_char; +} +extern "C" { + #[link_name = "\u{1}_FT_Select_Charmap"] + pub fn FT_Select_Charmap(face: FT_Face, encoding: FT_Encoding) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Set_Charmap"] + pub fn FT_Set_Charmap(face: FT_Face, charmap: FT_CharMap) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Get_Charmap_Index"] + pub fn FT_Get_Charmap_Index(charmap: FT_CharMap) -> FT_Int; +} +extern "C" { + #[link_name = "\u{1}_FT_Get_Char_Index"] + pub fn FT_Get_Char_Index(face: FT_Face, charcode: FT_ULong) -> FT_UInt; +} +extern "C" { + #[link_name = "\u{1}_FT_Get_First_Char"] + pub fn FT_Get_First_Char(face: FT_Face, agindex: *mut FT_UInt) -> FT_ULong; +} +extern "C" { + #[link_name = "\u{1}_FT_Get_Next_Char"] + pub fn FT_Get_Next_Char(face: FT_Face, char_code: FT_ULong, agindex: *mut FT_UInt) -> FT_ULong; +} +extern "C" { + #[link_name = "\u{1}_FT_Face_Properties"] + pub fn FT_Face_Properties( + face: FT_Face, + num_properties: FT_UInt, + properties: *mut FT_Parameter, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Get_Name_Index"] + pub fn FT_Get_Name_Index(face: FT_Face, glyph_name: *mut FT_String) -> FT_UInt; +} +extern "C" { + #[link_name = "\u{1}_FT_Get_SubGlyph_Info"] + pub fn FT_Get_SubGlyph_Info( + glyph: FT_GlyphSlot, + sub_index: FT_UInt, + p_index: *mut FT_Int, + p_flags: *mut FT_UInt, + p_arg1: *mut FT_Int, + p_arg2: *mut FT_Int, + p_transform: *mut FT_Matrix, + ) -> FT_Error; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_LayerIterator_ { + pub num_layers: FT_UInt, + pub layer: FT_UInt, + pub p: *mut FT_Byte, +} +#[test] +fn bindgen_test_layout_FT_LayerIterator_() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(FT_LayerIterator_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_LayerIterator_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).num_layers as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_LayerIterator_), + "::", + stringify!(num_layers) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).layer as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(FT_LayerIterator_), + "::", + stringify!(layer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).p as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_LayerIterator_), + "::", + stringify!(p) + ) + ); +} +pub type FT_LayerIterator = FT_LayerIterator_; +extern "C" { + #[link_name = "\u{1}_FT_Get_Color_Glyph_Layer"] + pub fn FT_Get_Color_Glyph_Layer( + face: FT_Face, + base_glyph: FT_UInt, + aglyph_index: *mut FT_UInt, + acolor_index: *mut FT_UInt, + iterator: *mut FT_LayerIterator, + ) -> FT_Bool; +} +extern "C" { + #[link_name = "\u{1}_FT_Get_FSType_Flags"] + pub fn FT_Get_FSType_Flags(face: FT_Face) -> FT_UShort; +} +extern "C" { + #[link_name = "\u{1}_FT_Face_GetCharVariantIndex"] + pub fn FT_Face_GetCharVariantIndex( + face: FT_Face, + charcode: FT_ULong, + variantSelector: FT_ULong, + ) -> FT_UInt; +} +extern "C" { + #[link_name = "\u{1}_FT_Face_GetCharVariantIsDefault"] + pub fn FT_Face_GetCharVariantIsDefault( + face: FT_Face, + charcode: FT_ULong, + variantSelector: FT_ULong, + ) -> FT_Int; +} +extern "C" { + #[link_name = "\u{1}_FT_Face_GetVariantSelectors"] + pub fn FT_Face_GetVariantSelectors(face: FT_Face) -> *mut FT_UInt32; +} +extern "C" { + #[link_name = "\u{1}_FT_Face_GetVariantsOfChar"] + pub fn FT_Face_GetVariantsOfChar(face: FT_Face, charcode: FT_ULong) -> *mut FT_UInt32; +} +extern "C" { + #[link_name = "\u{1}_FT_Face_GetCharsOfVariant"] + pub fn FT_Face_GetCharsOfVariant(face: FT_Face, variantSelector: FT_ULong) -> *mut FT_UInt32; +} +extern "C" { + #[link_name = "\u{1}_FT_MulDiv"] + pub fn FT_MulDiv(a: FT_Long, b: FT_Long, c: FT_Long) -> FT_Long; +} +extern "C" { + #[link_name = "\u{1}_FT_MulFix"] + pub fn FT_MulFix(a: FT_Long, b: FT_Long) -> FT_Long; +} +extern "C" { + #[link_name = "\u{1}_FT_DivFix"] + pub fn FT_DivFix(a: FT_Long, b: FT_Long) -> FT_Long; +} +extern "C" { + #[link_name = "\u{1}_FT_RoundFix"] + pub fn FT_RoundFix(a: FT_Fixed) -> FT_Fixed; +} +extern "C" { + #[link_name = "\u{1}_FT_CeilFix"] + pub fn FT_CeilFix(a: FT_Fixed) -> FT_Fixed; +} +extern "C" { + #[link_name = "\u{1}_FT_FloorFix"] + pub fn FT_FloorFix(a: FT_Fixed) -> FT_Fixed; +} +extern "C" { + #[link_name = "\u{1}_FT_Vector_Transform"] + pub fn FT_Vector_Transform(vector: *mut FT_Vector, matrix: *const FT_Matrix); +} +extern "C" { + #[link_name = "\u{1}_FT_Library_Version"] + pub fn FT_Library_Version( + library: FT_Library, + amajor: *mut FT_Int, + aminor: *mut FT_Int, + apatch: *mut FT_Int, + ); +} +extern "C" { + #[link_name = "\u{1}_FT_Face_CheckTrueTypePatents"] + pub fn FT_Face_CheckTrueTypePatents(face: FT_Face) -> FT_Bool; +} +extern "C" { + #[link_name = "\u{1}_FT_Face_SetUnpatentedHinting"] + pub fn FT_Face_SetUnpatentedHinting(face: FT_Face, value: FT_Bool) -> FT_Bool; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum FT_LcdFilter_ { + FT_LCD_FILTER_NONE = 0, + FT_LCD_FILTER_DEFAULT = 1, + FT_LCD_FILTER_LIGHT = 2, + FT_LCD_FILTER_LEGACY1 = 3, + FT_LCD_FILTER_LEGACY = 16, + FT_LCD_FILTER_MAX = 17, +} +pub use self::FT_LcdFilter_ as FT_LcdFilter; +extern "C" { + #[link_name = "\u{1}_FT_Library_SetLcdFilter"] + pub fn FT_Library_SetLcdFilter(library: FT_Library, filter: FT_LcdFilter) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Library_SetLcdFilterWeights"] + pub fn FT_Library_SetLcdFilterWeights( + library: FT_Library, + weights: *mut ::std::os::raw::c_uchar, + ) -> FT_Error; +} +pub type FT_LcdFiveTapFilter = [FT_Byte; 5usize]; +extern "C" { + #[link_name = "\u{1}_FT_Library_SetLcdGeometry"] + pub fn FT_Library_SetLcdGeometry(library: FT_Library, sub: *mut FT_Vector) -> FT_Error; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum FT_Sfnt_Tag_ { + FT_SFNT_HEAD = 0, + FT_SFNT_MAXP = 1, + FT_SFNT_OS2 = 2, + FT_SFNT_HHEA = 3, + FT_SFNT_VHEA = 4, + FT_SFNT_POST = 5, + FT_SFNT_PCLT = 6, + FT_SFNT_MAX = 7, +} +pub use self::FT_Sfnt_Tag_ as FT_Sfnt_Tag; +extern "C" { + #[link_name = "\u{1}_FT_Get_Sfnt_Table"] + pub fn FT_Get_Sfnt_Table(face: FT_Face, tag: FT_Sfnt_Tag) -> *mut ::std::os::raw::c_void; +} +extern "C" { + #[link_name = "\u{1}_FT_Load_Sfnt_Table"] + pub fn FT_Load_Sfnt_Table( + face: FT_Face, + tag: FT_ULong, + offset: FT_Long, + buffer: *mut FT_Byte, + length: *mut FT_ULong, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Sfnt_Table_Info"] + pub fn FT_Sfnt_Table_Info( + face: FT_Face, + table_index: FT_UInt, + tag: *mut FT_ULong, + length: *mut FT_ULong, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Get_CMap_Language_ID"] + pub fn FT_Get_CMap_Language_ID(charmap: FT_CharMap) -> FT_ULong; +} +extern "C" { + #[link_name = "\u{1}_FT_Get_CMap_Format"] + pub fn FT_Get_CMap_Format(charmap: FT_CharMap) -> FT_Long; +} +pub type FT_Module_Interface = FT_Pointer; +pub type FT_Module_Constructor = + ::std::option::Option FT_Error>; +pub type FT_Module_Destructor = ::std::option::Option; +pub type FT_Module_Requester = ::std::option::Option< + unsafe extern "C" fn( + module: FT_Module, + name: *const ::std::os::raw::c_char, + ) -> FT_Module_Interface, +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Module_Class_ { + pub module_flags: FT_ULong, + pub module_size: FT_Long, + pub module_name: *const FT_String, + pub module_version: FT_Fixed, + pub module_requires: FT_Fixed, + pub module_interface: *const ::std::os::raw::c_void, + pub module_init: FT_Module_Constructor, + pub module_done: FT_Module_Destructor, + pub get_interface: FT_Module_Requester, +} +#[test] +fn bindgen_test_layout_FT_Module_Class_() { + assert_eq!( + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(FT_Module_Class_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Module_Class_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).module_flags as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Module_Class_), + "::", + stringify!(module_flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).module_size as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Module_Class_), + "::", + stringify!(module_size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).module_name as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Module_Class_), + "::", + stringify!(module_name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).module_version as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Module_Class_), + "::", + stringify!(module_version) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).module_requires as *const _ as usize + }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_Module_Class_), + "::", + stringify!(module_requires) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).module_interface as *const _ as usize + }, + 40usize, + concat!( + "Offset of field: ", + stringify!(FT_Module_Class_), + "::", + stringify!(module_interface) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).module_init as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(FT_Module_Class_), + "::", + stringify!(module_init) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).module_done as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(FT_Module_Class_), + "::", + stringify!(module_done) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).get_interface as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(FT_Module_Class_), + "::", + stringify!(get_interface) + ) + ); +} +pub type FT_Module_Class = FT_Module_Class_; +extern "C" { + #[link_name = "\u{1}_FT_Add_Module"] + pub fn FT_Add_Module(library: FT_Library, clazz: *const FT_Module_Class) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Get_Module"] + pub fn FT_Get_Module( + library: FT_Library, + module_name: *const ::std::os::raw::c_char, + ) -> FT_Module; +} +extern "C" { + #[link_name = "\u{1}_FT_Remove_Module"] + pub fn FT_Remove_Module(library: FT_Library, module: FT_Module) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Property_Set"] + pub fn FT_Property_Set( + library: FT_Library, + module_name: *const FT_String, + property_name: *const FT_String, + value: *const ::std::os::raw::c_void, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Property_Get"] + pub fn FT_Property_Get( + library: FT_Library, + module_name: *const FT_String, + property_name: *const FT_String, + value: *mut ::std::os::raw::c_void, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Set_Default_Properties"] + pub fn FT_Set_Default_Properties(library: FT_Library); +} +extern "C" { + #[link_name = "\u{1}_FT_Reference_Library"] + pub fn FT_Reference_Library(library: FT_Library) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_New_Library"] + pub fn FT_New_Library(memory: FT_Memory, alibrary: *mut FT_Library) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Done_Library"] + pub fn FT_Done_Library(library: FT_Library) -> FT_Error; +} +pub type FT_DebugHook_Func = + ::std::option::Option; +extern "C" { + #[link_name = "\u{1}_FT_Set_Debug_Hook"] + pub fn FT_Set_Debug_Hook( + library: FT_Library, + hook_index: FT_UInt, + debug_hook: FT_DebugHook_Func, + ); +} +extern "C" { + #[link_name = "\u{1}_FT_Add_Default_Modules"] + pub fn FT_Add_Default_Modules(library: FT_Library); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum FT_TrueTypeEngineType_ { + FT_TRUETYPE_ENGINE_TYPE_NONE = 0, + FT_TRUETYPE_ENGINE_TYPE_UNPATENTED = 1, + FT_TRUETYPE_ENGINE_TYPE_PATENTED = 2, +} +pub use self::FT_TrueTypeEngineType_ as FT_TrueTypeEngineType; +extern "C" { + #[link_name = "\u{1}_FT_Get_TrueType_Engine_Type"] + pub fn FT_Get_TrueType_Engine_Type(library: FT_Library) -> FT_TrueTypeEngineType; +} +extern "C" { + #[link_name = "\u{1}_FT_Outline_Decompose"] + pub fn FT_Outline_Decompose( + outline: *mut FT_Outline, + func_interface: *const FT_Outline_Funcs, + user: *mut ::std::os::raw::c_void, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Outline_New"] + pub fn FT_Outline_New( + library: FT_Library, + numPoints: FT_UInt, + numContours: FT_Int, + anoutline: *mut FT_Outline, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Outline_Done"] + pub fn FT_Outline_Done(library: FT_Library, outline: *mut FT_Outline) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Outline_Check"] + pub fn FT_Outline_Check(outline: *mut FT_Outline) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Outline_Get_CBox"] + pub fn FT_Outline_Get_CBox(outline: *const FT_Outline, acbox: *mut FT_BBox); +} +extern "C" { + #[link_name = "\u{1}_FT_Outline_Translate"] + pub fn FT_Outline_Translate(outline: *const FT_Outline, xOffset: FT_Pos, yOffset: FT_Pos); +} +extern "C" { + #[link_name = "\u{1}_FT_Outline_Copy"] + pub fn FT_Outline_Copy(source: *const FT_Outline, target: *mut FT_Outline) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Outline_Transform"] + pub fn FT_Outline_Transform(outline: *const FT_Outline, matrix: *const FT_Matrix); +} +extern "C" { + #[link_name = "\u{1}_FT_Outline_Embolden"] + pub fn FT_Outline_Embolden(outline: *mut FT_Outline, strength: FT_Pos) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Outline_EmboldenXY"] + pub fn FT_Outline_EmboldenXY( + outline: *mut FT_Outline, + xstrength: FT_Pos, + ystrength: FT_Pos, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Outline_Reverse"] + pub fn FT_Outline_Reverse(outline: *mut FT_Outline); +} +extern "C" { + #[link_name = "\u{1}_FT_Outline_Get_Bitmap"] + pub fn FT_Outline_Get_Bitmap( + library: FT_Library, + outline: *mut FT_Outline, + abitmap: *const FT_Bitmap, + ) -> FT_Error; +} +extern "C" { + #[link_name = "\u{1}_FT_Outline_Render"] + pub fn FT_Outline_Render( + library: FT_Library, + outline: *mut FT_Outline, + params: *mut FT_Raster_Params, + ) -> FT_Error; +} +impl FT_Orientation_ { + pub const FT_ORIENTATION_FILL_RIGHT: FT_Orientation_ = FT_Orientation_::FT_ORIENTATION_TRUETYPE; +} +impl FT_Orientation_ { + pub const FT_ORIENTATION_FILL_LEFT: FT_Orientation_ = + FT_Orientation_::FT_ORIENTATION_POSTSCRIPT; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum FT_Orientation_ { + FT_ORIENTATION_TRUETYPE = 0, + FT_ORIENTATION_POSTSCRIPT = 1, + FT_ORIENTATION_NONE = 2, +} +pub use self::FT_Orientation_ as FT_Orientation; +extern "C" { + #[link_name = "\u{1}_FT_Outline_Get_Orientation"] + pub fn FT_Outline_Get_Orientation(outline: *mut FT_Outline) -> FT_Orientation; +} diff --git a/deps/harfbuzz/Cargo.toml b/deps/harfbuzz/Cargo.toml new file mode 100644 index 000000000..bf4b1b5b8 --- /dev/null +++ b/deps/harfbuzz/Cargo.toml @@ -0,0 +1,13 @@ +[package] +authors = ["Wez Furlong "] +name = "harfbuzz" +version = "0.1.0" +edition = "2018" +links = "harfbuzz" +build = "build.rs" + +[dependencies] +freetype = { path = "../freetype" } + +[build-dependencies] +cmake = "0.1" diff --git a/deps/harfbuzz/bindings.h b/deps/harfbuzz/bindings.h new file mode 100644 index 000000000..9c6d818d8 --- /dev/null +++ b/deps/harfbuzz/bindings.h @@ -0,0 +1,2 @@ +#include +#include diff --git a/deps/harfbuzz/build.rs b/deps/harfbuzz/build.rs new file mode 100644 index 000000000..0c3cf222c --- /dev/null +++ b/deps/harfbuzz/build.rs @@ -0,0 +1,39 @@ +use cmake::Config; +use std::env; + +fn harfbuzz() { + let mut config = Config::new("harfbuzz"); + for (key, value) in std::env::vars() { + println!("{}: {}", key, value); + } + + let ft_outdir = std::env::var("DEP_FREETYPE_OUTDIR").unwrap(); + + let dst = config + .env("CMAKE_PREFIX_PATH", &ft_outdir) + .cxxflag("-DHB_NO_PRAGMA_GCC_DIAGNOSTIC_ERROR") + .define("HB_HAVE_FREETYPE", "ON") + .define("HB_BUILD_TESTS", "OFF") + .define( + "FREETYPE_LIBRARY", + std::env::var("DEP_FREETYPE_LIB").unwrap(), + ) + .define( + "FREETYPE_INCLUDE_DIRS", + std::env::var("DEP_FREETYPE_INCLUDE").unwrap(), + ) + .profile("Release") + .build(); + println!("cargo:rustc-link-search=native={}/lib", ft_outdir); + println!("cargo:rustc-link-search=native={}/lib", dst.display()); + println!("cargo:rustc-link-lib=static=harfbuzz"); + println!("cargo:rustc-link-search=native=/usr/lib"); + println!("cargo:rustc-link-lib=bz2"); + println!("cargo:rustc-link-lib=z"); +} + +fn main() { + harfbuzz(); + let out_dir = env::var("OUT_DIR").unwrap(); + println!("cargo:outdir={}", out_dir); +} diff --git a/deps/harfbuzz/harfbuzz b/deps/harfbuzz/harfbuzz new file mode 160000 index 000000000..bcb4e505d --- /dev/null +++ b/deps/harfbuzz/harfbuzz @@ -0,0 +1 @@ +Subproject commit bcb4e505d6ffe33e3268a06698e75d6be0e64957 diff --git a/deps/harfbuzz/regenerate.sh b/deps/harfbuzz/regenerate.sh new file mode 100755 index 000000000..0ed506dbf --- /dev/null +++ b/deps/harfbuzz/regenerate.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +bindgen bindings.h -o src/lib.rs \ + --no-doc-comments \ + --raw-line "#![allow(non_snake_case)]" \ + --raw-line "#![allow(non_camel_case_types)]" \ + --raw-line "#![allow(non_upper_case_globals)]" \ + --default-enum-style rust \ + --generate=functions,types,vars \ + --whitelist-function="hb_.*" \ + --whitelist-type="hb_.*" \ + -- -Iharfbuzz/src -I../freetype/freetype2/include diff --git a/deps/harfbuzz/src/lib.rs b/deps/harfbuzz/src/lib.rs new file mode 100644 index 000000000..ddeec709d --- /dev/null +++ b/deps/harfbuzz/src/lib.rs @@ -0,0 +1,4864 @@ +/* automatically generated by rust-bindgen */ + +#![allow(non_snake_case)] +#![allow(non_camel_case_types)] +#![allow(non_upper_case_globals)] + +pub type hb_bool_t = ::std::os::raw::c_int; +pub type hb_codepoint_t = u32; +pub type hb_position_t = i32; +pub type hb_mask_t = u32; +#[repr(C)] +#[derive(Copy, Clone)] +pub union _hb_var_int_t { + pub u32: u32, + pub i32: i32, + pub u16: [u16; 2usize], + pub i16: [i16; 2usize], + pub u8: [u8; 4usize], + pub i8: [i8; 4usize], + _bindgen_union_align: u32, +} +#[test] +fn bindgen_test_layout__hb_var_int_t() { + assert_eq!( + ::std::mem::size_of::<_hb_var_int_t>(), + 4usize, + concat!("Size of: ", stringify!(_hb_var_int_t)) + ); + assert_eq!( + ::std::mem::align_of::<_hb_var_int_t>(), + 4usize, + concat!("Alignment of ", stringify!(_hb_var_int_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_hb_var_int_t>())).u32 as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_int_t), + "::", + stringify!(u32) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_hb_var_int_t>())).i32 as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_int_t), + "::", + stringify!(i32) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_hb_var_int_t>())).u16 as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_int_t), + "::", + stringify!(u16) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_hb_var_int_t>())).i16 as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_int_t), + "::", + stringify!(i16) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_hb_var_int_t>())).u8 as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_int_t), + "::", + stringify!(u8) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<_hb_var_int_t>())).i8 as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_hb_var_int_t), + "::", + stringify!(i8) + ) + ); +} +pub type hb_var_int_t = _hb_var_int_t; +pub type hb_tag_t = u32; +extern "C" { + #[link_name = "\u{1}_hb_tag_from_string"] + pub fn hb_tag_from_string( + str: *const ::std::os::raw::c_char, + len: ::std::os::raw::c_int, + ) -> hb_tag_t; +} +extern "C" { + #[link_name = "\u{1}_hb_tag_to_string"] + pub fn hb_tag_to_string(tag: hb_tag_t, buf: *mut ::std::os::raw::c_char); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum hb_direction_t { + HB_DIRECTION_INVALID = 0, + HB_DIRECTION_LTR = 4, + HB_DIRECTION_RTL = 5, + HB_DIRECTION_TTB = 6, + HB_DIRECTION_BTT = 7, +} +extern "C" { + #[link_name = "\u{1}_hb_direction_from_string"] + pub fn hb_direction_from_string( + str: *const ::std::os::raw::c_char, + len: ::std::os::raw::c_int, + ) -> hb_direction_t; +} +extern "C" { + #[link_name = "\u{1}_hb_direction_to_string"] + pub fn hb_direction_to_string(direction: hb_direction_t) -> *const ::std::os::raw::c_char; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hb_language_impl_t { + _unused: [u8; 0], +} +pub type hb_language_t = *const hb_language_impl_t; +extern "C" { + #[link_name = "\u{1}_hb_language_from_string"] + pub fn hb_language_from_string( + str: *const ::std::os::raw::c_char, + len: ::std::os::raw::c_int, + ) -> hb_language_t; +} +extern "C" { + #[link_name = "\u{1}_hb_language_to_string"] + pub fn hb_language_to_string(language: hb_language_t) -> *const ::std::os::raw::c_char; +} +extern "C" { + #[link_name = "\u{1}_hb_language_get_default"] + pub fn hb_language_get_default() -> hb_language_t; +} +impl hb_script_t { + pub const _HB_SCRIPT_MAX_VALUE_SIGNED: hb_script_t = hb_script_t::_HB_SCRIPT_MAX_VALUE; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum hb_script_t { + HB_SCRIPT_COMMON = 1517910393, + HB_SCRIPT_INHERITED = 1516858984, + HB_SCRIPT_UNKNOWN = 1517976186, + HB_SCRIPT_ARABIC = 1098015074, + HB_SCRIPT_ARMENIAN = 1098018158, + HB_SCRIPT_BENGALI = 1113943655, + HB_SCRIPT_CYRILLIC = 1132032620, + HB_SCRIPT_DEVANAGARI = 1147500129, + HB_SCRIPT_GEORGIAN = 1197830002, + HB_SCRIPT_GREEK = 1198679403, + HB_SCRIPT_GUJARATI = 1198877298, + HB_SCRIPT_GURMUKHI = 1198879349, + HB_SCRIPT_HANGUL = 1214344807, + HB_SCRIPT_HAN = 1214344809, + HB_SCRIPT_HEBREW = 1214603890, + HB_SCRIPT_HIRAGANA = 1214870113, + HB_SCRIPT_KANNADA = 1265525857, + HB_SCRIPT_KATAKANA = 1264676449, + HB_SCRIPT_LAO = 1281453935, + HB_SCRIPT_LATIN = 1281455214, + HB_SCRIPT_MALAYALAM = 1298954605, + HB_SCRIPT_ORIYA = 1332902241, + HB_SCRIPT_TAMIL = 1415671148, + HB_SCRIPT_TELUGU = 1415933045, + HB_SCRIPT_THAI = 1416126825, + HB_SCRIPT_TIBETAN = 1416192628, + HB_SCRIPT_BOPOMOFO = 1114599535, + HB_SCRIPT_BRAILLE = 1114792297, + HB_SCRIPT_CANADIAN_SYLLABICS = 1130458739, + HB_SCRIPT_CHEROKEE = 1130915186, + HB_SCRIPT_ETHIOPIC = 1165256809, + HB_SCRIPT_KHMER = 1265134962, + HB_SCRIPT_MONGOLIAN = 1299148391, + HB_SCRIPT_MYANMAR = 1299803506, + HB_SCRIPT_OGHAM = 1332175213, + HB_SCRIPT_RUNIC = 1383427698, + HB_SCRIPT_SINHALA = 1399418472, + HB_SCRIPT_SYRIAC = 1400468067, + HB_SCRIPT_THAANA = 1416126817, + HB_SCRIPT_YI = 1500080489, + HB_SCRIPT_DESERET = 1148416628, + HB_SCRIPT_GOTHIC = 1198486632, + HB_SCRIPT_OLD_ITALIC = 1232363884, + HB_SCRIPT_BUHID = 1114990692, + HB_SCRIPT_HANUNOO = 1214344815, + HB_SCRIPT_TAGALOG = 1416064103, + HB_SCRIPT_TAGBANWA = 1415669602, + HB_SCRIPT_CYPRIOT = 1131442804, + HB_SCRIPT_LIMBU = 1281977698, + HB_SCRIPT_LINEAR_B = 1281977954, + HB_SCRIPT_OSMANYA = 1332964705, + HB_SCRIPT_SHAVIAN = 1399349623, + HB_SCRIPT_TAI_LE = 1415670885, + HB_SCRIPT_UGARITIC = 1432838514, + HB_SCRIPT_BUGINESE = 1114990441, + HB_SCRIPT_COPTIC = 1131376756, + HB_SCRIPT_GLAGOLITIC = 1198285159, + HB_SCRIPT_KHAROSHTHI = 1265131890, + HB_SCRIPT_NEW_TAI_LUE = 1415670901, + HB_SCRIPT_OLD_PERSIAN = 1483761007, + HB_SCRIPT_SYLOTI_NAGRI = 1400466543, + HB_SCRIPT_TIFINAGH = 1415999079, + HB_SCRIPT_BALINESE = 1113681001, + HB_SCRIPT_CUNEIFORM = 1483961720, + HB_SCRIPT_NKO = 1315663727, + HB_SCRIPT_PHAGS_PA = 1349017959, + HB_SCRIPT_PHOENICIAN = 1349021304, + HB_SCRIPT_CARIAN = 1130459753, + HB_SCRIPT_CHAM = 1130914157, + HB_SCRIPT_KAYAH_LI = 1264675945, + HB_SCRIPT_LEPCHA = 1281716323, + HB_SCRIPT_LYCIAN = 1283023721, + HB_SCRIPT_LYDIAN = 1283023977, + HB_SCRIPT_OL_CHIKI = 1332503403, + HB_SCRIPT_REJANG = 1382706791, + HB_SCRIPT_SAURASHTRA = 1398895986, + HB_SCRIPT_SUNDANESE = 1400204900, + HB_SCRIPT_VAI = 1449224553, + HB_SCRIPT_AVESTAN = 1098281844, + HB_SCRIPT_BAMUM = 1113681269, + HB_SCRIPT_EGYPTIAN_HIEROGLYPHS = 1164409200, + HB_SCRIPT_IMPERIAL_ARAMAIC = 1098018153, + HB_SCRIPT_INSCRIPTIONAL_PAHLAVI = 1349020777, + HB_SCRIPT_INSCRIPTIONAL_PARTHIAN = 1349678185, + HB_SCRIPT_JAVANESE = 1247901281, + HB_SCRIPT_KAITHI = 1265920105, + HB_SCRIPT_LISU = 1281979253, + HB_SCRIPT_MEETEI_MAYEK = 1299473769, + HB_SCRIPT_OLD_SOUTH_ARABIAN = 1398895202, + HB_SCRIPT_OLD_TURKIC = 1332898664, + HB_SCRIPT_SAMARITAN = 1398893938, + HB_SCRIPT_TAI_THAM = 1281453665, + HB_SCRIPT_TAI_VIET = 1415673460, + HB_SCRIPT_BATAK = 1113683051, + HB_SCRIPT_BRAHMI = 1114792296, + HB_SCRIPT_MANDAIC = 1298230884, + HB_SCRIPT_CHAKMA = 1130457965, + HB_SCRIPT_MEROITIC_CURSIVE = 1298494051, + HB_SCRIPT_MEROITIC_HIEROGLYPHS = 1298494063, + HB_SCRIPT_MIAO = 1349284452, + HB_SCRIPT_SHARADA = 1399353956, + HB_SCRIPT_SORA_SOMPENG = 1399812705, + HB_SCRIPT_TAKRI = 1415670642, + HB_SCRIPT_BASSA_VAH = 1113682803, + HB_SCRIPT_CAUCASIAN_ALBANIAN = 1097295970, + HB_SCRIPT_DUPLOYAN = 1148547180, + HB_SCRIPT_ELBASAN = 1164730977, + HB_SCRIPT_GRANTHA = 1198678382, + HB_SCRIPT_KHOJKI = 1265135466, + HB_SCRIPT_KHUDAWADI = 1399418468, + HB_SCRIPT_LINEAR_A = 1281977953, + HB_SCRIPT_MAHAJANI = 1298229354, + HB_SCRIPT_MANICHAEAN = 1298230889, + HB_SCRIPT_MENDE_KIKAKUI = 1298493028, + HB_SCRIPT_MODI = 1299145833, + HB_SCRIPT_MRO = 1299345263, + HB_SCRIPT_NABATAEAN = 1315070324, + HB_SCRIPT_OLD_NORTH_ARABIAN = 1315009122, + HB_SCRIPT_OLD_PERMIC = 1348825709, + HB_SCRIPT_PAHAWH_HMONG = 1215131239, + HB_SCRIPT_PALMYRENE = 1348562029, + HB_SCRIPT_PAU_CIN_HAU = 1348564323, + HB_SCRIPT_PSALTER_PAHLAVI = 1349020784, + HB_SCRIPT_SIDDHAM = 1399415908, + HB_SCRIPT_TIRHUTA = 1416196712, + HB_SCRIPT_WARANG_CITI = 1466004065, + HB_SCRIPT_AHOM = 1097363309, + HB_SCRIPT_ANATOLIAN_HIEROGLYPHS = 1215067511, + HB_SCRIPT_HATRAN = 1214346354, + HB_SCRIPT_MULTANI = 1299541108, + HB_SCRIPT_OLD_HUNGARIAN = 1215655527, + HB_SCRIPT_SIGNWRITING = 1399287415, + HB_SCRIPT_ADLAM = 1097100397, + HB_SCRIPT_BHAIKSUKI = 1114139507, + HB_SCRIPT_MARCHEN = 1298231907, + HB_SCRIPT_OSAGE = 1332963173, + HB_SCRIPT_TANGUT = 1415671399, + HB_SCRIPT_NEWA = 1315272545, + HB_SCRIPT_MASARAM_GONDI = 1198485101, + HB_SCRIPT_NUSHU = 1316186229, + HB_SCRIPT_SOYOMBO = 1399814511, + HB_SCRIPT_ZANABAZAR_SQUARE = 1516334690, + HB_SCRIPT_DOGRA = 1148151666, + HB_SCRIPT_GUNJALA_GONDI = 1198485095, + HB_SCRIPT_HANIFI_ROHINGYA = 1383032935, + HB_SCRIPT_MAKASAR = 1298230113, + HB_SCRIPT_MEDEFAIDRIN = 1298490470, + HB_SCRIPT_OLD_SOGDIAN = 1399809903, + HB_SCRIPT_SOGDIAN = 1399809892, + HB_SCRIPT_ELYMAIC = 1164736877, + HB_SCRIPT_NANDINAGARI = 1315008100, + HB_SCRIPT_NYIAKENG_PUACHUE_HMONG = 1215131248, + HB_SCRIPT_WANCHO = 1466132591, + HB_SCRIPT_INVALID = 0, + _HB_SCRIPT_MAX_VALUE = 2147483647, +} +extern "C" { + #[link_name = "\u{1}_hb_script_from_iso15924_tag"] + pub fn hb_script_from_iso15924_tag(tag: hb_tag_t) -> hb_script_t; +} +extern "C" { + #[link_name = "\u{1}_hb_script_from_string"] + pub fn hb_script_from_string( + str: *const ::std::os::raw::c_char, + len: ::std::os::raw::c_int, + ) -> hb_script_t; +} +extern "C" { + #[link_name = "\u{1}_hb_script_to_iso15924_tag"] + pub fn hb_script_to_iso15924_tag(script: hb_script_t) -> hb_tag_t; +} +extern "C" { + #[link_name = "\u{1}_hb_script_get_horizontal_direction"] + pub fn hb_script_get_horizontal_direction(script: hb_script_t) -> hb_direction_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hb_user_data_key_t { + pub unused: ::std::os::raw::c_char, +} +#[test] +fn bindgen_test_layout_hb_user_data_key_t() { + assert_eq!( + ::std::mem::size_of::(), + 1usize, + concat!("Size of: ", stringify!(hb_user_data_key_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(hb_user_data_key_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).unused as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_user_data_key_t), + "::", + stringify!(unused) + ) + ); +} +pub type hb_destroy_func_t = + ::std::option::Option; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hb_feature_t { + pub tag: hb_tag_t, + pub value: u32, + pub start: ::std::os::raw::c_uint, + pub end: ::std::os::raw::c_uint, +} +#[test] +fn bindgen_test_layout_hb_feature_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hb_feature_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(hb_feature_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tag as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_feature_t), + "::", + stringify!(tag) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_feature_t), + "::", + stringify!(value) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).start as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_feature_t), + "::", + stringify!(start) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).end as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hb_feature_t), + "::", + stringify!(end) + ) + ); +} +extern "C" { + #[link_name = "\u{1}_hb_feature_from_string"] + pub fn hb_feature_from_string( + str: *const ::std::os::raw::c_char, + len: ::std::os::raw::c_int, + feature: *mut hb_feature_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_feature_to_string"] + pub fn hb_feature_to_string( + feature: *mut hb_feature_t, + buf: *mut ::std::os::raw::c_char, + size: ::std::os::raw::c_uint, + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hb_variation_t { + pub tag: hb_tag_t, + pub value: f32, +} +#[test] +fn bindgen_test_layout_hb_variation_t() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(hb_variation_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(hb_variation_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tag as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_variation_t), + "::", + stringify!(tag) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_variation_t), + "::", + stringify!(value) + ) + ); +} +extern "C" { + #[link_name = "\u{1}_hb_variation_from_string"] + pub fn hb_variation_from_string( + str: *const ::std::os::raw::c_char, + len: ::std::os::raw::c_int, + variation: *mut hb_variation_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_variation_to_string"] + pub fn hb_variation_to_string( + variation: *mut hb_variation_t, + buf: *mut ::std::os::raw::c_char, + size: ::std::os::raw::c_uint, + ); +} +pub type hb_color_t = u32; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum hb_memory_mode_t { + HB_MEMORY_MODE_DUPLICATE = 0, + HB_MEMORY_MODE_READONLY = 1, + HB_MEMORY_MODE_WRITABLE = 2, + HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE = 3, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hb_blob_t { + _unused: [u8; 0], +} +extern "C" { + #[link_name = "\u{1}_hb_blob_create"] + pub fn hb_blob_create( + data: *const ::std::os::raw::c_char, + length: ::std::os::raw::c_uint, + mode: hb_memory_mode_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ) -> *mut hb_blob_t; +} +extern "C" { + #[link_name = "\u{1}_hb_blob_create_sub_blob"] + pub fn hb_blob_create_sub_blob( + parent: *mut hb_blob_t, + offset: ::std::os::raw::c_uint, + length: ::std::os::raw::c_uint, + ) -> *mut hb_blob_t; +} +extern "C" { + #[link_name = "\u{1}_hb_blob_copy_writable_or_fail"] + pub fn hb_blob_copy_writable_or_fail(blob: *mut hb_blob_t) -> *mut hb_blob_t; +} +extern "C" { + #[link_name = "\u{1}_hb_blob_get_empty"] + pub fn hb_blob_get_empty() -> *mut hb_blob_t; +} +extern "C" { + #[link_name = "\u{1}_hb_blob_reference"] + pub fn hb_blob_reference(blob: *mut hb_blob_t) -> *mut hb_blob_t; +} +extern "C" { + #[link_name = "\u{1}_hb_blob_destroy"] + pub fn hb_blob_destroy(blob: *mut hb_blob_t); +} +extern "C" { + #[link_name = "\u{1}_hb_blob_set_user_data"] + pub fn hb_blob_set_user_data( + blob: *mut hb_blob_t, + key: *mut hb_user_data_key_t, + data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + replace: hb_bool_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_blob_get_user_data"] + pub fn hb_blob_get_user_data( + blob: *mut hb_blob_t, + key: *mut hb_user_data_key_t, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + #[link_name = "\u{1}_hb_blob_make_immutable"] + pub fn hb_blob_make_immutable(blob: *mut hb_blob_t); +} +extern "C" { + #[link_name = "\u{1}_hb_blob_is_immutable"] + pub fn hb_blob_is_immutable(blob: *mut hb_blob_t) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_blob_get_length"] + pub fn hb_blob_get_length(blob: *mut hb_blob_t) -> ::std::os::raw::c_uint; +} +extern "C" { + #[link_name = "\u{1}_hb_blob_get_data"] + pub fn hb_blob_get_data( + blob: *mut hb_blob_t, + length: *mut ::std::os::raw::c_uint, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + #[link_name = "\u{1}_hb_blob_get_data_writable"] + pub fn hb_blob_get_data_writable( + blob: *mut hb_blob_t, + length: *mut ::std::os::raw::c_uint, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + #[link_name = "\u{1}_hb_blob_create_from_file"] + pub fn hb_blob_create_from_file(file_name: *const ::std::os::raw::c_char) -> *mut hb_blob_t; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum hb_unicode_general_category_t { + HB_UNICODE_GENERAL_CATEGORY_CONTROL = 0, + HB_UNICODE_GENERAL_CATEGORY_FORMAT = 1, + HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED = 2, + HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE = 3, + HB_UNICODE_GENERAL_CATEGORY_SURROGATE = 4, + HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER = 5, + HB_UNICODE_GENERAL_CATEGORY_MODIFIER_LETTER = 6, + HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER = 7, + HB_UNICODE_GENERAL_CATEGORY_TITLECASE_LETTER = 8, + HB_UNICODE_GENERAL_CATEGORY_UPPERCASE_LETTER = 9, + HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK = 10, + HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK = 11, + HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK = 12, + HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER = 13, + HB_UNICODE_GENERAL_CATEGORY_LETTER_NUMBER = 14, + HB_UNICODE_GENERAL_CATEGORY_OTHER_NUMBER = 15, + HB_UNICODE_GENERAL_CATEGORY_CONNECT_PUNCTUATION = 16, + HB_UNICODE_GENERAL_CATEGORY_DASH_PUNCTUATION = 17, + HB_UNICODE_GENERAL_CATEGORY_CLOSE_PUNCTUATION = 18, + HB_UNICODE_GENERAL_CATEGORY_FINAL_PUNCTUATION = 19, + HB_UNICODE_GENERAL_CATEGORY_INITIAL_PUNCTUATION = 20, + HB_UNICODE_GENERAL_CATEGORY_OTHER_PUNCTUATION = 21, + HB_UNICODE_GENERAL_CATEGORY_OPEN_PUNCTUATION = 22, + HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL = 23, + HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL = 24, + HB_UNICODE_GENERAL_CATEGORY_MATH_SYMBOL = 25, + HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL = 26, + HB_UNICODE_GENERAL_CATEGORY_LINE_SEPARATOR = 27, + HB_UNICODE_GENERAL_CATEGORY_PARAGRAPH_SEPARATOR = 28, + HB_UNICODE_GENERAL_CATEGORY_SPACE_SEPARATOR = 29, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum hb_unicode_combining_class_t { + HB_UNICODE_COMBINING_CLASS_NOT_REORDERED = 0, + HB_UNICODE_COMBINING_CLASS_OVERLAY = 1, + HB_UNICODE_COMBINING_CLASS_NUKTA = 7, + HB_UNICODE_COMBINING_CLASS_KANA_VOICING = 8, + HB_UNICODE_COMBINING_CLASS_VIRAMA = 9, + HB_UNICODE_COMBINING_CLASS_CCC10 = 10, + HB_UNICODE_COMBINING_CLASS_CCC11 = 11, + HB_UNICODE_COMBINING_CLASS_CCC12 = 12, + HB_UNICODE_COMBINING_CLASS_CCC13 = 13, + HB_UNICODE_COMBINING_CLASS_CCC14 = 14, + HB_UNICODE_COMBINING_CLASS_CCC15 = 15, + HB_UNICODE_COMBINING_CLASS_CCC16 = 16, + HB_UNICODE_COMBINING_CLASS_CCC17 = 17, + HB_UNICODE_COMBINING_CLASS_CCC18 = 18, + HB_UNICODE_COMBINING_CLASS_CCC19 = 19, + HB_UNICODE_COMBINING_CLASS_CCC20 = 20, + HB_UNICODE_COMBINING_CLASS_CCC21 = 21, + HB_UNICODE_COMBINING_CLASS_CCC22 = 22, + HB_UNICODE_COMBINING_CLASS_CCC23 = 23, + HB_UNICODE_COMBINING_CLASS_CCC24 = 24, + HB_UNICODE_COMBINING_CLASS_CCC25 = 25, + HB_UNICODE_COMBINING_CLASS_CCC26 = 26, + HB_UNICODE_COMBINING_CLASS_CCC27 = 27, + HB_UNICODE_COMBINING_CLASS_CCC28 = 28, + HB_UNICODE_COMBINING_CLASS_CCC29 = 29, + HB_UNICODE_COMBINING_CLASS_CCC30 = 30, + HB_UNICODE_COMBINING_CLASS_CCC31 = 31, + HB_UNICODE_COMBINING_CLASS_CCC32 = 32, + HB_UNICODE_COMBINING_CLASS_CCC33 = 33, + HB_UNICODE_COMBINING_CLASS_CCC34 = 34, + HB_UNICODE_COMBINING_CLASS_CCC35 = 35, + HB_UNICODE_COMBINING_CLASS_CCC36 = 36, + HB_UNICODE_COMBINING_CLASS_CCC84 = 84, + HB_UNICODE_COMBINING_CLASS_CCC91 = 91, + HB_UNICODE_COMBINING_CLASS_CCC103 = 103, + HB_UNICODE_COMBINING_CLASS_CCC107 = 107, + HB_UNICODE_COMBINING_CLASS_CCC118 = 118, + HB_UNICODE_COMBINING_CLASS_CCC122 = 122, + HB_UNICODE_COMBINING_CLASS_CCC129 = 129, + HB_UNICODE_COMBINING_CLASS_CCC130 = 130, + HB_UNICODE_COMBINING_CLASS_CCC133 = 132, + HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW_LEFT = 200, + HB_UNICODE_COMBINING_CLASS_ATTACHED_BELOW = 202, + HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE = 214, + HB_UNICODE_COMBINING_CLASS_ATTACHED_ABOVE_RIGHT = 216, + HB_UNICODE_COMBINING_CLASS_BELOW_LEFT = 218, + HB_UNICODE_COMBINING_CLASS_BELOW = 220, + HB_UNICODE_COMBINING_CLASS_BELOW_RIGHT = 222, + HB_UNICODE_COMBINING_CLASS_LEFT = 224, + HB_UNICODE_COMBINING_CLASS_RIGHT = 226, + HB_UNICODE_COMBINING_CLASS_ABOVE_LEFT = 228, + HB_UNICODE_COMBINING_CLASS_ABOVE = 230, + HB_UNICODE_COMBINING_CLASS_ABOVE_RIGHT = 232, + HB_UNICODE_COMBINING_CLASS_DOUBLE_BELOW = 233, + HB_UNICODE_COMBINING_CLASS_DOUBLE_ABOVE = 234, + HB_UNICODE_COMBINING_CLASS_IOTA_SUBSCRIPT = 240, + HB_UNICODE_COMBINING_CLASS_INVALID = 255, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hb_unicode_funcs_t { + _unused: [u8; 0], +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_get_default"] + pub fn hb_unicode_funcs_get_default() -> *mut hb_unicode_funcs_t; +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_create"] + pub fn hb_unicode_funcs_create(parent: *mut hb_unicode_funcs_t) -> *mut hb_unicode_funcs_t; +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_get_empty"] + pub fn hb_unicode_funcs_get_empty() -> *mut hb_unicode_funcs_t; +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_reference"] + pub fn hb_unicode_funcs_reference(ufuncs: *mut hb_unicode_funcs_t) -> *mut hb_unicode_funcs_t; +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_destroy"] + pub fn hb_unicode_funcs_destroy(ufuncs: *mut hb_unicode_funcs_t); +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_set_user_data"] + pub fn hb_unicode_funcs_set_user_data( + ufuncs: *mut hb_unicode_funcs_t, + key: *mut hb_user_data_key_t, + data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + replace: hb_bool_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_get_user_data"] + pub fn hb_unicode_funcs_get_user_data( + ufuncs: *mut hb_unicode_funcs_t, + key: *mut hb_user_data_key_t, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_make_immutable"] + pub fn hb_unicode_funcs_make_immutable(ufuncs: *mut hb_unicode_funcs_t); +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_is_immutable"] + pub fn hb_unicode_funcs_is_immutable(ufuncs: *mut hb_unicode_funcs_t) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_get_parent"] + pub fn hb_unicode_funcs_get_parent(ufuncs: *mut hb_unicode_funcs_t) -> *mut hb_unicode_funcs_t; +} +pub type hb_unicode_combining_class_func_t = ::std::option::Option< + unsafe extern "C" fn( + ufuncs: *mut hb_unicode_funcs_t, + unicode: hb_codepoint_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_unicode_combining_class_t, +>; +pub type hb_unicode_general_category_func_t = ::std::option::Option< + unsafe extern "C" fn( + ufuncs: *mut hb_unicode_funcs_t, + unicode: hb_codepoint_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_unicode_general_category_t, +>; +pub type hb_unicode_mirroring_func_t = ::std::option::Option< + unsafe extern "C" fn( + ufuncs: *mut hb_unicode_funcs_t, + unicode: hb_codepoint_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_codepoint_t, +>; +pub type hb_unicode_script_func_t = ::std::option::Option< + unsafe extern "C" fn( + ufuncs: *mut hb_unicode_funcs_t, + unicode: hb_codepoint_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_script_t, +>; +pub type hb_unicode_compose_func_t = ::std::option::Option< + unsafe extern "C" fn( + ufuncs: *mut hb_unicode_funcs_t, + a: hb_codepoint_t, + b: hb_codepoint_t, + ab: *mut hb_codepoint_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_bool_t, +>; +pub type hb_unicode_decompose_func_t = ::std::option::Option< + unsafe extern "C" fn( + ufuncs: *mut hb_unicode_funcs_t, + ab: hb_codepoint_t, + a: *mut hb_codepoint_t, + b: *mut hb_codepoint_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_bool_t, +>; +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_set_combining_class_func"] + pub fn hb_unicode_funcs_set_combining_class_func( + ufuncs: *mut hb_unicode_funcs_t, + func: hb_unicode_combining_class_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_set_general_category_func"] + pub fn hb_unicode_funcs_set_general_category_func( + ufuncs: *mut hb_unicode_funcs_t, + func: hb_unicode_general_category_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_set_mirroring_func"] + pub fn hb_unicode_funcs_set_mirroring_func( + ufuncs: *mut hb_unicode_funcs_t, + func: hb_unicode_mirroring_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_set_script_func"] + pub fn hb_unicode_funcs_set_script_func( + ufuncs: *mut hb_unicode_funcs_t, + func: hb_unicode_script_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_set_compose_func"] + pub fn hb_unicode_funcs_set_compose_func( + ufuncs: *mut hb_unicode_funcs_t, + func: hb_unicode_compose_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_set_decompose_func"] + pub fn hb_unicode_funcs_set_decompose_func( + ufuncs: *mut hb_unicode_funcs_t, + func: hb_unicode_decompose_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_combining_class"] + pub fn hb_unicode_combining_class( + ufuncs: *mut hb_unicode_funcs_t, + unicode: hb_codepoint_t, + ) -> hb_unicode_combining_class_t; +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_general_category"] + pub fn hb_unicode_general_category( + ufuncs: *mut hb_unicode_funcs_t, + unicode: hb_codepoint_t, + ) -> hb_unicode_general_category_t; +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_mirroring"] + pub fn hb_unicode_mirroring( + ufuncs: *mut hb_unicode_funcs_t, + unicode: hb_codepoint_t, + ) -> hb_codepoint_t; +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_script"] + pub fn hb_unicode_script( + ufuncs: *mut hb_unicode_funcs_t, + unicode: hb_codepoint_t, + ) -> hb_script_t; +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_compose"] + pub fn hb_unicode_compose( + ufuncs: *mut hb_unicode_funcs_t, + a: hb_codepoint_t, + b: hb_codepoint_t, + ab: *mut hb_codepoint_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_decompose"] + pub fn hb_unicode_decompose( + ufuncs: *mut hb_unicode_funcs_t, + ab: hb_codepoint_t, + a: *mut hb_codepoint_t, + b: *mut hb_codepoint_t, + ) -> hb_bool_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hb_set_t { + _unused: [u8; 0], +} +extern "C" { + #[link_name = "\u{1}_hb_set_create"] + pub fn hb_set_create() -> *mut hb_set_t; +} +extern "C" { + #[link_name = "\u{1}_hb_set_get_empty"] + pub fn hb_set_get_empty() -> *mut hb_set_t; +} +extern "C" { + #[link_name = "\u{1}_hb_set_reference"] + pub fn hb_set_reference(set: *mut hb_set_t) -> *mut hb_set_t; +} +extern "C" { + #[link_name = "\u{1}_hb_set_destroy"] + pub fn hb_set_destroy(set: *mut hb_set_t); +} +extern "C" { + #[link_name = "\u{1}_hb_set_set_user_data"] + pub fn hb_set_set_user_data( + set: *mut hb_set_t, + key: *mut hb_user_data_key_t, + data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + replace: hb_bool_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_set_get_user_data"] + pub fn hb_set_get_user_data( + set: *mut hb_set_t, + key: *mut hb_user_data_key_t, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + #[link_name = "\u{1}_hb_set_allocation_successful"] + pub fn hb_set_allocation_successful(set: *const hb_set_t) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_set_clear"] + pub fn hb_set_clear(set: *mut hb_set_t); +} +extern "C" { + #[link_name = "\u{1}_hb_set_is_empty"] + pub fn hb_set_is_empty(set: *const hb_set_t) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_set_has"] + pub fn hb_set_has(set: *const hb_set_t, codepoint: hb_codepoint_t) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_set_add"] + pub fn hb_set_add(set: *mut hb_set_t, codepoint: hb_codepoint_t); +} +extern "C" { + #[link_name = "\u{1}_hb_set_add_range"] + pub fn hb_set_add_range(set: *mut hb_set_t, first: hb_codepoint_t, last: hb_codepoint_t); +} +extern "C" { + #[link_name = "\u{1}_hb_set_del"] + pub fn hb_set_del(set: *mut hb_set_t, codepoint: hb_codepoint_t); +} +extern "C" { + #[link_name = "\u{1}_hb_set_del_range"] + pub fn hb_set_del_range(set: *mut hb_set_t, first: hb_codepoint_t, last: hb_codepoint_t); +} +extern "C" { + #[link_name = "\u{1}_hb_set_is_equal"] + pub fn hb_set_is_equal(set: *const hb_set_t, other: *const hb_set_t) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_set_is_subset"] + pub fn hb_set_is_subset(set: *const hb_set_t, larger_set: *const hb_set_t) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_set_set"] + pub fn hb_set_set(set: *mut hb_set_t, other: *const hb_set_t); +} +extern "C" { + #[link_name = "\u{1}_hb_set_union"] + pub fn hb_set_union(set: *mut hb_set_t, other: *const hb_set_t); +} +extern "C" { + #[link_name = "\u{1}_hb_set_intersect"] + pub fn hb_set_intersect(set: *mut hb_set_t, other: *const hb_set_t); +} +extern "C" { + #[link_name = "\u{1}_hb_set_subtract"] + pub fn hb_set_subtract(set: *mut hb_set_t, other: *const hb_set_t); +} +extern "C" { + #[link_name = "\u{1}_hb_set_symmetric_difference"] + pub fn hb_set_symmetric_difference(set: *mut hb_set_t, other: *const hb_set_t); +} +extern "C" { + #[link_name = "\u{1}_hb_set_get_population"] + pub fn hb_set_get_population(set: *const hb_set_t) -> ::std::os::raw::c_uint; +} +extern "C" { + #[link_name = "\u{1}_hb_set_get_min"] + pub fn hb_set_get_min(set: *const hb_set_t) -> hb_codepoint_t; +} +extern "C" { + #[link_name = "\u{1}_hb_set_get_max"] + pub fn hb_set_get_max(set: *const hb_set_t) -> hb_codepoint_t; +} +extern "C" { + #[link_name = "\u{1}_hb_set_next"] + pub fn hb_set_next(set: *const hb_set_t, codepoint: *mut hb_codepoint_t) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_set_previous"] + pub fn hb_set_previous(set: *const hb_set_t, codepoint: *mut hb_codepoint_t) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_set_next_range"] + pub fn hb_set_next_range( + set: *const hb_set_t, + first: *mut hb_codepoint_t, + last: *mut hb_codepoint_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_set_previous_range"] + pub fn hb_set_previous_range( + set: *const hb_set_t, + first: *mut hb_codepoint_t, + last: *mut hb_codepoint_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_face_count"] + pub fn hb_face_count(blob: *mut hb_blob_t) -> ::std::os::raw::c_uint; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hb_face_t { + _unused: [u8; 0], +} +extern "C" { + #[link_name = "\u{1}_hb_face_create"] + pub fn hb_face_create(blob: *mut hb_blob_t, index: ::std::os::raw::c_uint) -> *mut hb_face_t; +} +pub type hb_reference_table_func_t = ::std::option::Option< + unsafe extern "C" fn( + face: *mut hb_face_t, + tag: hb_tag_t, + user_data: *mut ::std::os::raw::c_void, + ) -> *mut hb_blob_t, +>; +extern "C" { + #[link_name = "\u{1}_hb_face_create_for_tables"] + pub fn hb_face_create_for_tables( + reference_table_func: hb_reference_table_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ) -> *mut hb_face_t; +} +extern "C" { + #[link_name = "\u{1}_hb_face_get_empty"] + pub fn hb_face_get_empty() -> *mut hb_face_t; +} +extern "C" { + #[link_name = "\u{1}_hb_face_reference"] + pub fn hb_face_reference(face: *mut hb_face_t) -> *mut hb_face_t; +} +extern "C" { + #[link_name = "\u{1}_hb_face_destroy"] + pub fn hb_face_destroy(face: *mut hb_face_t); +} +extern "C" { + #[link_name = "\u{1}_hb_face_set_user_data"] + pub fn hb_face_set_user_data( + face: *mut hb_face_t, + key: *mut hb_user_data_key_t, + data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + replace: hb_bool_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_face_get_user_data"] + pub fn hb_face_get_user_data( + face: *const hb_face_t, + key: *mut hb_user_data_key_t, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + #[link_name = "\u{1}_hb_face_make_immutable"] + pub fn hb_face_make_immutable(face: *mut hb_face_t); +} +extern "C" { + #[link_name = "\u{1}_hb_face_is_immutable"] + pub fn hb_face_is_immutable(face: *const hb_face_t) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_face_reference_table"] + pub fn hb_face_reference_table(face: *const hb_face_t, tag: hb_tag_t) -> *mut hb_blob_t; +} +extern "C" { + #[link_name = "\u{1}_hb_face_reference_blob"] + pub fn hb_face_reference_blob(face: *mut hb_face_t) -> *mut hb_blob_t; +} +extern "C" { + #[link_name = "\u{1}_hb_face_set_index"] + pub fn hb_face_set_index(face: *mut hb_face_t, index: ::std::os::raw::c_uint); +} +extern "C" { + #[link_name = "\u{1}_hb_face_get_index"] + pub fn hb_face_get_index(face: *const hb_face_t) -> ::std::os::raw::c_uint; +} +extern "C" { + #[link_name = "\u{1}_hb_face_set_upem"] + pub fn hb_face_set_upem(face: *mut hb_face_t, upem: ::std::os::raw::c_uint); +} +extern "C" { + #[link_name = "\u{1}_hb_face_get_upem"] + pub fn hb_face_get_upem(face: *const hb_face_t) -> ::std::os::raw::c_uint; +} +extern "C" { + #[link_name = "\u{1}_hb_face_set_glyph_count"] + pub fn hb_face_set_glyph_count(face: *mut hb_face_t, glyph_count: ::std::os::raw::c_uint); +} +extern "C" { + #[link_name = "\u{1}_hb_face_get_glyph_count"] + pub fn hb_face_get_glyph_count(face: *const hb_face_t) -> ::std::os::raw::c_uint; +} +extern "C" { + #[link_name = "\u{1}_hb_face_get_table_tags"] + pub fn hb_face_get_table_tags( + face: *const hb_face_t, + start_offset: ::std::os::raw::c_uint, + table_count: *mut ::std::os::raw::c_uint, + table_tags: *mut hb_tag_t, + ) -> ::std::os::raw::c_uint; +} +extern "C" { + #[link_name = "\u{1}_hb_face_collect_unicodes"] + pub fn hb_face_collect_unicodes(face: *mut hb_face_t, out: *mut hb_set_t); +} +extern "C" { + #[link_name = "\u{1}_hb_face_collect_variation_selectors"] + pub fn hb_face_collect_variation_selectors(face: *mut hb_face_t, out: *mut hb_set_t); +} +extern "C" { + #[link_name = "\u{1}_hb_face_collect_variation_unicodes"] + pub fn hb_face_collect_variation_unicodes( + face: *mut hb_face_t, + variation_selector: hb_codepoint_t, + out: *mut hb_set_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_face_builder_create"] + pub fn hb_face_builder_create() -> *mut hb_face_t; +} +extern "C" { + #[link_name = "\u{1}_hb_face_builder_add_table"] + pub fn hb_face_builder_add_table( + face: *mut hb_face_t, + tag: hb_tag_t, + blob: *mut hb_blob_t, + ) -> hb_bool_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hb_font_t { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hb_font_funcs_t { + _unused: [u8; 0], +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_create"] + pub fn hb_font_funcs_create() -> *mut hb_font_funcs_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_get_empty"] + pub fn hb_font_funcs_get_empty() -> *mut hb_font_funcs_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_reference"] + pub fn hb_font_funcs_reference(ffuncs: *mut hb_font_funcs_t) -> *mut hb_font_funcs_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_destroy"] + pub fn hb_font_funcs_destroy(ffuncs: *mut hb_font_funcs_t); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_user_data"] + pub fn hb_font_funcs_set_user_data( + ffuncs: *mut hb_font_funcs_t, + key: *mut hb_user_data_key_t, + data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + replace: hb_bool_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_get_user_data"] + pub fn hb_font_funcs_get_user_data( + ffuncs: *mut hb_font_funcs_t, + key: *mut hb_user_data_key_t, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_make_immutable"] + pub fn hb_font_funcs_make_immutable(ffuncs: *mut hb_font_funcs_t); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_is_immutable"] + pub fn hb_font_funcs_is_immutable(ffuncs: *mut hb_font_funcs_t) -> hb_bool_t; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hb_font_extents_t { + pub ascender: hb_position_t, + pub descender: hb_position_t, + pub line_gap: hb_position_t, + pub reserved9: hb_position_t, + pub reserved8: hb_position_t, + pub reserved7: hb_position_t, + pub reserved6: hb_position_t, + pub reserved5: hb_position_t, + pub reserved4: hb_position_t, + pub reserved3: hb_position_t, + pub reserved2: hb_position_t, + pub reserved1: hb_position_t, +} +#[test] +fn bindgen_test_layout_hb_font_extents_t() { + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(hb_font_extents_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(hb_font_extents_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ascender as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(ascender) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).descender as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(descender) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).line_gap as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(line_gap) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved9 as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved9) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved8 as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved8) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved7 as *const _ as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved7) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved6 as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved6) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved5 as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved5) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved4 as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved4) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved3 as *const _ as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved3) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved2 as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved2) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).reserved1 as *const _ as usize }, + 44usize, + concat!( + "Offset of field: ", + stringify!(hb_font_extents_t), + "::", + stringify!(reserved1) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hb_glyph_extents_t { + pub x_bearing: hb_position_t, + pub y_bearing: hb_position_t, + pub width: hb_position_t, + pub height: hb_position_t, +} +#[test] +fn bindgen_test_layout_hb_glyph_extents_t() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(hb_glyph_extents_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(hb_glyph_extents_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x_bearing as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_extents_t), + "::", + stringify!(x_bearing) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y_bearing as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_extents_t), + "::", + stringify!(y_bearing) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_extents_t), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_extents_t), + "::", + stringify!(height) + ) + ); +} +pub type hb_font_get_font_extents_func_t = ::std::option::Option< + unsafe extern "C" fn( + font: *mut hb_font_t, + font_data: *mut ::std::os::raw::c_void, + extents: *mut hb_font_extents_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_bool_t, +>; +pub type hb_font_get_font_h_extents_func_t = hb_font_get_font_extents_func_t; +pub type hb_font_get_font_v_extents_func_t = hb_font_get_font_extents_func_t; +pub type hb_font_get_nominal_glyph_func_t = ::std::option::Option< + unsafe extern "C" fn( + font: *mut hb_font_t, + font_data: *mut ::std::os::raw::c_void, + unicode: hb_codepoint_t, + glyph: *mut hb_codepoint_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_bool_t, +>; +pub type hb_font_get_variation_glyph_func_t = ::std::option::Option< + unsafe extern "C" fn( + font: *mut hb_font_t, + font_data: *mut ::std::os::raw::c_void, + unicode: hb_codepoint_t, + variation_selector: hb_codepoint_t, + glyph: *mut hb_codepoint_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_bool_t, +>; +pub type hb_font_get_nominal_glyphs_func_t = ::std::option::Option< + unsafe extern "C" fn( + font: *mut hb_font_t, + font_data: *mut ::std::os::raw::c_void, + count: ::std::os::raw::c_uint, + first_unicode: *const hb_codepoint_t, + unicode_stride: ::std::os::raw::c_uint, + first_glyph: *mut hb_codepoint_t, + glyph_stride: ::std::os::raw::c_uint, + user_data: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_uint, +>; +pub type hb_font_get_glyph_advance_func_t = ::std::option::Option< + unsafe extern "C" fn( + font: *mut hb_font_t, + font_data: *mut ::std::os::raw::c_void, + glyph: hb_codepoint_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_position_t, +>; +pub type hb_font_get_glyph_h_advance_func_t = hb_font_get_glyph_advance_func_t; +pub type hb_font_get_glyph_v_advance_func_t = hb_font_get_glyph_advance_func_t; +pub type hb_font_get_glyph_advances_func_t = ::std::option::Option< + unsafe extern "C" fn( + font: *mut hb_font_t, + font_data: *mut ::std::os::raw::c_void, + count: ::std::os::raw::c_uint, + first_glyph: *const hb_codepoint_t, + glyph_stride: ::std::os::raw::c_uint, + first_advance: *mut hb_position_t, + advance_stride: ::std::os::raw::c_uint, + user_data: *mut ::std::os::raw::c_void, + ), +>; +pub type hb_font_get_glyph_h_advances_func_t = hb_font_get_glyph_advances_func_t; +pub type hb_font_get_glyph_v_advances_func_t = hb_font_get_glyph_advances_func_t; +pub type hb_font_get_glyph_origin_func_t = ::std::option::Option< + unsafe extern "C" fn( + font: *mut hb_font_t, + font_data: *mut ::std::os::raw::c_void, + glyph: hb_codepoint_t, + x: *mut hb_position_t, + y: *mut hb_position_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_bool_t, +>; +pub type hb_font_get_glyph_h_origin_func_t = hb_font_get_glyph_origin_func_t; +pub type hb_font_get_glyph_v_origin_func_t = hb_font_get_glyph_origin_func_t; +pub type hb_font_get_glyph_extents_func_t = ::std::option::Option< + unsafe extern "C" fn( + font: *mut hb_font_t, + font_data: *mut ::std::os::raw::c_void, + glyph: hb_codepoint_t, + extents: *mut hb_glyph_extents_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_bool_t, +>; +pub type hb_font_get_glyph_contour_point_func_t = ::std::option::Option< + unsafe extern "C" fn( + font: *mut hb_font_t, + font_data: *mut ::std::os::raw::c_void, + glyph: hb_codepoint_t, + point_index: ::std::os::raw::c_uint, + x: *mut hb_position_t, + y: *mut hb_position_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_bool_t, +>; +pub type hb_font_get_glyph_name_func_t = ::std::option::Option< + unsafe extern "C" fn( + font: *mut hb_font_t, + font_data: *mut ::std::os::raw::c_void, + glyph: hb_codepoint_t, + name: *mut ::std::os::raw::c_char, + size: ::std::os::raw::c_uint, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_bool_t, +>; +pub type hb_font_get_glyph_from_name_func_t = ::std::option::Option< + unsafe extern "C" fn( + font: *mut hb_font_t, + font_data: *mut ::std::os::raw::c_void, + name: *const ::std::os::raw::c_char, + len: ::std::os::raw::c_int, + glyph: *mut hb_codepoint_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_bool_t, +>; +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_font_h_extents_func"] + pub fn hb_font_funcs_set_font_h_extents_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_font_h_extents_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_font_v_extents_func"] + pub fn hb_font_funcs_set_font_v_extents_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_font_v_extents_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_nominal_glyph_func"] + pub fn hb_font_funcs_set_nominal_glyph_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_nominal_glyph_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_nominal_glyphs_func"] + pub fn hb_font_funcs_set_nominal_glyphs_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_nominal_glyphs_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_variation_glyph_func"] + pub fn hb_font_funcs_set_variation_glyph_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_variation_glyph_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_glyph_h_advance_func"] + pub fn hb_font_funcs_set_glyph_h_advance_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_glyph_h_advance_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_glyph_v_advance_func"] + pub fn hb_font_funcs_set_glyph_v_advance_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_glyph_v_advance_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_glyph_h_advances_func"] + pub fn hb_font_funcs_set_glyph_h_advances_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_glyph_h_advances_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_glyph_v_advances_func"] + pub fn hb_font_funcs_set_glyph_v_advances_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_glyph_v_advances_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_glyph_h_origin_func"] + pub fn hb_font_funcs_set_glyph_h_origin_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_glyph_h_origin_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_glyph_v_origin_func"] + pub fn hb_font_funcs_set_glyph_v_origin_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_glyph_v_origin_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_glyph_extents_func"] + pub fn hb_font_funcs_set_glyph_extents_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_glyph_extents_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_glyph_contour_point_func"] + pub fn hb_font_funcs_set_glyph_contour_point_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_glyph_contour_point_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_glyph_name_func"] + pub fn hb_font_funcs_set_glyph_name_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_glyph_name_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_glyph_from_name_func"] + pub fn hb_font_funcs_set_glyph_from_name_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_glyph_from_name_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_h_extents"] + pub fn hb_font_get_h_extents( + font: *mut hb_font_t, + extents: *mut hb_font_extents_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_v_extents"] + pub fn hb_font_get_v_extents( + font: *mut hb_font_t, + extents: *mut hb_font_extents_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_nominal_glyph"] + pub fn hb_font_get_nominal_glyph( + font: *mut hb_font_t, + unicode: hb_codepoint_t, + glyph: *mut hb_codepoint_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_variation_glyph"] + pub fn hb_font_get_variation_glyph( + font: *mut hb_font_t, + unicode: hb_codepoint_t, + variation_selector: hb_codepoint_t, + glyph: *mut hb_codepoint_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_h_advance"] + pub fn hb_font_get_glyph_h_advance( + font: *mut hb_font_t, + glyph: hb_codepoint_t, + ) -> hb_position_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_v_advance"] + pub fn hb_font_get_glyph_v_advance( + font: *mut hb_font_t, + glyph: hb_codepoint_t, + ) -> hb_position_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_h_advances"] + pub fn hb_font_get_glyph_h_advances( + font: *mut hb_font_t, + count: ::std::os::raw::c_uint, + first_glyph: *const hb_codepoint_t, + glyph_stride: ::std::os::raw::c_uint, + first_advance: *mut hb_position_t, + advance_stride: ::std::os::raw::c_uint, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_v_advances"] + pub fn hb_font_get_glyph_v_advances( + font: *mut hb_font_t, + count: ::std::os::raw::c_uint, + first_glyph: *const hb_codepoint_t, + glyph_stride: ::std::os::raw::c_uint, + first_advance: *mut hb_position_t, + advance_stride: ::std::os::raw::c_uint, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_h_origin"] + pub fn hb_font_get_glyph_h_origin( + font: *mut hb_font_t, + glyph: hb_codepoint_t, + x: *mut hb_position_t, + y: *mut hb_position_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_v_origin"] + pub fn hb_font_get_glyph_v_origin( + font: *mut hb_font_t, + glyph: hb_codepoint_t, + x: *mut hb_position_t, + y: *mut hb_position_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_extents"] + pub fn hb_font_get_glyph_extents( + font: *mut hb_font_t, + glyph: hb_codepoint_t, + extents: *mut hb_glyph_extents_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_contour_point"] + pub fn hb_font_get_glyph_contour_point( + font: *mut hb_font_t, + glyph: hb_codepoint_t, + point_index: ::std::os::raw::c_uint, + x: *mut hb_position_t, + y: *mut hb_position_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_name"] + pub fn hb_font_get_glyph_name( + font: *mut hb_font_t, + glyph: hb_codepoint_t, + name: *mut ::std::os::raw::c_char, + size: ::std::os::raw::c_uint, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_from_name"] + pub fn hb_font_get_glyph_from_name( + font: *mut hb_font_t, + name: *const ::std::os::raw::c_char, + len: ::std::os::raw::c_int, + glyph: *mut hb_codepoint_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph"] + pub fn hb_font_get_glyph( + font: *mut hb_font_t, + unicode: hb_codepoint_t, + variation_selector: hb_codepoint_t, + glyph: *mut hb_codepoint_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_extents_for_direction"] + pub fn hb_font_get_extents_for_direction( + font: *mut hb_font_t, + direction: hb_direction_t, + extents: *mut hb_font_extents_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_advance_for_direction"] + pub fn hb_font_get_glyph_advance_for_direction( + font: *mut hb_font_t, + glyph: hb_codepoint_t, + direction: hb_direction_t, + x: *mut hb_position_t, + y: *mut hb_position_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_advances_for_direction"] + pub fn hb_font_get_glyph_advances_for_direction( + font: *mut hb_font_t, + direction: hb_direction_t, + count: ::std::os::raw::c_uint, + first_glyph: *const hb_codepoint_t, + glyph_stride: ::std::os::raw::c_uint, + first_advance: *mut hb_position_t, + advance_stride: ::std::os::raw::c_uint, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_origin_for_direction"] + pub fn hb_font_get_glyph_origin_for_direction( + font: *mut hb_font_t, + glyph: hb_codepoint_t, + direction: hb_direction_t, + x: *mut hb_position_t, + y: *mut hb_position_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_add_glyph_origin_for_direction"] + pub fn hb_font_add_glyph_origin_for_direction( + font: *mut hb_font_t, + glyph: hb_codepoint_t, + direction: hb_direction_t, + x: *mut hb_position_t, + y: *mut hb_position_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_subtract_glyph_origin_for_direction"] + pub fn hb_font_subtract_glyph_origin_for_direction( + font: *mut hb_font_t, + glyph: hb_codepoint_t, + direction: hb_direction_t, + x: *mut hb_position_t, + y: *mut hb_position_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_extents_for_origin"] + pub fn hb_font_get_glyph_extents_for_origin( + font: *mut hb_font_t, + glyph: hb_codepoint_t, + direction: hb_direction_t, + extents: *mut hb_glyph_extents_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_contour_point_for_origin"] + pub fn hb_font_get_glyph_contour_point_for_origin( + font: *mut hb_font_t, + glyph: hb_codepoint_t, + point_index: ::std::os::raw::c_uint, + direction: hb_direction_t, + x: *mut hb_position_t, + y: *mut hb_position_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_glyph_to_string"] + pub fn hb_font_glyph_to_string( + font: *mut hb_font_t, + glyph: hb_codepoint_t, + s: *mut ::std::os::raw::c_char, + size: ::std::os::raw::c_uint, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_glyph_from_string"] + pub fn hb_font_glyph_from_string( + font: *mut hb_font_t, + s: *const ::std::os::raw::c_char, + len: ::std::os::raw::c_int, + glyph: *mut hb_codepoint_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_create"] + pub fn hb_font_create(face: *mut hb_face_t) -> *mut hb_font_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_create_sub_font"] + pub fn hb_font_create_sub_font(parent: *mut hb_font_t) -> *mut hb_font_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_empty"] + pub fn hb_font_get_empty() -> *mut hb_font_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_reference"] + pub fn hb_font_reference(font: *mut hb_font_t) -> *mut hb_font_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_destroy"] + pub fn hb_font_destroy(font: *mut hb_font_t); +} +extern "C" { + #[link_name = "\u{1}_hb_font_set_user_data"] + pub fn hb_font_set_user_data( + font: *mut hb_font_t, + key: *mut hb_user_data_key_t, + data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + replace: hb_bool_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_user_data"] + pub fn hb_font_get_user_data( + font: *mut hb_font_t, + key: *mut hb_user_data_key_t, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + #[link_name = "\u{1}_hb_font_make_immutable"] + pub fn hb_font_make_immutable(font: *mut hb_font_t); +} +extern "C" { + #[link_name = "\u{1}_hb_font_is_immutable"] + pub fn hb_font_is_immutable(font: *mut hb_font_t) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_set_parent"] + pub fn hb_font_set_parent(font: *mut hb_font_t, parent: *mut hb_font_t); +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_parent"] + pub fn hb_font_get_parent(font: *mut hb_font_t) -> *mut hb_font_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_set_face"] + pub fn hb_font_set_face(font: *mut hb_font_t, face: *mut hb_face_t); +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_face"] + pub fn hb_font_get_face(font: *mut hb_font_t) -> *mut hb_face_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_set_funcs"] + pub fn hb_font_set_funcs( + font: *mut hb_font_t, + klass: *mut hb_font_funcs_t, + font_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_set_funcs_data"] + pub fn hb_font_set_funcs_data( + font: *mut hb_font_t, + font_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_set_scale"] + pub fn hb_font_set_scale( + font: *mut hb_font_t, + x_scale: ::std::os::raw::c_int, + y_scale: ::std::os::raw::c_int, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_scale"] + pub fn hb_font_get_scale( + font: *mut hb_font_t, + x_scale: *mut ::std::os::raw::c_int, + y_scale: *mut ::std::os::raw::c_int, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_set_ppem"] + pub fn hb_font_set_ppem( + font: *mut hb_font_t, + x_ppem: ::std::os::raw::c_uint, + y_ppem: ::std::os::raw::c_uint, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_ppem"] + pub fn hb_font_get_ppem( + font: *mut hb_font_t, + x_ppem: *mut ::std::os::raw::c_uint, + y_ppem: *mut ::std::os::raw::c_uint, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_set_ptem"] + pub fn hb_font_set_ptem(font: *mut hb_font_t, ptem: f32); +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_ptem"] + pub fn hb_font_get_ptem(font: *mut hb_font_t) -> f32; +} +extern "C" { + #[link_name = "\u{1}_hb_font_set_variations"] + pub fn hb_font_set_variations( + font: *mut hb_font_t, + variations: *const hb_variation_t, + variations_length: ::std::os::raw::c_uint, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_set_var_coords_design"] + pub fn hb_font_set_var_coords_design( + font: *mut hb_font_t, + coords: *const f32, + coords_length: ::std::os::raw::c_uint, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_set_var_coords_normalized"] + pub fn hb_font_set_var_coords_normalized( + font: *mut hb_font_t, + coords: *const ::std::os::raw::c_int, + coords_length: ::std::os::raw::c_uint, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_var_coords_normalized"] + pub fn hb_font_get_var_coords_normalized( + font: *mut hb_font_t, + length: *mut ::std::os::raw::c_uint, + ) -> *const ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct hb_glyph_info_t { + pub codepoint: hb_codepoint_t, + pub mask: hb_mask_t, + pub cluster: u32, + pub var1: hb_var_int_t, + pub var2: hb_var_int_t, +} +#[test] +fn bindgen_test_layout_hb_glyph_info_t() { + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(hb_glyph_info_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(hb_glyph_info_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).codepoint as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_info_t), + "::", + stringify!(codepoint) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).mask as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_info_t), + "::", + stringify!(mask) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cluster as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_info_t), + "::", + stringify!(cluster) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).var1 as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_info_t), + "::", + stringify!(var1) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).var2 as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_info_t), + "::", + stringify!(var2) + ) + ); +} +impl hb_glyph_flags_t { + pub const HB_GLYPH_FLAG_DEFINED: hb_glyph_flags_t = + hb_glyph_flags_t::HB_GLYPH_FLAG_UNSAFE_TO_BREAK; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum hb_glyph_flags_t { + HB_GLYPH_FLAG_UNSAFE_TO_BREAK = 1, +} +extern "C" { + #[link_name = "\u{1}_hb_glyph_info_get_glyph_flags"] + pub fn hb_glyph_info_get_glyph_flags(info: *const hb_glyph_info_t) -> hb_glyph_flags_t; +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct hb_glyph_position_t { + pub x_advance: hb_position_t, + pub y_advance: hb_position_t, + pub x_offset: hb_position_t, + pub y_offset: hb_position_t, + pub var: hb_var_int_t, +} +#[test] +fn bindgen_test_layout_hb_glyph_position_t() { + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(hb_glyph_position_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(hb_glyph_position_t)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x_advance as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_position_t), + "::", + stringify!(x_advance) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y_advance as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_position_t), + "::", + stringify!(y_advance) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x_offset as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_position_t), + "::", + stringify!(x_offset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y_offset as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_position_t), + "::", + stringify!(y_offset) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).var as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hb_glyph_position_t), + "::", + stringify!(var) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hb_segment_properties_t { + pub direction: hb_direction_t, + pub script: hb_script_t, + pub language: hb_language_t, + pub reserved1: *mut ::std::os::raw::c_void, + pub reserved2: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_hb_segment_properties_t() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(hb_segment_properties_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(hb_segment_properties_t)) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).direction as *const _ as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(hb_segment_properties_t), + "::", + stringify!(direction) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).script as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(hb_segment_properties_t), + "::", + stringify!(script) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).language as *const _ as usize + }, + 8usize, + concat!( + "Offset of field: ", + stringify!(hb_segment_properties_t), + "::", + stringify!(language) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).reserved1 as *const _ as usize + }, + 16usize, + concat!( + "Offset of field: ", + stringify!(hb_segment_properties_t), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).reserved2 as *const _ as usize + }, + 24usize, + concat!( + "Offset of field: ", + stringify!(hb_segment_properties_t), + "::", + stringify!(reserved2) + ) + ); +} +extern "C" { + #[link_name = "\u{1}_hb_segment_properties_equal"] + pub fn hb_segment_properties_equal( + a: *const hb_segment_properties_t, + b: *const hb_segment_properties_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_segment_properties_hash"] + pub fn hb_segment_properties_hash(p: *const hb_segment_properties_t) -> ::std::os::raw::c_uint; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hb_buffer_t { + _unused: [u8; 0], +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_create"] + pub fn hb_buffer_create() -> *mut hb_buffer_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_get_empty"] + pub fn hb_buffer_get_empty() -> *mut hb_buffer_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_reference"] + pub fn hb_buffer_reference(buffer: *mut hb_buffer_t) -> *mut hb_buffer_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_destroy"] + pub fn hb_buffer_destroy(buffer: *mut hb_buffer_t); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_set_user_data"] + pub fn hb_buffer_set_user_data( + buffer: *mut hb_buffer_t, + key: *mut hb_user_data_key_t, + data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + replace: hb_bool_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_get_user_data"] + pub fn hb_buffer_get_user_data( + buffer: *mut hb_buffer_t, + key: *mut hb_user_data_key_t, + ) -> *mut ::std::os::raw::c_void; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum hb_buffer_content_type_t { + HB_BUFFER_CONTENT_TYPE_INVALID = 0, + HB_BUFFER_CONTENT_TYPE_UNICODE = 1, + HB_BUFFER_CONTENT_TYPE_GLYPHS = 2, +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_set_content_type"] + pub fn hb_buffer_set_content_type( + buffer: *mut hb_buffer_t, + content_type: hb_buffer_content_type_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_get_content_type"] + pub fn hb_buffer_get_content_type(buffer: *mut hb_buffer_t) -> hb_buffer_content_type_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_set_unicode_funcs"] + pub fn hb_buffer_set_unicode_funcs( + buffer: *mut hb_buffer_t, + unicode_funcs: *mut hb_unicode_funcs_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_get_unicode_funcs"] + pub fn hb_buffer_get_unicode_funcs(buffer: *mut hb_buffer_t) -> *mut hb_unicode_funcs_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_set_direction"] + pub fn hb_buffer_set_direction(buffer: *mut hb_buffer_t, direction: hb_direction_t); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_get_direction"] + pub fn hb_buffer_get_direction(buffer: *mut hb_buffer_t) -> hb_direction_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_set_script"] + pub fn hb_buffer_set_script(buffer: *mut hb_buffer_t, script: hb_script_t); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_get_script"] + pub fn hb_buffer_get_script(buffer: *mut hb_buffer_t) -> hb_script_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_set_language"] + pub fn hb_buffer_set_language(buffer: *mut hb_buffer_t, language: hb_language_t); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_get_language"] + pub fn hb_buffer_get_language(buffer: *mut hb_buffer_t) -> hb_language_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_set_segment_properties"] + pub fn hb_buffer_set_segment_properties( + buffer: *mut hb_buffer_t, + props: *const hb_segment_properties_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_get_segment_properties"] + pub fn hb_buffer_get_segment_properties( + buffer: *mut hb_buffer_t, + props: *mut hb_segment_properties_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_guess_segment_properties"] + pub fn hb_buffer_guess_segment_properties(buffer: *mut hb_buffer_t); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum hb_buffer_flags_t { + HB_BUFFER_FLAG_DEFAULT = 0, + HB_BUFFER_FLAG_BOT = 1, + HB_BUFFER_FLAG_EOT = 2, + HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES = 4, + HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES = 8, + HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE = 16, +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_set_flags"] + pub fn hb_buffer_set_flags(buffer: *mut hb_buffer_t, flags: hb_buffer_flags_t); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_get_flags"] + pub fn hb_buffer_get_flags(buffer: *mut hb_buffer_t) -> hb_buffer_flags_t; +} +impl hb_buffer_cluster_level_t { + pub const HB_BUFFER_CLUSTER_LEVEL_DEFAULT: hb_buffer_cluster_level_t = + hb_buffer_cluster_level_t::HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum hb_buffer_cluster_level_t { + HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES = 0, + HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS = 1, + HB_BUFFER_CLUSTER_LEVEL_CHARACTERS = 2, +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_set_cluster_level"] + pub fn hb_buffer_set_cluster_level( + buffer: *mut hb_buffer_t, + cluster_level: hb_buffer_cluster_level_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_get_cluster_level"] + pub fn hb_buffer_get_cluster_level(buffer: *mut hb_buffer_t) -> hb_buffer_cluster_level_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_set_replacement_codepoint"] + pub fn hb_buffer_set_replacement_codepoint( + buffer: *mut hb_buffer_t, + replacement: hb_codepoint_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_get_replacement_codepoint"] + pub fn hb_buffer_get_replacement_codepoint(buffer: *mut hb_buffer_t) -> hb_codepoint_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_set_invisible_glyph"] + pub fn hb_buffer_set_invisible_glyph(buffer: *mut hb_buffer_t, invisible: hb_codepoint_t); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_get_invisible_glyph"] + pub fn hb_buffer_get_invisible_glyph(buffer: *mut hb_buffer_t) -> hb_codepoint_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_reset"] + pub fn hb_buffer_reset(buffer: *mut hb_buffer_t); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_clear_contents"] + pub fn hb_buffer_clear_contents(buffer: *mut hb_buffer_t); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_pre_allocate"] + pub fn hb_buffer_pre_allocate( + buffer: *mut hb_buffer_t, + size: ::std::os::raw::c_uint, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_allocation_successful"] + pub fn hb_buffer_allocation_successful(buffer: *mut hb_buffer_t) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_reverse"] + pub fn hb_buffer_reverse(buffer: *mut hb_buffer_t); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_reverse_range"] + pub fn hb_buffer_reverse_range( + buffer: *mut hb_buffer_t, + start: ::std::os::raw::c_uint, + end: ::std::os::raw::c_uint, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_reverse_clusters"] + pub fn hb_buffer_reverse_clusters(buffer: *mut hb_buffer_t); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_add"] + pub fn hb_buffer_add( + buffer: *mut hb_buffer_t, + codepoint: hb_codepoint_t, + cluster: ::std::os::raw::c_uint, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_add_utf8"] + pub fn hb_buffer_add_utf8( + buffer: *mut hb_buffer_t, + text: *const ::std::os::raw::c_char, + text_length: ::std::os::raw::c_int, + item_offset: ::std::os::raw::c_uint, + item_length: ::std::os::raw::c_int, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_add_utf16"] + pub fn hb_buffer_add_utf16( + buffer: *mut hb_buffer_t, + text: *const u16, + text_length: ::std::os::raw::c_int, + item_offset: ::std::os::raw::c_uint, + item_length: ::std::os::raw::c_int, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_add_utf32"] + pub fn hb_buffer_add_utf32( + buffer: *mut hb_buffer_t, + text: *const u32, + text_length: ::std::os::raw::c_int, + item_offset: ::std::os::raw::c_uint, + item_length: ::std::os::raw::c_int, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_add_latin1"] + pub fn hb_buffer_add_latin1( + buffer: *mut hb_buffer_t, + text: *const u8, + text_length: ::std::os::raw::c_int, + item_offset: ::std::os::raw::c_uint, + item_length: ::std::os::raw::c_int, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_add_codepoints"] + pub fn hb_buffer_add_codepoints( + buffer: *mut hb_buffer_t, + text: *const hb_codepoint_t, + text_length: ::std::os::raw::c_int, + item_offset: ::std::os::raw::c_uint, + item_length: ::std::os::raw::c_int, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_append"] + pub fn hb_buffer_append( + buffer: *mut hb_buffer_t, + source: *mut hb_buffer_t, + start: ::std::os::raw::c_uint, + end: ::std::os::raw::c_uint, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_set_length"] + pub fn hb_buffer_set_length( + buffer: *mut hb_buffer_t, + length: ::std::os::raw::c_uint, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_get_length"] + pub fn hb_buffer_get_length(buffer: *mut hb_buffer_t) -> ::std::os::raw::c_uint; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_get_glyph_infos"] + pub fn hb_buffer_get_glyph_infos( + buffer: *mut hb_buffer_t, + length: *mut ::std::os::raw::c_uint, + ) -> *mut hb_glyph_info_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_get_glyph_positions"] + pub fn hb_buffer_get_glyph_positions( + buffer: *mut hb_buffer_t, + length: *mut ::std::os::raw::c_uint, + ) -> *mut hb_glyph_position_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_normalize_glyphs"] + pub fn hb_buffer_normalize_glyphs(buffer: *mut hb_buffer_t); +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum hb_buffer_serialize_flags_t { + HB_BUFFER_SERIALIZE_FLAG_DEFAULT = 0, + HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS = 1, + HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS = 2, + HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES = 4, + HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS = 8, + HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS = 16, + HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES = 32, +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum hb_buffer_serialize_format_t { + HB_BUFFER_SERIALIZE_FORMAT_TEXT = 1413830740, + HB_BUFFER_SERIALIZE_FORMAT_JSON = 1246973774, + HB_BUFFER_SERIALIZE_FORMAT_INVALID = 0, +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_serialize_format_from_string"] + pub fn hb_buffer_serialize_format_from_string( + str: *const ::std::os::raw::c_char, + len: ::std::os::raw::c_int, + ) -> hb_buffer_serialize_format_t; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_serialize_format_to_string"] + pub fn hb_buffer_serialize_format_to_string( + format: hb_buffer_serialize_format_t, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_serialize_list_formats"] + pub fn hb_buffer_serialize_list_formats() -> *mut *const ::std::os::raw::c_char; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_serialize_glyphs"] + pub fn hb_buffer_serialize_glyphs( + buffer: *mut hb_buffer_t, + start: ::std::os::raw::c_uint, + end: ::std::os::raw::c_uint, + buf: *mut ::std::os::raw::c_char, + buf_size: ::std::os::raw::c_uint, + buf_consumed: *mut ::std::os::raw::c_uint, + font: *mut hb_font_t, + format: hb_buffer_serialize_format_t, + flags: hb_buffer_serialize_flags_t, + ) -> ::std::os::raw::c_uint; +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_deserialize_glyphs"] + pub fn hb_buffer_deserialize_glyphs( + buffer: *mut hb_buffer_t, + buf: *const ::std::os::raw::c_char, + buf_len: ::std::os::raw::c_int, + end_ptr: *mut *const ::std::os::raw::c_char, + font: *mut hb_font_t, + format: hb_buffer_serialize_format_t, + ) -> hb_bool_t; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum hb_buffer_diff_flags_t { + HB_BUFFER_DIFF_FLAG_EQUAL = 0, + HB_BUFFER_DIFF_FLAG_CONTENT_TYPE_MISMATCH = 1, + HB_BUFFER_DIFF_FLAG_LENGTH_MISMATCH = 2, + HB_BUFFER_DIFF_FLAG_NOTDEF_PRESENT = 4, + HB_BUFFER_DIFF_FLAG_DOTTED_CIRCLE_PRESENT = 8, + HB_BUFFER_DIFF_FLAG_CODEPOINT_MISMATCH = 16, + HB_BUFFER_DIFF_FLAG_CLUSTER_MISMATCH = 32, + HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH = 64, + HB_BUFFER_DIFF_FLAG_POSITION_MISMATCH = 128, +} +extern "C" { + #[link_name = "\u{1}_hb_buffer_diff"] + pub fn hb_buffer_diff( + buffer: *mut hb_buffer_t, + reference: *mut hb_buffer_t, + dottedcircle_glyph: hb_codepoint_t, + position_fuzz: ::std::os::raw::c_uint, + ) -> hb_buffer_diff_flags_t; +} +pub type hb_buffer_message_func_t = ::std::option::Option< + unsafe extern "C" fn( + buffer: *mut hb_buffer_t, + font: *mut hb_font_t, + message: *const ::std::os::raw::c_char, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_bool_t, +>; +extern "C" { + #[link_name = "\u{1}_hb_buffer_set_message_func"] + pub fn hb_buffer_set_message_func( + buffer: *mut hb_buffer_t, + func: hb_buffer_message_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +pub type hb_font_get_glyph_func_t = ::std::option::Option< + unsafe extern "C" fn( + font: *mut hb_font_t, + font_data: *mut ::std::os::raw::c_void, + unicode: hb_codepoint_t, + variation_selector: hb_codepoint_t, + glyph: *mut hb_codepoint_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_bool_t, +>; +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_glyph_func"] + pub fn hb_font_funcs_set_glyph_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_glyph_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_set_invert"] + pub fn hb_set_invert(set: *mut hb_set_t); +} +pub type hb_unicode_eastasian_width_func_t = ::std::option::Option< + unsafe extern "C" fn( + ufuncs: *mut hb_unicode_funcs_t, + unicode: hb_codepoint_t, + user_data: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_uint, +>; +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_set_eastasian_width_func"] + pub fn hb_unicode_funcs_set_eastasian_width_func( + ufuncs: *mut hb_unicode_funcs_t, + func: hb_unicode_eastasian_width_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_eastasian_width"] + pub fn hb_unicode_eastasian_width( + ufuncs: *mut hb_unicode_funcs_t, + unicode: hb_codepoint_t, + ) -> ::std::os::raw::c_uint; +} +pub type hb_unicode_decompose_compatibility_func_t = ::std::option::Option< + unsafe extern "C" fn( + ufuncs: *mut hb_unicode_funcs_t, + u: hb_codepoint_t, + decomposed: *mut hb_codepoint_t, + user_data: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_uint, +>; +extern "C" { + #[link_name = "\u{1}_hb_unicode_funcs_set_decompose_compatibility_func"] + pub fn hb_unicode_funcs_set_decompose_compatibility_func( + ufuncs: *mut hb_unicode_funcs_t, + func: hb_unicode_decompose_compatibility_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_unicode_decompose_compatibility"] + pub fn hb_unicode_decompose_compatibility( + ufuncs: *mut hb_unicode_funcs_t, + u: hb_codepoint_t, + decomposed: *mut hb_codepoint_t, + ) -> ::std::os::raw::c_uint; +} +pub type hb_font_get_glyph_kerning_func_t = ::std::option::Option< + unsafe extern "C" fn( + font: *mut hb_font_t, + font_data: *mut ::std::os::raw::c_void, + first_glyph: hb_codepoint_t, + second_glyph: hb_codepoint_t, + user_data: *mut ::std::os::raw::c_void, + ) -> hb_position_t, +>; +pub type hb_font_get_glyph_h_kerning_func_t = hb_font_get_glyph_kerning_func_t; +pub type hb_font_get_glyph_v_kerning_func_t = hb_font_get_glyph_kerning_func_t; +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_glyph_h_kerning_func"] + pub fn hb_font_funcs_set_glyph_h_kerning_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_glyph_h_kerning_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_funcs_set_glyph_v_kerning_func"] + pub fn hb_font_funcs_set_glyph_v_kerning_func( + ffuncs: *mut hb_font_funcs_t, + func: hb_font_get_glyph_v_kerning_func_t, + user_data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_h_kerning"] + pub fn hb_font_get_glyph_h_kerning( + font: *mut hb_font_t, + left_glyph: hb_codepoint_t, + right_glyph: hb_codepoint_t, + ) -> hb_position_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_v_kerning"] + pub fn hb_font_get_glyph_v_kerning( + font: *mut hb_font_t, + top_glyph: hb_codepoint_t, + bottom_glyph: hb_codepoint_t, + ) -> hb_position_t; +} +extern "C" { + #[link_name = "\u{1}_hb_font_get_glyph_kerning_for_direction"] + pub fn hb_font_get_glyph_kerning_for_direction( + font: *mut hb_font_t, + first_glyph: hb_codepoint_t, + second_glyph: hb_codepoint_t, + direction: hb_direction_t, + x: *mut hb_position_t, + y: *mut hb_position_t, + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hb_map_t { + _unused: [u8; 0], +} +extern "C" { + #[link_name = "\u{1}_hb_map_create"] + pub fn hb_map_create() -> *mut hb_map_t; +} +extern "C" { + #[link_name = "\u{1}_hb_map_get_empty"] + pub fn hb_map_get_empty() -> *mut hb_map_t; +} +extern "C" { + #[link_name = "\u{1}_hb_map_reference"] + pub fn hb_map_reference(map: *mut hb_map_t) -> *mut hb_map_t; +} +extern "C" { + #[link_name = "\u{1}_hb_map_destroy"] + pub fn hb_map_destroy(map: *mut hb_map_t); +} +extern "C" { + #[link_name = "\u{1}_hb_map_set_user_data"] + pub fn hb_map_set_user_data( + map: *mut hb_map_t, + key: *mut hb_user_data_key_t, + data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + replace: hb_bool_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_map_get_user_data"] + pub fn hb_map_get_user_data( + map: *mut hb_map_t, + key: *mut hb_user_data_key_t, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + #[link_name = "\u{1}_hb_map_allocation_successful"] + pub fn hb_map_allocation_successful(map: *const hb_map_t) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_map_clear"] + pub fn hb_map_clear(map: *mut hb_map_t); +} +extern "C" { + #[link_name = "\u{1}_hb_map_is_empty"] + pub fn hb_map_is_empty(map: *const hb_map_t) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_map_get_population"] + pub fn hb_map_get_population(map: *const hb_map_t) -> ::std::os::raw::c_uint; +} +extern "C" { + #[link_name = "\u{1}_hb_map_set"] + pub fn hb_map_set(map: *mut hb_map_t, key: hb_codepoint_t, value: hb_codepoint_t); +} +extern "C" { + #[link_name = "\u{1}_hb_map_get"] + pub fn hb_map_get(map: *const hb_map_t, key: hb_codepoint_t) -> hb_codepoint_t; +} +extern "C" { + #[link_name = "\u{1}_hb_map_del"] + pub fn hb_map_del(map: *mut hb_map_t, key: hb_codepoint_t); +} +extern "C" { + #[link_name = "\u{1}_hb_map_has"] + pub fn hb_map_has(map: *const hb_map_t, key: hb_codepoint_t) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_shape"] + pub fn hb_shape( + font: *mut hb_font_t, + buffer: *mut hb_buffer_t, + features: *const hb_feature_t, + num_features: ::std::os::raw::c_uint, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_shape_full"] + pub fn hb_shape_full( + font: *mut hb_font_t, + buffer: *mut hb_buffer_t, + features: *const hb_feature_t, + num_features: ::std::os::raw::c_uint, + shaper_list: *const *const ::std::os::raw::c_char, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_shape_list_shapers"] + pub fn hb_shape_list_shapers() -> *mut *const ::std::os::raw::c_char; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct hb_shape_plan_t { + _unused: [u8; 0], +} +extern "C" { + #[link_name = "\u{1}_hb_shape_plan_create"] + pub fn hb_shape_plan_create( + face: *mut hb_face_t, + props: *const hb_segment_properties_t, + user_features: *const hb_feature_t, + num_user_features: ::std::os::raw::c_uint, + shaper_list: *const *const ::std::os::raw::c_char, + ) -> *mut hb_shape_plan_t; +} +extern "C" { + #[link_name = "\u{1}_hb_shape_plan_create_cached"] + pub fn hb_shape_plan_create_cached( + face: *mut hb_face_t, + props: *const hb_segment_properties_t, + user_features: *const hb_feature_t, + num_user_features: ::std::os::raw::c_uint, + shaper_list: *const *const ::std::os::raw::c_char, + ) -> *mut hb_shape_plan_t; +} +extern "C" { + #[link_name = "\u{1}_hb_shape_plan_create2"] + pub fn hb_shape_plan_create2( + face: *mut hb_face_t, + props: *const hb_segment_properties_t, + user_features: *const hb_feature_t, + num_user_features: ::std::os::raw::c_uint, + coords: *const ::std::os::raw::c_int, + num_coords: ::std::os::raw::c_uint, + shaper_list: *const *const ::std::os::raw::c_char, + ) -> *mut hb_shape_plan_t; +} +extern "C" { + #[link_name = "\u{1}_hb_shape_plan_create_cached2"] + pub fn hb_shape_plan_create_cached2( + face: *mut hb_face_t, + props: *const hb_segment_properties_t, + user_features: *const hb_feature_t, + num_user_features: ::std::os::raw::c_uint, + coords: *const ::std::os::raw::c_int, + num_coords: ::std::os::raw::c_uint, + shaper_list: *const *const ::std::os::raw::c_char, + ) -> *mut hb_shape_plan_t; +} +extern "C" { + #[link_name = "\u{1}_hb_shape_plan_get_empty"] + pub fn hb_shape_plan_get_empty() -> *mut hb_shape_plan_t; +} +extern "C" { + #[link_name = "\u{1}_hb_shape_plan_reference"] + pub fn hb_shape_plan_reference(shape_plan: *mut hb_shape_plan_t) -> *mut hb_shape_plan_t; +} +extern "C" { + #[link_name = "\u{1}_hb_shape_plan_destroy"] + pub fn hb_shape_plan_destroy(shape_plan: *mut hb_shape_plan_t); +} +extern "C" { + #[link_name = "\u{1}_hb_shape_plan_set_user_data"] + pub fn hb_shape_plan_set_user_data( + shape_plan: *mut hb_shape_plan_t, + key: *mut hb_user_data_key_t, + data: *mut ::std::os::raw::c_void, + destroy: hb_destroy_func_t, + replace: hb_bool_t, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_shape_plan_get_user_data"] + pub fn hb_shape_plan_get_user_data( + shape_plan: *mut hb_shape_plan_t, + key: *mut hb_user_data_key_t, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + #[link_name = "\u{1}_hb_shape_plan_execute"] + pub fn hb_shape_plan_execute( + shape_plan: *mut hb_shape_plan_t, + font: *mut hb_font_t, + buffer: *mut hb_buffer_t, + features: *const hb_feature_t, + num_features: ::std::os::raw::c_uint, + ) -> hb_bool_t; +} +extern "C" { + #[link_name = "\u{1}_hb_shape_plan_get_shaper"] + pub fn hb_shape_plan_get_shaper( + shape_plan: *mut hb_shape_plan_t, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + #[link_name = "\u{1}_hb_version"] + pub fn hb_version( + major: *mut ::std::os::raw::c_uint, + minor: *mut ::std::os::raw::c_uint, + micro: *mut ::std::os::raw::c_uint, + ); +} +extern "C" { + #[link_name = "\u{1}_hb_version_string"] + pub fn hb_version_string() -> *const ::std::os::raw::c_char; +} +extern "C" { + #[link_name = "\u{1}_hb_version_atleast"] + pub fn hb_version_atleast( + major: ::std::os::raw::c_uint, + minor: ::std::os::raw::c_uint, + micro: ::std::os::raw::c_uint, + ) -> hb_bool_t; +} +pub type FT_Memory = *mut FT_MemoryRec_; +pub type FT_Alloc_Func = ::std::option::Option< + unsafe extern "C" fn( + memory: FT_Memory, + size: ::std::os::raw::c_long, + ) -> *mut ::std::os::raw::c_void, +>; +pub type FT_Free_Func = ::std::option::Option< + unsafe extern "C" fn(memory: FT_Memory, block: *mut ::std::os::raw::c_void), +>; +pub type FT_Realloc_Func = ::std::option::Option< + unsafe extern "C" fn( + memory: FT_Memory, + cur_size: ::std::os::raw::c_long, + new_size: ::std::os::raw::c_long, + block: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void, +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_MemoryRec_ { + pub user: *mut ::std::os::raw::c_void, + pub alloc: FT_Alloc_Func, + pub free: FT_Free_Func, + pub realloc: FT_Realloc_Func, +} +#[test] +fn bindgen_test_layout_FT_MemoryRec_() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(FT_MemoryRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_MemoryRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).user as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_MemoryRec_), + "::", + stringify!(user) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).alloc as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_MemoryRec_), + "::", + stringify!(alloc) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).free as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_MemoryRec_), + "::", + stringify!(free) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).realloc as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_MemoryRec_), + "::", + stringify!(realloc) + ) + ); +} +pub type FT_Stream = *mut FT_StreamRec_; +#[repr(C)] +#[derive(Copy, Clone)] +pub union FT_StreamDesc_ { + pub value: ::std::os::raw::c_long, + pub pointer: *mut ::std::os::raw::c_void, + _bindgen_union_align: u64, +} +#[test] +fn bindgen_test_layout_FT_StreamDesc_() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(FT_StreamDesc_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_StreamDesc_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamDesc_), + "::", + stringify!(value) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pointer as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamDesc_), + "::", + stringify!(pointer) + ) + ); +} +pub type FT_StreamDesc = FT_StreamDesc_; +pub type FT_Stream_IoFunc = ::std::option::Option< + unsafe extern "C" fn( + stream: FT_Stream, + offset: ::std::os::raw::c_ulong, + buffer: *mut ::std::os::raw::c_uchar, + count: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_ulong, +>; +pub type FT_Stream_CloseFunc = ::std::option::Option; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct FT_StreamRec_ { + pub base: *mut ::std::os::raw::c_uchar, + pub size: ::std::os::raw::c_ulong, + pub pos: ::std::os::raw::c_ulong, + pub descriptor: FT_StreamDesc, + pub pathname: FT_StreamDesc, + pub read: FT_Stream_IoFunc, + pub close: FT_Stream_CloseFunc, + pub memory: FT_Memory, + pub cursor: *mut ::std::os::raw::c_uchar, + pub limit: *mut ::std::os::raw::c_uchar, +} +#[test] +fn bindgen_test_layout_FT_StreamRec_() { + assert_eq!( + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(FT_StreamRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_StreamRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).base as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(base) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pos as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(pos) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).descriptor as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(descriptor) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pathname as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(pathname) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).read as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(read) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).close as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(close) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).memory as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(memory) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).cursor as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(cursor) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).limit as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(FT_StreamRec_), + "::", + stringify!(limit) + ) + ); +} +pub type FT_Pos = ::std::os::raw::c_long; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Vector_ { + pub x: FT_Pos, + pub y: FT_Pos, +} +#[test] +fn bindgen_test_layout_FT_Vector_() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(FT_Vector_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Vector_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Vector_), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Vector_), + "::", + stringify!(y) + ) + ); +} +pub type FT_Vector = FT_Vector_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_BBox_ { + pub xMin: FT_Pos, + pub yMin: FT_Pos, + pub xMax: FT_Pos, + pub yMax: FT_Pos, +} +#[test] +fn bindgen_test_layout_FT_BBox_() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(FT_BBox_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_BBox_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).xMin as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_BBox_), + "::", + stringify!(xMin) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).yMin as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_BBox_), + "::", + stringify!(yMin) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).xMax as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_BBox_), + "::", + stringify!(xMax) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).yMax as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_BBox_), + "::", + stringify!(yMax) + ) + ); +} +pub type FT_BBox = FT_BBox_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Bitmap_ { + pub rows: ::std::os::raw::c_uint, + pub width: ::std::os::raw::c_uint, + pub pitch: ::std::os::raw::c_int, + pub buffer: *mut ::std::os::raw::c_uchar, + pub num_grays: ::std::os::raw::c_ushort, + pub pixel_mode: ::std::os::raw::c_uchar, + pub palette_mode: ::std::os::raw::c_uchar, + pub palette: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_FT_Bitmap_() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(FT_Bitmap_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Bitmap_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rows as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_), + "::", + stringify!(rows) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pitch as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_), + "::", + stringify!(pitch) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).buffer as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_), + "::", + stringify!(buffer) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).num_grays as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_), + "::", + stringify!(num_grays) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).pixel_mode as *const _ as usize }, + 26usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_), + "::", + stringify!(pixel_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).palette_mode as *const _ as usize }, + 27usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_), + "::", + stringify!(palette_mode) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).palette as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_), + "::", + stringify!(palette) + ) + ); +} +pub type FT_Bitmap = FT_Bitmap_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Outline_ { + pub n_contours: ::std::os::raw::c_short, + pub n_points: ::std::os::raw::c_short, + pub points: *mut FT_Vector, + pub tags: *mut ::std::os::raw::c_char, + pub contours: *mut ::std::os::raw::c_short, + pub flags: ::std::os::raw::c_int, +} +#[test] +fn bindgen_test_layout_FT_Outline_() { + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(FT_Outline_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Outline_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).n_contours as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_), + "::", + stringify!(n_contours) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).n_points as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_), + "::", + stringify!(n_points) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).points as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_), + "::", + stringify!(points) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tags as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_), + "::", + stringify!(tags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).contours as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_), + "::", + stringify!(contours) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_Outline_), + "::", + stringify!(flags) + ) + ); +} +pub type FT_Outline = FT_Outline_; +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum FT_Glyph_Format_ { + FT_GLYPH_FORMAT_NONE = 0, + FT_GLYPH_FORMAT_COMPOSITE = 1668246896, + FT_GLYPH_FORMAT_BITMAP = 1651078259, + FT_GLYPH_FORMAT_OUTLINE = 1869968492, + FT_GLYPH_FORMAT_PLOTTER = 1886154612, +} +pub use self::FT_Glyph_Format_ as FT_Glyph_Format; +pub type FT_String = ::std::os::raw::c_char; +pub type FT_Short = ::std::os::raw::c_short; +pub type FT_UShort = ::std::os::raw::c_ushort; +pub type FT_Int = ::std::os::raw::c_int; +pub type FT_UInt = ::std::os::raw::c_uint; +pub type FT_Long = ::std::os::raw::c_long; +pub type FT_Fixed = ::std::os::raw::c_long; +pub type FT_Generic_Finalizer = + ::std::option::Option; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Generic_ { + pub data: *mut ::std::os::raw::c_void, + pub finalizer: FT_Generic_Finalizer, +} +#[test] +fn bindgen_test_layout_FT_Generic_() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(FT_Generic_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Generic_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Generic_), + "::", + stringify!(data) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).finalizer as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Generic_), + "::", + stringify!(finalizer) + ) + ); +} +pub type FT_Generic = FT_Generic_; +pub type FT_ListNode = *mut FT_ListNodeRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_ListNodeRec_ { + pub prev: FT_ListNode, + pub next: FT_ListNode, + pub data: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_FT_ListNodeRec_() { + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(FT_ListNodeRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_ListNodeRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).prev as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_ListNodeRec_), + "::", + stringify!(prev) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_ListNodeRec_), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_ListNodeRec_), + "::", + stringify!(data) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_ListRec_ { + pub head: FT_ListNode, + pub tail: FT_ListNode, +} +#[test] +fn bindgen_test_layout_FT_ListRec_() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(FT_ListRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_ListRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).head as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_ListRec_), + "::", + stringify!(head) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).tail as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_ListRec_), + "::", + stringify!(tail) + ) + ); +} +pub type FT_ListRec = FT_ListRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Glyph_Metrics_ { + pub width: FT_Pos, + pub height: FT_Pos, + pub horiBearingX: FT_Pos, + pub horiBearingY: FT_Pos, + pub horiAdvance: FT_Pos, + pub vertBearingX: FT_Pos, + pub vertBearingY: FT_Pos, + pub vertAdvance: FT_Pos, +} +#[test] +fn bindgen_test_layout_FT_Glyph_Metrics_() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(FT_Glyph_Metrics_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Glyph_Metrics_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Glyph_Metrics_), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Glyph_Metrics_), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).horiBearingX as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Glyph_Metrics_), + "::", + stringify!(horiBearingX) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).horiBearingY as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Glyph_Metrics_), + "::", + stringify!(horiBearingY) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).horiAdvance as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_Glyph_Metrics_), + "::", + stringify!(horiAdvance) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vertBearingX as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(FT_Glyph_Metrics_), + "::", + stringify!(vertBearingX) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vertBearingY as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(FT_Glyph_Metrics_), + "::", + stringify!(vertBearingY) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).vertAdvance as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(FT_Glyph_Metrics_), + "::", + stringify!(vertAdvance) + ) + ); +} +pub type FT_Glyph_Metrics = FT_Glyph_Metrics_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Bitmap_Size_ { + pub height: FT_Short, + pub width: FT_Short, + pub size: FT_Pos, + pub x_ppem: FT_Pos, + pub y_ppem: FT_Pos, +} +#[test] +fn bindgen_test_layout_FT_Bitmap_Size_() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(FT_Bitmap_Size_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Bitmap_Size_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_Size_), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).width as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_Size_), + "::", + stringify!(width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_Size_), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x_ppem as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_Size_), + "::", + stringify!(x_ppem) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y_ppem as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Bitmap_Size_), + "::", + stringify!(y_ppem) + ) + ); +} +pub type FT_Bitmap_Size = FT_Bitmap_Size_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_LibraryRec_ { + _unused: [u8; 0], +} +pub type FT_Library = *mut FT_LibraryRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_DriverRec_ { + _unused: [u8; 0], +} +pub type FT_Driver = *mut FT_DriverRec_; +pub type FT_Face = *mut FT_FaceRec_; +pub type FT_Size = *mut FT_SizeRec_; +pub type FT_GlyphSlot = *mut FT_GlyphSlotRec_; +pub type FT_CharMap = *mut FT_CharMapRec_; +impl FT_Encoding_ { + pub const FT_ENCODING_GB2312: FT_Encoding_ = FT_Encoding_::FT_ENCODING_PRC; +} +impl FT_Encoding_ { + pub const FT_ENCODING_MS_SJIS: FT_Encoding_ = FT_Encoding_::FT_ENCODING_SJIS; +} +impl FT_Encoding_ { + pub const FT_ENCODING_MS_GB2312: FT_Encoding_ = FT_Encoding_::FT_ENCODING_PRC; +} +impl FT_Encoding_ { + pub const FT_ENCODING_MS_BIG5: FT_Encoding_ = FT_Encoding_::FT_ENCODING_BIG5; +} +impl FT_Encoding_ { + pub const FT_ENCODING_MS_WANSUNG: FT_Encoding_ = FT_Encoding_::FT_ENCODING_WANSUNG; +} +impl FT_Encoding_ { + pub const FT_ENCODING_MS_JOHAB: FT_Encoding_ = FT_Encoding_::FT_ENCODING_JOHAB; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum FT_Encoding_ { + FT_ENCODING_NONE = 0, + FT_ENCODING_MS_SYMBOL = 1937337698, + FT_ENCODING_UNICODE = 1970170211, + FT_ENCODING_SJIS = 1936353651, + FT_ENCODING_PRC = 1734484000, + FT_ENCODING_BIG5 = 1651074869, + FT_ENCODING_WANSUNG = 2002873971, + FT_ENCODING_JOHAB = 1785686113, + FT_ENCODING_ADOBE_STANDARD = 1094995778, + FT_ENCODING_ADOBE_EXPERT = 1094992453, + FT_ENCODING_ADOBE_CUSTOM = 1094992451, + FT_ENCODING_ADOBE_LATIN_1 = 1818326065, + FT_ENCODING_OLD_LATIN_2 = 1818326066, + FT_ENCODING_APPLE_ROMAN = 1634889070, +} +pub use self::FT_Encoding_ as FT_Encoding; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_CharMapRec_ { + pub face: FT_Face, + pub encoding: FT_Encoding, + pub platform_id: FT_UShort, + pub encoding_id: FT_UShort, +} +#[test] +fn bindgen_test_layout_FT_CharMapRec_() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(FT_CharMapRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_CharMapRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).face as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_CharMapRec_), + "::", + stringify!(face) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).encoding as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_CharMapRec_), + "::", + stringify!(encoding) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).platform_id as *const _ as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(FT_CharMapRec_), + "::", + stringify!(platform_id) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).encoding_id as *const _ as usize }, + 14usize, + concat!( + "Offset of field: ", + stringify!(FT_CharMapRec_), + "::", + stringify!(encoding_id) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Face_InternalRec_ { + _unused: [u8; 0], +} +pub type FT_Face_Internal = *mut FT_Face_InternalRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_FaceRec_ { + pub num_faces: FT_Long, + pub face_index: FT_Long, + pub face_flags: FT_Long, + pub style_flags: FT_Long, + pub num_glyphs: FT_Long, + pub family_name: *mut FT_String, + pub style_name: *mut FT_String, + pub num_fixed_sizes: FT_Int, + pub available_sizes: *mut FT_Bitmap_Size, + pub num_charmaps: FT_Int, + pub charmaps: *mut FT_CharMap, + pub generic: FT_Generic, + pub bbox: FT_BBox, + pub units_per_EM: FT_UShort, + pub ascender: FT_Short, + pub descender: FT_Short, + pub height: FT_Short, + pub max_advance_width: FT_Short, + pub max_advance_height: FT_Short, + pub underline_position: FT_Short, + pub underline_thickness: FT_Short, + pub glyph: FT_GlyphSlot, + pub size: FT_Size, + pub charmap: FT_CharMap, + pub driver: FT_Driver, + pub memory: FT_Memory, + pub stream: FT_Stream, + pub sizes_list: FT_ListRec, + pub autohint: FT_Generic, + pub extensions: *mut ::std::os::raw::c_void, + pub internal: FT_Face_Internal, +} +#[test] +fn bindgen_test_layout_FT_FaceRec_() { + assert_eq!( + ::std::mem::size_of::(), + 248usize, + concat!("Size of: ", stringify!(FT_FaceRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_FaceRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).num_faces as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(num_faces) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).face_index as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(face_index) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).face_flags as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(face_flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).style_flags as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(style_flags) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).num_glyphs as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(num_glyphs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).family_name as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(family_name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).style_name as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(style_name) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).num_fixed_sizes as *const _ as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(num_fixed_sizes) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).available_sizes as *const _ as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(available_sizes) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).num_charmaps as *const _ as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(num_charmaps) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).charmaps as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(charmaps) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).generic as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(generic) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bbox as *const _ as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(bbox) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).units_per_EM as *const _ as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(units_per_EM) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ascender as *const _ as usize }, + 138usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(ascender) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).descender as *const _ as usize }, + 140usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(descender) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 142usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).max_advance_width as *const _ as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(max_advance_width) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).max_advance_height as *const _ as usize }, + 146usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(max_advance_height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).underline_position as *const _ as usize }, + 148usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(underline_position) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).underline_thickness as *const _ as usize }, + 150usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(underline_thickness) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).glyph as *const _ as usize }, + 152usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(glyph) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).size as *const _ as usize }, + 160usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).charmap as *const _ as usize }, + 168usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(charmap) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).driver as *const _ as usize }, + 176usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(driver) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).memory as *const _ as usize }, + 184usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(memory) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).stream as *const _ as usize }, + 192usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(stream) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).sizes_list as *const _ as usize }, + 200usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(sizes_list) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).autohint as *const _ as usize }, + 216usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(autohint) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).extensions as *const _ as usize }, + 232usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(extensions) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).internal as *const _ as usize }, + 240usize, + concat!( + "Offset of field: ", + stringify!(FT_FaceRec_), + "::", + stringify!(internal) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Size_InternalRec_ { + _unused: [u8; 0], +} +pub type FT_Size_Internal = *mut FT_Size_InternalRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Size_Metrics_ { + pub x_ppem: FT_UShort, + pub y_ppem: FT_UShort, + pub x_scale: FT_Fixed, + pub y_scale: FT_Fixed, + pub ascender: FT_Pos, + pub descender: FT_Pos, + pub height: FT_Pos, + pub max_advance: FT_Pos, +} +#[test] +fn bindgen_test_layout_FT_Size_Metrics_() { + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(FT_Size_Metrics_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_Size_Metrics_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x_ppem as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_Metrics_), + "::", + stringify!(x_ppem) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y_ppem as *const _ as usize }, + 2usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_Metrics_), + "::", + stringify!(y_ppem) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).x_scale as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_Metrics_), + "::", + stringify!(x_scale) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).y_scale as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_Metrics_), + "::", + stringify!(y_scale) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).ascender as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_Metrics_), + "::", + stringify!(ascender) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).descender as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_Metrics_), + "::", + stringify!(descender) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).height as *const _ as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_Metrics_), + "::", + stringify!(height) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).max_advance as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(FT_Size_Metrics_), + "::", + stringify!(max_advance) + ) + ); +} +pub type FT_Size_Metrics = FT_Size_Metrics_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_SizeRec_ { + pub face: FT_Face, + pub generic: FT_Generic, + pub metrics: FT_Size_Metrics, + pub internal: FT_Size_Internal, +} +#[test] +fn bindgen_test_layout_FT_SizeRec_() { + assert_eq!( + ::std::mem::size_of::(), + 88usize, + concat!("Size of: ", stringify!(FT_SizeRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_SizeRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).face as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_SizeRec_), + "::", + stringify!(face) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).generic as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_SizeRec_), + "::", + stringify!(generic) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).metrics as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_SizeRec_), + "::", + stringify!(metrics) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).internal as *const _ as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(FT_SizeRec_), + "::", + stringify!(internal) + ) + ); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_SubGlyphRec_ { + _unused: [u8; 0], +} +pub type FT_SubGlyph = *mut FT_SubGlyphRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_Slot_InternalRec_ { + _unused: [u8; 0], +} +pub type FT_Slot_Internal = *mut FT_Slot_InternalRec_; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct FT_GlyphSlotRec_ { + pub library: FT_Library, + pub face: FT_Face, + pub next: FT_GlyphSlot, + pub glyph_index: FT_UInt, + pub generic: FT_Generic, + pub metrics: FT_Glyph_Metrics, + pub linearHoriAdvance: FT_Fixed, + pub linearVertAdvance: FT_Fixed, + pub advance: FT_Vector, + pub format: FT_Glyph_Format, + pub bitmap: FT_Bitmap, + pub bitmap_left: FT_Int, + pub bitmap_top: FT_Int, + pub outline: FT_Outline, + pub num_subglyphs: FT_UInt, + pub subglyphs: FT_SubGlyph, + pub control_data: *mut ::std::os::raw::c_void, + pub control_len: ::std::os::raw::c_long, + pub lsb_delta: FT_Pos, + pub rsb_delta: FT_Pos, + pub other: *mut ::std::os::raw::c_void, + pub internal: FT_Slot_Internal, +} +#[test] +fn bindgen_test_layout_FT_GlyphSlotRec_() { + assert_eq!( + ::std::mem::size_of::(), + 304usize, + concat!("Size of: ", stringify!(FT_GlyphSlotRec_)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(FT_GlyphSlotRec_)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).library as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(library) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).face as *const _ as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(face) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).next as *const _ as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).glyph_index as *const _ as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(glyph_index) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).generic as *const _ as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(generic) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).metrics as *const _ as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(metrics) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).linearHoriAdvance as *const _ as usize + }, + 112usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(linearHoriAdvance) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::())).linearVertAdvance as *const _ as usize + }, + 120usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(linearVertAdvance) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).advance as *const _ as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(advance) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).format as *const _ as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(format) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bitmap as *const _ as usize }, + 152usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(bitmap) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bitmap_left as *const _ as usize }, + 192usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(bitmap_left) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).bitmap_top as *const _ as usize }, + 196usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(bitmap_top) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).outline as *const _ as usize }, + 200usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(outline) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).num_subglyphs as *const _ as usize }, + 240usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(num_subglyphs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).subglyphs as *const _ as usize }, + 248usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(subglyphs) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).control_data as *const _ as usize }, + 256usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(control_data) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).control_len as *const _ as usize }, + 264usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(control_len) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).lsb_delta as *const _ as usize }, + 272usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(lsb_delta) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).rsb_delta as *const _ as usize }, + 280usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(rsb_delta) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).other as *const _ as usize }, + 288usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(other) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::())).internal as *const _ as usize }, + 296usize, + concat!( + "Offset of field: ", + stringify!(FT_GlyphSlotRec_), + "::", + stringify!(internal) + ) + ); +} +extern "C" { + #[link_name = "\u{1}_hb_ft_face_create"] + pub fn hb_ft_face_create(ft_face: FT_Face, destroy: hb_destroy_func_t) -> *mut hb_face_t; +} +extern "C" { + #[link_name = "\u{1}_hb_ft_face_create_cached"] + pub fn hb_ft_face_create_cached(ft_face: FT_Face) -> *mut hb_face_t; +} +extern "C" { + #[link_name = "\u{1}_hb_ft_face_create_referenced"] + pub fn hb_ft_face_create_referenced(ft_face: FT_Face) -> *mut hb_face_t; +} +extern "C" { + #[link_name = "\u{1}_hb_ft_font_create"] + pub fn hb_ft_font_create(ft_face: FT_Face, destroy: hb_destroy_func_t) -> *mut hb_font_t; +} +extern "C" { + #[link_name = "\u{1}_hb_ft_font_create_referenced"] + pub fn hb_ft_font_create_referenced(ft_face: FT_Face) -> *mut hb_font_t; +} +extern "C" { + #[link_name = "\u{1}_hb_ft_font_get_face"] + pub fn hb_ft_font_get_face(font: *mut hb_font_t) -> FT_Face; +} +extern "C" { + #[link_name = "\u{1}_hb_ft_font_set_load_flags"] + pub fn hb_ft_font_set_load_flags(font: *mut hb_font_t, load_flags: ::std::os::raw::c_int); +} +extern "C" { + #[link_name = "\u{1}_hb_ft_font_get_load_flags"] + pub fn hb_ft_font_get_load_flags(font: *mut hb_font_t) -> ::std::os::raw::c_int; +} +extern "C" { + #[link_name = "\u{1}_hb_ft_font_changed"] + pub fn hb_ft_font_changed(font: *mut hb_font_t); +} +extern "C" { + #[link_name = "\u{1}_hb_ft_font_set_funcs"] + pub fn hb_ft_font_set_funcs(font: *mut hb_font_t); +} diff --git a/src/font/fcwrap.rs b/src/font/fcwrap.rs index e9b22621c..57418e149 100644 --- a/src/font/fcwrap.rs +++ b/src/font/fcwrap.rs @@ -1,7 +1,7 @@ //! Slightly higher level helper for fontconfig use failure::{self, Error}; -pub use fontconfig::fontconfig::*; +pub use fontconfig::*; use std::ffi::{CStr, CString}; use std::mem; use std::ptr; @@ -53,21 +53,11 @@ impl FontSet { position: 0, } } - - #[allow(dead_code)] - pub fn add(&mut self, pat: &Pattern) { - unsafe { - FcFontSetAdd(self.fonts, pat.pat); - } - } } #[repr(C)] -#[allow(dead_code)] pub enum MatchKind { Pattern = FcMatchPattern as isize, - Font = FcMatchFont as isize, - Scan = FcMatchScan as isize, } pub struct FcResultWrap(FcResult); @@ -105,7 +95,6 @@ pub struct Pattern { } impl Pattern { - #[allow(dead_code)] pub fn new() -> Result { unsafe { let p = FcPatternCreate(); @@ -114,7 +103,6 @@ impl Pattern { } } - #[allow(dead_code)] pub fn add_string(&mut self, key: &str, value: &str) -> Result<(), Error> { let key = CString::new(key)?; let value = CString::new(value)?; @@ -129,7 +117,6 @@ impl Pattern { } } - #[allow(dead_code)] pub fn add_double(&mut self, key: &str, value: f64) -> Result<(), Error> { let key = CString::new(key)?; unsafe { @@ -143,7 +130,6 @@ impl Pattern { } } - #[allow(dead_code)] pub fn add_integer(&mut self, key: &str, value: i32) -> Result<(), Error> { let key = CString::new(key)?; unsafe { @@ -157,24 +143,14 @@ impl Pattern { } } - #[allow(dead_code)] pub fn family(&mut self, family: &str) -> Result<(), Error> { self.add_string("family", family) } - #[allow(dead_code)] pub fn monospace(&mut self) -> Result<(), Error> { self.add_integer("spacing", FC_MONO) } - #[allow(dead_code)] - pub fn print(&self) { - unsafe { - FcPatternPrint(self.pat); - } - } - - #[allow(dead_code)] pub fn format(&self, fmt: &str) -> Result { let fmt = CString::new(fmt)?; unsafe { @@ -213,15 +189,6 @@ impl Pattern { } } - #[allow(dead_code)] - pub fn find_match(&self) -> Result { - unsafe { - let mut res = FcResultWrap(0); - let pat = FcFontMatch(ptr::null_mut(), self.pat, &mut res.0 as *mut _); - res.result(Pattern { pat }) - } - } - pub fn sort(&self, trim: bool) -> Result { unsafe { let mut res = FcResultWrap(0); @@ -241,7 +208,6 @@ impl Pattern { self.get_string("file") } - #[allow(dead_code)] pub fn get_double(&self, key: &str) -> Result { unsafe { let key = CString::new(key)?; @@ -260,25 +226,6 @@ impl Pattern { } } - #[allow(dead_code)] - pub fn get_integer(&self, key: &str) -> Result { - unsafe { - let key = CString::new(key)?; - let mut ival: i32 = 0; - let res = FcResultWrap(FcPatternGetInteger( - self.pat, - key.as_ptr(), - 0, - &mut ival as *mut _, - )); - if !res.succeeded() { - Err(res.as_err()) - } else { - Ok(ival) - } - } - } - pub fn get_string(&self, key: &str) -> Result { unsafe { let key = CString::new(key)?; diff --git a/src/font/fontloader_and_freetype.rs b/src/font/fontloader_and_freetype.rs index f6cee9ab3..3fa66b224 100644 --- a/src/font/fontloader_and_freetype.rs +++ b/src/font/fontloader_and_freetype.rs @@ -2,7 +2,9 @@ use crate::config::{Config, TextStyle}; use crate::font::fontloader; use crate::font::ftfont::FreeTypeFontImpl; -use crate::font::{ftwrap, FallbackIdx, Font, FontSystem, GlyphInfo, NamedFont}; +use crate::font::{ + ftwrap, shape_with_harfbuzz, FallbackIdx, Font, FontSystem, GlyphInfo, NamedFont, +}; use failure::Error; struct NamedFontImpl { @@ -63,29 +65,7 @@ impl FontSystem for FontLoaderAndFreeType { })) } } -impl NamedFontImpl { - fn shape_codepoint(&mut self, c: char, cluster: usize) -> Result { - for (font_idx, font) in self.fonts.iter().enumerate() { - let mut info = match font.single_glyph_info(c) { - Err(_) => continue, - Ok(info) => info, - }; - if info.glyph_pos == 0 { - continue; - } - info.cluster = cluster as u32; - info.font_idx = font_idx; - return Ok(info); - } - if c == '?' { - bail!("no glyph for ?"); - } - match self.shape_codepoint('?', cluster) { - Ok(info) => Ok(info), - Err(_) => bail!("no glyph for {}, and no glyph for fallback ?", c), - } - } -} + impl NamedFont for NamedFontImpl { fn get_fallback(&mut self, idx: FallbackIdx) -> Result<&Font, Error> { self.fonts @@ -98,14 +78,6 @@ impl NamedFont for NamedFontImpl { } fn shape(&mut self, s: &str) -> Result, Error> { - let mut shaped = Vec::with_capacity(s.len()); - - let mut cluster = 0; - for c in s.chars() { - let info = self.shape_codepoint(c, cluster)?; - cluster += c.len_utf8(); - shaped.push(info); - } - Ok(shaped) + shape_with_harfbuzz(self, 0, s) } } diff --git a/src/font/ftfont.rs b/src/font/ftfont.rs index 9675b0ed1..a2bd5add8 100644 --- a/src/font/ftfont.rs +++ b/src/font/ftfont.rs @@ -1,24 +1,18 @@ -use crate::font::system::GlyphInfo; +use super::hbwrap as harfbuzz; use crate::font::{ftwrap, Font, FontMetrics, RasterizedGlyph}; use failure::Error; use std::cell::RefCell; -use std::collections::HashMap; use std::mem; use std::slice; -#[cfg(unix)] -use super::hbwrap as harfbuzz; - /// Holds a loaded font alternative pub struct FreeTypeFontImpl { face: RefCell, - #[cfg(all(unix, not(target_os = "macos")))] font: RefCell, /// nominal monospace cell height cell_height: f64, /// nominal monospace cell width cell_width: f64, - glyph_cache: RefCell>, } impl FreeTypeFontImpl { @@ -67,58 +61,23 @@ impl FreeTypeFontImpl { }; debug!("metrics: width={} height={}", cell_width, cell_height); - #[cfg(all(unix, not(target_os = "macos")))] let font = harfbuzz::Font::new(face.face); Ok(FreeTypeFontImpl { face: RefCell::new(face), - #[cfg(all(unix, not(target_os = "macos")))] font: RefCell::new(font), cell_height, cell_width, - glyph_cache: RefCell::new(HashMap::new()), }) } - - pub fn single_glyph_info(&self, codepoint: char) -> Result { - // Memoize this, as we are called frequently during shaping - { - let cache = self.glyph_cache.borrow_mut(); - if let Some(info) = cache.get(&codepoint) { - return Ok(info.clone()); - } - } - let (glyph_pos, metrics) = self.face.borrow_mut().load_codepoint(codepoint)?; - let info = GlyphInfo { - #[cfg(debug_assertions)] - text: codepoint.to_string(), - cluster: 0, - num_cells: unicode_width::UnicodeWidthChar::width(codepoint).unwrap_or(1) as u8, - font_idx: 0, - glyph_pos, - x_advance: (metrics.horiAdvance as f64 / 64.0), - x_offset: 0.0, //(metrics.horiBearingX as f64 / 64.0).into(), - y_advance: 0.0, - y_offset: 0.0, - }; - - self.glyph_cache - .borrow_mut() - .insert(codepoint, info.clone()); - - Ok(info) - } } impl Font for FreeTypeFontImpl { - #[cfg(unix)] - #[allow(unused_variables)] fn harfbuzz_shape( &self, buf: &mut harfbuzz::Buffer, features: Option<&[harfbuzz::hb_feature_t]>, ) { - #[cfg(all(unix, not(target_os = "macos")))] self.font.borrow_mut().shape(buf, features) } fn has_color(&self) -> bool { @@ -152,7 +111,6 @@ impl Font for FreeTypeFontImpl { // assembles these bits. (render_mode as i32) << 16; - #[cfg(all(unix, not(target_os = "macos")))] self.font.borrow_mut().set_load_flags(load_flags); // This clone is conceptually unsafe, but ok in practice as we are diff --git a/src/font/ftwrap.rs b/src/font/ftwrap.rs index 9de74cb8d..ffa90e0d7 100644 --- a/src/font/ftwrap.rs +++ b/src/font/ftwrap.rs @@ -1,11 +1,15 @@ //! Higher level freetype bindings use failure::Error; -pub use freetype::freetype::*; -use freetype::succeeded; +pub use freetype::*; use std::ffi::CString; use std::ptr; +#[inline] +pub fn succeeded(error: FT_Error) -> bool { + error == freetype::FT_Err_Ok as FT_Error +} + /// Translate an error and value into a result fn ft_result(err: FT_Error, t: T) -> Result { if succeeded(err) { @@ -61,26 +65,6 @@ impl Face { ft_result(unsafe { FT_Select_Size(self.face, idx as i32) }, ()) } - pub fn load_codepoint( - &mut self, - codepoint: char, - ) -> Result<(FT_UInt, FT_Glyph_Metrics_), Error> { - unsafe { - let glyph_pos = FT_Get_Char_Index(self.face, FT_ULong::from(u32::from(codepoint))); - let res = FT_Load_Glyph(self.face, glyph_pos, FT_LOAD_COLOR as i32); - ensure!( - succeeded(res), - "load_codepoint {}: FreeType error {:?} 0x{:x}", - codepoint, - res, - res - ); - - let glyph = &(*(*self.face).glyph); - Ok((glyph_pos, glyph.metrics)) - } - } - pub fn load_and_render_glyph( &mut self, glyph_index: FT_UInt, diff --git a/src/font/hbwrap.rs b/src/font/hbwrap.rs index 3186d2d7c..8ed97e724 100644 --- a/src/font/hbwrap.rs +++ b/src/font/hbwrap.rs @@ -2,18 +2,15 @@ #![allow(dead_code)] #[cfg(target_os = "macos")] use core_text::font::{CTFont, CTFontRef}; -#[cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))] use freetype; -pub use self::harfbuzz::*; -use harfbuzz_sys as harfbuzz; +pub use harfbuzz::*; use failure::Error; use std::mem; use std::ptr; use std::slice; -#[cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))] extern "C" { fn hb_ft_font_set_load_flags(font: *mut hb_font_t, load_flags: i32); } @@ -92,7 +89,7 @@ impl Blob { hb_blob_create( data.as_ptr() as *const i8, data.len() as u32, - HB_MEMORY_MODE_READONLY, + hb_memory_mode_t::HB_MEMORY_MODE_READONLY, ptr::null_mut(), None, ) @@ -127,15 +124,14 @@ impl Face { } impl Font { - #[cfg(not(target_os = "macos"))] /// Create a harfbuzz face from a freetype font - pub fn new(face: freetype::freetype::FT_Face) -> Font { + pub fn new(face: freetype::FT_Face) -> Font { // hb_ft_font_create_referenced always returns a // pointer to something, or derefs a nullptr internally // if everything fails, so there's nothing for us to // test here. Font { - font: unsafe { hb_ft_font_create_referenced(face) }, + font: unsafe { hb_ft_font_create_referenced(face as _) }, } } #[cfg(target_os = "macos")] @@ -163,8 +159,7 @@ impl Font { Ok(Self { font }) } - #[cfg(not(target_os = "macos"))] - pub fn set_load_flags(&mut self, load_flags: freetype::freetype::FT_Int32) { + pub fn set_load_flags(&mut self, load_flags: freetype::FT_Int32) { unsafe { hb_ft_font_set_load_flags(self.font, load_flags); } diff --git a/src/font/mod.rs b/src/font/mod.rs index cb42723e7..f32fb2803 100644 --- a/src/font/mod.rs +++ b/src/font/mod.rs @@ -16,16 +16,19 @@ pub use self::system::*; pub mod ftwrap; -#[cfg(all(unix, not(target_os = "macos")))] +#[cfg(all(unix, any(feature = "force-fontconfig", not(target_os = "macos"))))] pub mod fcwrap; -#[cfg(all(unix, not(target_os = "macos")))] +#[cfg(all(unix, any(feature = "force-fontconfig", not(target_os = "macos"))))] pub mod fontconfigandfreetype; #[cfg(target_os = "macos")] pub mod coretext; +#[cfg(any(target_os = "macos", windows))] pub mod fontloader; +#[cfg(any(target_os = "macos", windows))] pub mod fontloader_and_freetype; +#[cfg(any(target_os = "macos", windows))] pub mod fontloader_and_rusttype; pub mod rtype; @@ -80,16 +83,25 @@ impl FontSystemSelection { fn new_font_system(self) -> Rc { match self { FontSystemSelection::FontConfigAndFreeType => { - #[cfg(all(unix, not(target_os = "macos")))] + #[cfg(all(unix, any(feature = "force-fontconfig", not(target_os = "macos"))))] return Rc::new(fontconfigandfreetype::FontSystemImpl::new()); - #[cfg(not(all(unix, not(target_os = "macos"))))] + #[cfg(not(all( + unix, + any(feature = "force-fontconfig", not(target_os = "macos")) + )))] panic!("fontconfig not compiled in"); } FontSystemSelection::FontLoaderAndFreeType => { - Rc::new(fontloader_and_freetype::FontSystemImpl::new()) + #[cfg(any(target_os = "macos", windows))] + return Rc::new(fontloader_and_freetype::FontSystemImpl::new()); + #[cfg(not(any(target_os = "macos", windows)))] + panic!("font-loader not compiled in"); } FontSystemSelection::FontLoaderAndRustType => { - Rc::new(fontloader_and_rusttype::FontSystemImpl::new()) + #[cfg(any(target_os = "macos", windows))] + return Rc::new(fontloader_and_rusttype::FontSystemImpl::new()); + #[cfg(not(any(target_os = "macos", windows)))] + panic!("font-loader not compiled in"); } FontSystemSelection::CoreText => { #[cfg(target_os = "macos")] @@ -258,8 +270,8 @@ pub fn shape_with_harfbuzz( ]; let mut buf = harfbuzz::Buffer::new()?; - buf.set_script(harfbuzz::HB_SCRIPT_LATIN); - buf.set_direction(harfbuzz::HB_DIRECTION_LTR); + buf.set_script(harfbuzz::hb_script_t::HB_SCRIPT_LATIN); + buf.set_direction(harfbuzz::hb_direction_t::HB_DIRECTION_LTR); buf.set_language(harfbuzz::language_from_string("en")?); buf.add_str(s);