Skip to main content

PdfTextIsland

Struct PdfTextIsland 

Source
pub struct PdfTextIsland {
    pub id: String,
    pub text: String,
    pub quads: Vec<[f64; 8]>,
    pub baseline: [f64; 4],
    pub appearance: PdfTextAppearance,
    pub locator: PdfSourceLocator,
    pub editable: bool,
    pub rejection: Option<PdfEditError>,
    pub edit_blocker: Option<PdfEditBlocker>,
    pub substitution_editable: bool,
    pub gaps: Vec<PdfTextGap>,
    /* private fields */
}

Fields§

§id: String§text: String§quads: Vec<[f64; 8]>§baseline: [f64; 4]§appearance: PdfTextAppearance§locator: PdfSourceLocator§editable: bool

True when a replacement can be written through the island’s own font (same appearance). This is the same decision compose_candidate makes; the two cannot disagree. It does not promise that every text is encodable: a replacement needing a glyph the font lacks fails with PdfEditError::MissingGlyphs.

§rejection: Option<PdfEditError>

Some(UnsupportedEncoding) whenever editable is false.

§edit_blocker: Option<PdfEditBlocker>

Typed reason when editable is false (additive; null when editable).

§substitution_editable: bool

True when the island’s source glyphs can be removed and the text redrawn in a catalog font (a changed appearance), whatever the source font - and the composer will accept that edit. False for a rejected island and for an island whose source glyphs live in more than one content stream (edit_blocker is then spans_across_streams): the composer removes the old glyphs from one stream only, so it refuses that edit.

§gaps: Vec<PdfTextGap>

Synthesised word gaps inside text (additive; empty when the run has real spaces only).

Trait Implementations§

Source§

impl Serialize for PdfTextIsland

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.