pub struct PdfPageTextChar<'a> { /* private fields */ }Expand description
A single character in a PdfPageTextChars collection.
Implementations§
Source§impl<'a> PdfPageTextChar<'a>
impl<'a> PdfPageTextChar<'a>
Sourcepub fn bindings(&self) -> &'a dyn PdfiumLibraryBindings
pub fn bindings(&self) -> &'a dyn PdfiumLibraryBindings
Returns the PdfiumLibraryBindings used by this PdfPageTextChar.
pub fn index(&self) -> PdfPageTextCharIndex
Sourcepub fn unicode_value(&self) -> u32
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.
Sourcepub fn unicode_char(&self) -> Option<char>
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.
Sourcepub fn unicode_string(&self) -> Option<String>
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.
Sourcepub fn scaled_font_size(&self) -> PdfPoints
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.
Sourcepub fn unscaled_font_size(&self) -> PdfPoints
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.
Sourcepub fn font_weight(&self) -> Option<PdfFontWeight>
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.
Sourcepub fn font_is_fixed_pitch(&self) -> bool
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.
Sourcepub fn font_is_proportional_pitch(&self) -> bool
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.
Sourcepub fn font_is_serif(&self) -> bool
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.
Sourcepub fn font_is_sans_serif(&self) -> bool
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.
Sourcepub fn font_is_symbolic(&self) -> bool
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.
Sourcepub fn font_is_non_symbolic(&self) -> bool
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.
Sourcepub fn font_is_cursive(&self) -> bool
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.
Sourcepub fn font_is_italic(&self) -> bool
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.
Sourcepub fn font_is_all_caps(&self) -> bool
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.
Sourcepub fn font_is_small_caps(&self) -> bool
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.
Sourcepub fn font_is_bold_reenforced(&self) -> bool
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.
Sourcepub fn text_object(&self) -> Result<PdfPageTextObject<'_>, PdfiumError>
pub fn text_object(&self) -> Result<PdfPageTextObject<'_>, PdfiumError>
Returns the page text object that contains this character.
Sourcepub fn render_mode(&self) -> Result<PdfPageTextRenderMode, PdfiumError>
pub fn render_mode(&self) -> Result<PdfPageTextRenderMode, PdfiumError>
Returns the text rendering mode for this character.
Sourcepub fn fill_color(&self) -> Result<PdfColor, PdfiumError>
pub fn fill_color(&self) -> Result<PdfColor, PdfiumError>
Returns the fill color applied to this character.
Sourcepub fn stroke_color(&self) -> Result<PdfColor, PdfiumError>
pub fn stroke_color(&self) -> Result<PdfColor, PdfiumError>
Returns the stroke color applied to this character.
Sourcepub fn angle_degrees(&self) -> Result<f32, PdfiumError>
pub fn angle_degrees(&self) -> Result<f32, PdfiumError>
Returns the rotation angle of this character, expressed in degrees.
Sourcepub fn angle_radians(&self) -> Result<f32, PdfiumError>
pub fn angle_radians(&self) -> Result<f32, PdfiumError>
Returns the rotation angle of this character, expressed in radians.
Sourcepub fn tight_bounds(&self) -> Result<PdfRect, PdfiumError>
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.
Sourcepub fn loose_bounds(&self) -> Result<PdfRect, PdfiumError>
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.
Sourcepub fn matrix(&self) -> Result<PdfMatrix, PdfiumError>
pub fn matrix(&self) -> Result<PdfMatrix, PdfiumError>
Returns the transformation matrix currently applied to this PdfPageTextChar.
Sourcepub fn get_translation(&self) -> (PdfPoints, PdfPoints)
pub fn get_translation(&self) -> (PdfPoints, PdfPoints)
Returns the current horizontal and vertical translation of the origin of this PdfPageTextChar.
Sourcepub fn get_horizontal_translation(&self) -> PdfPoints
pub fn get_horizontal_translation(&self) -> PdfPoints
Returns the current horizontal translation of the origin of this PdfPageTextChar.
Sourcepub fn get_vertical_translation(&self) -> PdfPoints
pub fn get_vertical_translation(&self) -> PdfPoints
Returns the current vertical translation of the origin of this PdfPageTextChar.
Sourcepub fn get_scale(&self) -> (PdfMatrixValue, PdfMatrixValue)
pub fn get_scale(&self) -> (PdfMatrixValue, PdfMatrixValue)
Returns the current horizontal and vertical scale factors applied to this PdfPageTextChar.
Sourcepub fn get_horizontal_scale(&self) -> PdfMatrixValue
pub fn get_horizontal_scale(&self) -> PdfMatrixValue
Returns the current horizontal scale factor applied to this PdfPageTextChar.
Sourcepub fn get_vertical_scale(&self) -> PdfMatrixValue
pub fn get_vertical_scale(&self) -> PdfMatrixValue
Returns the current vertical scale factor applied to this PdfPageTextChar.
Sourcepub fn get_rotation_counter_clockwise_degrees(&self) -> PdfMatrixValue
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.
Sourcepub fn get_rotation_clockwise_degrees(&self) -> PdfMatrixValue
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.
Sourcepub fn get_rotation_counter_clockwise_radians(&self) -> PdfMatrixValue
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.
Sourcepub fn get_rotation_clockwise_radians(&self) -> PdfMatrixValue
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.
Sourcepub fn get_skew_degrees(&self) -> (PdfMatrixValue, PdfMatrixValue)
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.
Sourcepub fn get_x_axis_skew_degrees(&self) -> PdfMatrixValue
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.
Sourcepub fn get_y_axis_skew_degrees(&self) -> PdfMatrixValue
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.
Sourcepub fn get_skew_radians(&self) -> (PdfMatrixValue, PdfMatrixValue)
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.
Sourcepub fn get_x_axis_skew_radians(&self) -> PdfMatrixValue
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.
Sourcepub fn get_y_axis_skew_radians(&self) -> PdfMatrixValue
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.
Sourcepub fn origin(&self) -> Result<(PdfPoints, PdfPoints), PdfiumError>
pub fn origin(&self) -> Result<(PdfPoints, PdfPoints), PdfiumError>
Returns the origin x and y positions of this character relative to its containing page.
Sourcepub fn origin_x(&self) -> Result<PdfPoints, PdfiumError>
pub fn origin_x(&self) -> Result<PdfPoints, PdfiumError>
Returns the origin x position of this character relative to its containing page.
Sourcepub fn origin_y(&self) -> Result<PdfPoints, PdfiumError>
pub fn origin_y(&self) -> Result<PdfPoints, PdfiumError>
Returns the origin y position of this character relative to its containing page.
Sourcepub fn has_descender(&self) -> bool
pub fn has_descender(&self) -> bool
Returns true if the glyph shape of this character descends below the font baseline.
Sourcepub fn is_generated(&self) -> Result<bool, PdfiumError>
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.
Sourcepub fn is_hyphen(&self) -> Result<bool, PdfiumError>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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