Skip to main content

CidShowElement

Struct CidShowElement 

Source
#[non_exhaustive]
pub struct CidShowElement { pub cid: u16, pub adjust: f32, pub x_offset: f32, }
Expand description

One element of a positioned glyph run drawn with GraphicsContext::show_cid_array (issue #358).

cid is a 2-byte code in the active CID-keyed font (a glyph id under CIDToGIDMap = Identity). adjust is an optional position adjustment applied AFTER this glyph, in thousandths of a unit of text space — the TJ convention, where a positive value moves the next glyph left (back) and a negative value moves it right (forward). Use 0.0 for no adjustment.

The core treats cid as an opaque code and does not perform shaping; a consumer (e.g. oxidize-compose) produces these from a shaped run.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§cid: u16

2-byte code (glyph id) in the active CID-keyed font.

§adjust: f32

Position adjustment applied to the pen advance after this glyph (thousandths of text-space units; 0.0 = none). This is the TJ kern: a positive value moves the next glyph left, a negative value moves it right.

§x_offset: f32

Per-glyph horizontal offset (issue #358 #3): displaces this glyph from its pen position by x_offset thousandths of a text-space unit (positive = right) without changing the advance to the next glyph. Used for GPOS mark attachment / diacritics, where a glyph must be nudged independently of its advance. 0.0 = drawn at the pen position. Distinct from adjust, which consumes advance.

Implementations§

Source§

impl CidShowElement

Source

pub fn new(cid: u16, adjust: f32) -> Self

Construct a positioned glyph-run element with no per-glyph offset.

This type is #[non_exhaustive], so external consumers (e.g. oxidize-compose) must build it through this constructor rather than a struct literal — letting future iterations add fields without a breaking change. cid is a 2-byte code (glyph id under CIDToGIDMap = Identity); adjust is the post-glyph advance adjustment in thousandths of a text-space unit (0.0 = none). x_offset defaults to 0.0; set it with with_x_offset.

Source

pub fn with_x_offset(self, x_offset: f32) -> Self

Set the per-glyph horizontal offset (see x_offset).

Trait Implementations§

Source§

impl Clone for CidShowElement

Source§

fn clone(&self) -> CidShowElement

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for CidShowElement

Source§

impl Debug for CidShowElement

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CidShowElement

Source§

fn eq(&self, other: &CidShowElement) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CidShowElement

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more