#[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
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.cid: u162-byte code (glyph id) in the active CID-keyed font.
adjust: f32Position 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: f32Per-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
impl CidShowElement
Sourcepub fn new(cid: u16, adjust: f32) -> Self
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.
Sourcepub fn with_x_offset(self, x_offset: f32) -> Self
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
impl Clone for CidShowElement
Source§fn clone(&self) -> CidShowElement
fn clone(&self) -> CidShowElement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more