PdfPageTextChar

Struct PdfPageTextChar 

Source
pub struct PdfPageTextChar<'a> { /* private fields */ }
Expand description

A single character in a PdfPageTextChars collection.

Implementations§

Source§

impl<'a> PdfPageTextChar<'a>

Source

pub fn bindings(&self) -> &'a dyn PdfiumLibraryBindings

Returns the PdfiumLibraryBindings used by this PdfPageTextChar.

Source

pub fn index(&self) -> PdfPageTextCharIndex

Source

pub fn unicode_value(&self) -> u32

Returns the raw Unicode literal value for this character.

To return Rust’s Unicode char representation of this Unicode literal, use the PdfPageTextChar::unicode_char function. To return the string representation of this Unicode literal, use the PdfPageTextChar::unicode_string function.

Source

pub fn unicode_char(&self) -> Option<char>

Returns Rust’s Unicode char representation for this character, if available.

To return the raw Unicode literal value for this character, use the PdfPageTextChar::unicode_value function. To return the string representation of this char, use the PdfPageTextChar::unicode_string function.

Source

pub fn unicode_string(&self) -> Option<String>

Returns a string containing Rust’s Unicode char representation for this character, if available.

To return the raw Unicode literal value for this character, use the PdfPageTextChar::unicode_value function. To return Rust’s Unicode char representation of this Unicode literal, use the PdfPageTextChar::unicode_char function.

Source

pub fn scaled_font_size(&self) -> PdfPoints

Returns the effective size of this character when rendered, taking into account both the font size applied to the character as well as any vertical scale factor applied to the character’s transformation matrix.

To retrieve only the specified font size, ignoring any vertical scaling, use the PdfPageTextChar::unscaled_font_size function.

Source

pub fn unscaled_font_size(&self) -> PdfPoints

Returns the font size applied to this character.

Note that the effective size of the character when rendered may differ from the font size if a scaling factor has been applied to this character’s transformation matrix. To retrieve the effective font size, taking vertical scaling into account, use the PdfPageTextChar::scaled_font_size function.

Source

pub fn font_name(&self) -> String

Returns the name of the font applied to this character.

Source

pub fn font_weight(&self) -> Option<PdfFontWeight>

Returns the weight of the font applied to this character.

Pdfium may not reliably return the correct value of this property for built-in fonts.

Source

pub fn font_is_fixed_pitch(&self) -> bool

Returns true if all the glyphs in the font applied to this character have the same width.

Pdfium may not reliably return the correct value of this flag for built-in fonts.

Source

pub fn font_is_proportional_pitch(&self) -> bool

Returns true if the glyphs in the font applied to this character have variable widths.

Pdfium may not reliably return the correct value of this flag for built-in fonts.

Source

pub fn font_is_serif(&self) -> bool

Returns true if one or more glyphs in the font applied to this character have serifs - short strokes drawn at an angle on the top or bottom of glyph stems to decorate the glyphs. For example, Times New Roman is a serif font.

Pdfium may not reliably return the correct value of this flag for built-in fonts.

Source

pub fn font_is_sans_serif(&self) -> bool

Returns true if no glyphs in the font applied to this character have serifs - short strokes drawn at an angle on the top or bottom of glyph stems to decorate the glyphs. For example, Helvetica is a sans-serif font.

Pdfium may not reliably return the correct value of this flag for built-in fonts.

Source

pub fn font_is_symbolic(&self) -> bool

Returns true if the font applied to this character contains glyphs outside the Adobe standard Latin character set.

This classification of non-symbolic and symbolic fonts is peculiar to PDF. A font may contain additional characters that are used in Latin writing systems but are outside the Adobe standard Latin character set; PDF considers such a font to be symbolic.

Pdfium may not reliably return the correct value of this flag for built-in fonts.

Source

pub fn font_is_non_symbolic(&self) -> bool

Returns true if the font applied to this character does not contain glyphs outside the Adobe standard Latin character set.

