Skip to main content

TextParams

Struct TextParams 

Source
pub struct TextParams {
Show 22 fields pub text: Vec<u8>, pub start_x: f64, pub start_y: f64, pub font_entity: u32, pub font_name: Vec<u8>, pub font_type: i32, pub font_size: f64, pub color: DeviceColor, pub ctm: [f64; 6], pub font_matrix: [f64; 6], pub paint_type: i32, pub stroke_width: f64, pub spot_color: Option<SpotColor>, pub rendering_intent: u8, pub transfer: TransferState, pub halftone: HalftoneState, pub bg_ucr: BgUcrState, pub fill_opacity: f64, pub stroke_opacity: f64, pub blend_mode: u8, pub alpha_is_shape: bool, pub text_knockout: bool,
}
Expand description

Parameters for a text element emitted by show operators.

The PDF device uses these for BT/ET/Tf/Tj text operators. The raster device ignores them (uses Fill elements for glyph paths).

New fields may be added without notice; pattern-matching consumers should use .. to ignore unmatched fields.

Fields§

§text: Vec<u8>

Character bytes (or 2-byte CID values for Type 0).

§start_x: f64

Device-space X position at start of string.

§start_y: f64

Device-space Y position at start of string.

§font_entity: u32

Font dict entity ID (raw u32 for VM independence).

§font_name: Vec<u8>

FontName bytes (e.g., b“Times-Roman“).

§font_type: i32

FontType (0, 1, 2, 3, 42).

§font_size: f64

Effective device-space font size.

§color: DeviceColor

Fill color at render time.

§ctm: [f64; 6]

CTM at render time.

§font_matrix: [f64; 6]

User-space font matrix (scaled to point units).

§paint_type: i32

PaintType: 0 = fill (default), 2 = stroke (outlined glyphs).

§stroke_width: f64

Device-space stroke width for PaintType 2 fonts.

§spot_color: Option<SpotColor>

Separation/DeviceN color for PDF output. None for device color spaces.

§rendering_intent: u8

Rendering intent (0=RelativeColorimetric, 1=Absolute, 2=Perceptual, 3=Saturation).

§transfer: TransferState

Pre-sampled transfer function state for PDF output.

§halftone: HalftoneState

Pre-computed halftone screen state for PDF output.

§bg_ucr: BgUcrState

Pre-sampled black generation / undercolor removal for PDF output.

§fill_opacity: f64

Fill opacity (0.0–1.0, default 1.0). Used by PDF transparency.

§stroke_opacity: f64

Stroke opacity (0.0–1.0, default 1.0). Applies to PaintType-2 fonts.

§blend_mode: u8

Blend mode (0=Normal, 1=Multiply, …, 15=Luminosity). Default 0.

§alpha_is_shape: bool

Alpha-is-shape (PDF AIS). Default false.

§text_knockout: bool

Text knockout (PDF TK). Default true.

Trait Implementations§

Source§

impl Clone for TextParams

Source§

fn clone(&self) -> TextParams

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 Debug for TextParams

Source§

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

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

impl Default for TextParams

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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, 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.