pub trait FontPlatform {
Show 26 methods
// Provided methods
fn resolve_font_handle(
&mut self,
_name: &[i32],
_size: i32,
) -> Option<PortableFontHandle> { ... }
fn release_font_handle(
&mut self,
_font: PortableFontHandle,
_type_flag: i32,
) { ... }
fn font_table(&self) -> Vec<(PortableFontHandle, String, i32)> { ... }
fn restore_font_table(
&mut self,
_table: &[(PortableFontHandle, String, i32)],
) -> bool { ... }
fn font_metrics(&mut self, _font: PortableFontHandle) -> PortableFontMetrics { ... }
fn opentype_font_metrics(
&mut self,
font: PortableFontHandle,
) -> PortableFontMetrics { ... }
fn is_opentype_math_font(&mut self, _font: PortableFontHandle) -> bool { ... }
fn using_opentype(&mut self, _font: PortableFontHandle) -> bool { ... }
fn math_symbol_parameter(
&mut self,
_font: PortableFontHandle,
_parameter: i32,
) -> i32 { ... }
fn math_extension_parameter(
&mut self,
_font: PortableFontHandle,
_parameter: i32,
) -> i32 { ... }
fn opentype_math_constant(
&mut self,
_font: PortableFontHandle,
_constant: i32,
) -> i32 { ... }
fn opentype_math_accent_position(
&mut self,
_font: PortableFontHandle,
_glyph: i32,
) -> i32 { ... }
fn math_glyph_italic_correction(
&mut self,
_font: PortableFontHandle,
_glyph: i32,
) -> i32 { ... }
fn math_glyph_variant(
&mut self,
_font: PortableFontHandle,
_glyph: i32,
_index: u16,
_horizontal: bool,
) -> Option<PortableMathVariant> { ... }
fn math_glyph_assembly(
&mut self,
_font: PortableFontHandle,
_glyph: i32,
_horizontal: bool,
) -> Vec<PortableMathAssemblyPart> { ... }
fn math_min_connector_overlap(&mut self, _font: PortableFontHandle) -> i32 { ... }
fn math_kern_at(
&mut self,
_font: PortableFontHandle,
_glyph: i32,
_corner: PortableMathKernCorner,
_correction_height: i32,
) -> i32 { ... }
fn math_points_to_units(
&mut self,
_font: PortableFontHandle,
_points: f32,
) -> f32 { ... }
fn math_units_to_scaled(
&mut self,
_font: PortableFontHandle,
_units: i32,
) -> i32 { ... }
fn math_point_size(&mut self, _font: PortableFontHandle) -> f32 { ... }
fn map_char_to_glyph(
&mut self,
_font: PortableFontHandle,
_codepoint: i32,
) -> i32 { ... }
fn map_glyph_to_index(
&mut self,
_font: PortableFontHandle,
_name: &str,
) -> i32 { ... }
fn ot_font_get(
&mut self,
_font: PortableFontHandle,
_what: i32,
_param1: i32,
_param2: i32,
_param3: i32,
) -> i32 { ... }
fn font_spec(&self, _font: PortableFontHandle) -> Option<String> { ... }
fn shape_native_text(
&mut self,
_font: PortableFontHandle,
_text: &[u16],
_use_glyph_metrics: bool,
) -> PortableNativeTextMetrics { ... }
fn measure_native_glyph(
&mut self,
_font: PortableFontHandle,
_glyph: u16,
_use_glyph_metrics: bool,
) -> PortableNativeGlyphMetrics { ... }
}Provided Methods§
fn resolve_font_handle( &mut self, _name: &[i32], _size: i32, ) -> Option<PortableFontHandle>
fn release_font_handle(&mut self, _font: PortableFontHandle, _type_flag: i32)
Sourcefn font_table(&self) -> Vec<(PortableFontHandle, String, i32)>
fn font_table(&self) -> Vec<(PortableFontHandle, String, i32)>
Snapshot the platform’s native-font table as (handle, spec, size)
tuples. A serialized format image keeps integer font handles in
fontlayoutengine, but those handles only mean something to the platform
that minted them; capturing the table lets a cold load rebind them.
Sourcefn restore_font_table(
&mut self,
_table: &[(PortableFontHandle, String, i32)],
) -> bool
fn restore_font_table( &mut self, _table: &[(PortableFontHandle, String, i32)], ) -> bool
Rebuild the native-font table from a Self::font_table snapshot,
(re)loading each font at its original handle so the fontlayoutengine
handles preserved in a reloaded format image resolve again. Returns
false if any font failed to load.
fn font_metrics(&mut self, _font: PortableFontHandle) -> PortableFontMetrics
fn opentype_font_metrics( &mut self, font: PortableFontHandle, ) -> PortableFontMetrics
fn is_opentype_math_font(&mut self, _font: PortableFontHandle) -> bool
Sourcefn using_opentype(&mut self, _font: PortableFontHandle) -> bool
fn using_opentype(&mut self, _font: PortableFontHandle) -> bool
Whether font is shaped through the OpenType (HarfBuzz/rustybuzz) shaper.
Mirrors XeTeX’s usingOpenType, which is true for the "ot" shaper (the
default). This engine always shapes native fonts with rustybuzz, so any
loaded native font handle returns true.
fn math_symbol_parameter( &mut self, _font: PortableFontHandle, _parameter: i32, ) -> i32
fn math_extension_parameter( &mut self, _font: PortableFontHandle, _parameter: i32, ) -> i32
fn opentype_math_constant( &mut self, _font: PortableFontHandle, _constant: i32, ) -> i32
fn opentype_math_accent_position( &mut self, _font: PortableFontHandle, _glyph: i32, ) -> i32
Sourcefn math_glyph_italic_correction(
&mut self,
_font: PortableFontHandle,
_glyph: i32,
) -> i32
fn math_glyph_italic_correction( &mut self, _font: PortableFontHandle, _glyph: i32, ) -> i32
OpenType MATH italic correction for a glyph, in scaled points.
Sourcefn math_glyph_variant(
&mut self,
_font: PortableFontHandle,
_glyph: i32,
_index: u16,
_horizontal: bool,
) -> Option<PortableMathVariant>
fn math_glyph_variant( &mut self, _font: PortableFontHandle, _glyph: i32, _index: u16, _horizontal: bool, ) -> Option<PortableMathVariant>
The index-th larger MATH glyph variant of glyph (horizontal or
vertical), or None when there is no such variant. The advance is in
scaled points.
Sourcefn math_glyph_assembly(
&mut self,
_font: PortableFontHandle,
_glyph: i32,
_horizontal: bool,
) -> Vec<PortableMathAssemblyPart>
fn math_glyph_assembly( &mut self, _font: PortableFontHandle, _glyph: i32, _horizontal: bool, ) -> Vec<PortableMathAssemblyPart>
The MATH glyph-assembly parts for glyph (horizontal or vertical), each
metric in scaled points. Empty when the glyph has no assembly.
Sourcefn math_min_connector_overlap(&mut self, _font: PortableFontHandle) -> i32
fn math_min_connector_overlap(&mut self, _font: PortableFontHandle) -> i32
The MATH minimum connector overlap for assembly parts, in scaled points.
Sourcefn math_kern_at(
&mut self,
_font: PortableFontHandle,
_glyph: i32,
_corner: PortableMathKernCorner,
_correction_height: i32,
) -> i32
fn math_kern_at( &mut self, _font: PortableFontHandle, _glyph: i32, _corner: PortableMathKernCorner, _correction_height: i32, ) -> i32
One MATH MathKernInfo corner evaluated at correction_height (font
design units), returned in raw font design units (NOT scaled).
Sourcefn math_points_to_units(
&mut self,
_font: PortableFontHandle,
_points: f32,
) -> f32
fn math_points_to_units( &mut self, _font: PortableFontHandle, _points: f32, ) -> f32
Convert a measurement in points to font design units for font
(pointsToUnits).
Sourcefn math_units_to_scaled(
&mut self,
_font: PortableFontHandle,
_units: i32,
) -> i32
fn math_units_to_scaled( &mut self, _font: PortableFontHandle, _units: i32, ) -> i32
Convert a measurement in font design units to scaled points for font
(D2Fix(unitsToPoints(...))).
Sourcefn math_point_size(&mut self, _font: PortableFontHandle) -> f32
fn math_point_size(&mut self, _font: PortableFontHandle) -> f32
The point size at which font was loaded (getPointSize).
fn map_char_to_glyph( &mut self, _font: PortableFontHandle, _codepoint: i32, ) -> i32
fn map_glyph_to_index(&mut self, _font: PortableFontHandle, _name: &str) -> i32
Sourcefn ot_font_get(
&mut self,
_font: PortableFontHandle,
_what: i32,
_param1: i32,
_param2: i32,
_param3: i32,
) -> i32
fn ot_font_get( &mut self, _font: PortableFontHandle, _what: i32, _param1: i32, _param2: i32, _param3: i32, ) -> i32
OpenType layout enumeration backing the \XeTeXOT* / \XeTeXcountglyphs
last_item primitives (XeTeX ot_font_get/_1/_2/_3). what is the
XeTeX_ext code (1 = count glyphs, 16 = count scripts, 17 = count
languages, 18 = count features, 19 = script tag, 20 = language tag,
21 = feature tag); unused params are 0.
Sourcefn font_spec(&self, _font: PortableFontHandle) -> Option<String>
fn font_spec(&self, _font: PortableFontHandle) -> Option<String>
The \font spec string a loaded handle was created from (e.g.
[latinmodern-math.otf]:script=math;ssty=1). Immutable so the read-only
IR-building path can recover the originating font file for a glyph run.
fn shape_native_text( &mut self, _font: PortableFontHandle, _text: &[u16], _use_glyph_metrics: bool, ) -> PortableNativeTextMetrics
fn measure_native_glyph( &mut self, _font: PortableFontHandle, _glyph: u16, _use_glyph_metrics: bool, ) -> PortableNativeGlyphMetrics
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".