This classification of non-symbolic and symbolic fonts is peculiar to PDF. A font may contain additional characters that are used in Latin writing systems but are outside the Adobe standard Latin character set; PDF considers such a font to be symbolic.

Pdfium may not reliably return the correct value of this flag for built-in fonts.

Source

pub fn font_is_cursive(&self) -> bool

Returns true if the glyphs in the font applied to this character are designed to resemble cursive handwriting.

Pdfium may not reliably return the correct value of this flag for built-in fonts.

Source

pub fn font_is_italic(&self) -> bool

Returns true if the glyphs in the font applied to this character include dominant vertical strokes that are slanted.

Pdfium may not reliably return the correct value of this flag for built-in fonts.

Source

pub fn font_is_all_caps(&self) -> bool

Returns true if the font applied to this character contains no lowercase letters by design.

Pdfium may not reliably return the correct value of this flag for built-in fonts.

Source

pub fn font_is_small_caps(&self) -> bool

Returns true if the lowercase letters in the font applied to this character have the same shapes as the corresponding uppercase letters but are sized proportionally so they have the same size and stroke weight as lowercase glyphs in the same typeface family.

Pdfium may not reliably return the correct value of this flag for built-in fonts.

Source

pub fn font_is_bold_reenforced(&self) -> bool

Returns true if bold glyphs in the font applied to this character are painted with extra pixels at very small font sizes.

Typically when glyphs are painted at small sizes on low-resolution devices, individual strokes of bold glyphs may appear only one pixel wide. Because this is the minimum width of a pixel based device, individual strokes of non-bold glyphs may also appear as one pixel wide and therefore cannot be distinguished from bold glyphs. If this flag is set, individual strokes of bold glyphs may be thickened at small font sizes.

Pdfium may not reliably return the correct value of this flag for built-in fonts.

Source

pub fn text_object(&self) -> Result<PdfPageTextObject<'_>, PdfiumError>

Returns the page text object that contains this character.

Source

pub fn render_mode(&self) -> Result<PdfPageTextRenderMode, PdfiumError>

Returns the text rendering mode for this character.

Source

pub fn fill_color(&self) -> Result<PdfColor, PdfiumError>

Returns the fill color applied to this character.

Source

pub fn stroke_color(&self) -> Result<PdfColor, PdfiumError>

Returns the stroke color applied to this character.

Source

pub fn angle_degrees(&self) -> Result<f32, PdfiumError>

Returns the rotation angle of this character, expressed in degrees.

Source

pub fn angle_radians(&self) -> Result<f32, PdfiumError>

Returns the rotation angle of this character, expressed in radians.

Source

pub fn tight_bounds(&self) -> Result<PdfRect, PdfiumError>

Returns a precise bounding box for this character, taking the character’s specific shape into account.

To return a loose bounding box that contains the entire glyph bounds, use the PdfPageTextChar::loose_bounds function.

Source

pub fn loose_bounds(&self) -> Result<PdfRect, PdfiumError>

Returns a loose bounding box for this character, containing the entire glyph bounds.

To return a tight bounding box that takes this character’s specific shape into account, use the PdfPageTextChar::tight_bounds function.

Source

pub fn matrix(&self) -> Result<PdfMatrix, PdfiumError>

Returns the transformation matrix currently applied to this PdfPageTextChar.

Source

pub fn get_translation(&self) -> (PdfPoints, PdfPoints)

Returns the current horizontal and vertical translation of the origin of this PdfPageTextChar.

Source

pub fn get_horizontal_translation(&self) -> PdfPoints

Returns the current horizontal translation of the origin of this PdfPageTextChar.

Source

pub fn get_vertical_translation(&self) -> PdfPoints

Returns the current vertical translation of the origin of this PdfPageTextChar.

Source

pub fn get_scale(&self) -> (PdfMatrixValue, PdfMatrixValue)

Returns the current horizontal and vertical scale factors applied to this PdfPageTextChar.

Source

pub fn get_horizontal_scale(&self) -> PdfMatrixValue

Returns the current horizontal scale factor applied to this PdfPageTextChar.

