Skip to main content

MacFontAdapter

Struct MacFontAdapter 

Source
pub struct MacFontAdapter<D: MacBridgeDriver> { /* private fields */ }
Expand description

Safe platform font adapter translating CoreText / CoreGraphics records into shared text runs.

Implementations§

Source§

impl<D: MacBridgeDriver> MacFontAdapter<D>

Source

pub fn new(driver: D) -> Self

Create a new Mac font adapter with default configuration.

Source

pub fn with_config(driver: D, config: MacFontAdapterConfig) -> Self

Create a new Mac font adapter with explicit configuration.

Source

pub fn config(&self) -> &MacFontAdapterConfig

Retrieve a reference to the active configuration.

Source

pub fn driver(&self) -> &D

Retrieve a reference to the underlying driver.

Source

pub fn get_glyph_rgba_raster( &self, font_postscript_name: &str, glyph_id: u16, font_size_px: f32, ) -> Result<Option<RawCoreGraphicsRaster>, MacFontAdapterError>

Rasterize a glyph through CoreGraphics, returning validated RGBA8 pixels.

Trait Implementations§

Source§

impl<D: MacBridgeDriver> NativeShapingRoute for MacFontAdapter<D>

Source§

fn route_kind(&self) -> ShapingRouteKind

Return the route classification.
Source§

fn capabilities(&self) -> ShapingRouteCapabilities

Return declared capability parameters and operational limits.
Source§

fn shape_run( &self, req: &NativeShapingRequest<'_>, ) -> Result<OwnedTextRun, NativeShapingError>

Shape a slice of text into an owned text run.

Auto Trait Implementations§

§

impl<D> Freeze for MacFontAdapter<D>
where D: Freeze,

§

impl<D> RefUnwindSafe for MacFontAdapter<D>
where D: RefUnwindSafe,

§

impl<D> Send for MacFontAdapter<D>

§

impl<D> Sync for MacFontAdapter<D>

§

impl<D> Unpin for MacFontAdapter<D>
where D: Unpin,

§

impl<D> UnsafeUnpin for MacFontAdapter<D>
where D: UnsafeUnpin,

§

impl<D> UnwindSafe for MacFontAdapter<D>
where D: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.