Source

pub fn get_vertical_scale(&self) -> PdfMatrixValue

Returns the current vertical scale factor applied to this PdfPageTextChar.

Source

pub fn get_rotation_counter_clockwise_degrees(&self) -> PdfMatrixValue

Returns the counter-clockwise rotation applied to this PdfPageTextChar, in degrees.

If the object is both rotated and skewed, the return value of this function will reflect the combined operation.

Source

pub fn get_rotation_clockwise_degrees(&self) -> PdfMatrixValue

Returns the clockwise rotation applied to this PdfPageTextChar, in degrees.

If the object is both rotated and skewed, the return value of this function will reflect the combined operation.

Source

pub fn get_rotation_counter_clockwise_radians(&self) -> PdfMatrixValue

Returns the counter-clockwise rotation applied to this PdfPageTextChar, in radians.

If the object is both rotated and skewed, the return value of this function will reflect the combined operation.

Source

pub fn get_rotation_clockwise_radians(&self) -> PdfMatrixValue

Returns the clockwise rotation applied to this PdfPageTextChar, in radians.

If the object is both rotated and skewed, the return value of this function will reflect the combined operation.

Source

pub fn get_skew_degrees(&self) -> (PdfMatrixValue, PdfMatrixValue)

Returns the current x axis and y axis skew angles applied to this PdfPageTextChar, in degrees.

If the object is both rotated and skewed, the return value of this function will reflect the combined operation.

Source

pub fn get_x_axis_skew_degrees(&self) -> PdfMatrixValue

Returns the current x axis skew angle applied to this PdfPageTextChar, in degrees.

If the object is both rotated and skewed, the return value of this function will reflect the combined operation.

Source

pub fn get_y_axis_skew_degrees(&self) -> PdfMatrixValue

Returns the current y axis skew applied to this PdfPageTextChar, in degrees.

If the object is both rotated and skewed, the return value of this function will reflect the combined operation.

Source

pub fn get_skew_radians(&self) -> (PdfMatrixValue, PdfMatrixValue)

Returns the current x axis and y axis skew angles applied to this PdfPageTextChar, in radians.

If the object is both rotated and skewed, the return value of this function will reflect the combined operation.

Source

pub fn get_x_axis_skew_radians(&self) -> PdfMatrixValue

Returns the current x axis skew applied to this PdfPageTextChar, in radians.

If the object is both rotated and skewed, the return value of this function will reflect the combined operation.

Source

pub fn get_y_axis_skew_radians(&self) -> PdfMatrixValue

Returns the current y axis skew applied to this PdfPageTextChar, in radians.

If the object is both rotated and skewed, the return value of this function will reflect the combined operation.

Source

pub fn origin(&self) -> Result<(PdfPoints, PdfPoints), PdfiumError>

Returns the origin x and y positions of this character relative to its containing page.

Source

pub fn origin_x(&self) -> Result<PdfPoints, PdfiumError>

Returns the origin x position of this character relative to its containing page.

Source

pub fn origin_y(&self) -> Result<PdfPoints, PdfiumError>

Returns the origin y position of this character relative to its containing page.

Source

pub fn has_descender(&self) -> bool

Returns true if the glyph shape of this character descends below the font baseline.

Source

pub fn is_generated(&self) -> Result<bool, PdfiumError>

Returns true if this character was generated by Pdfium. This can be the case for certain spacing, breaking, and justification-related characters.

Source

pub fn is_hyphen(&self) -> Result<bool, PdfiumError>

Returns true if this character is recognized as a hyphen by Pdfium.

Auto Trait Implementations§

§

impl<'a> Freeze for PdfPageTextChar<'a>

§

impl<'a> !RefUnwindSafe for PdfPageTextChar<'a>

§

impl<'a> !Send for PdfPageTextChar<'a>

§

impl<'a> !Sync for PdfPageTextChar<'a>

§

impl<'a> Unpin for PdfPageTextChar<'a>

§

impl<'a> !UnwindSafe for PdfPageTextChar<'a>

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.