pub enum IndirectFontRef {
Builtin(BuiltinFont),
External(FontId),
}Expand description
Compatibility wrapper for a font reference (either builtin or external) to adapt to
printpdf 0.8 which uses FontId for external fonts and BuiltinFont for builtin ones.
Variants§
Builtin(BuiltinFont)
Built-in font (printpdf::BuiltinFont), e.g. Times Roman.
Built-in fonts are handled as builtin and do not have a FontId.
External(FontId)
External font added to the document (printpdf::FontId).
Represents a font loaded into the document and referencable by FontId.
Implementations§
Source§impl IndirectFontRef
impl IndirectFontRef
Sourcepub fn into_op_font(&self) -> Result<FontId, ()>
pub fn into_op_font(&self) -> Result<FontId, ()>
Converts the reference to a printpdf::FontId if possible.
Returns Ok(FontId) if the reference is an external font (External),
or Err(()) if it represents a built-in font (Builtin) which does not have a
FontId.
Trait Implementations§
Source§impl Clone for IndirectFontRef
impl Clone for IndirectFontRef
Source§fn clone(&self) -> IndirectFontRef
fn clone(&self) -> IndirectFontRef
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IndirectFontRef
impl Debug for IndirectFontRef
Source§impl PartialEq for IndirectFontRef
impl PartialEq for IndirectFontRef
impl StructuralPartialEq for IndirectFontRef
Auto Trait Implementations§
impl Freeze for IndirectFontRef
impl RefUnwindSafe for IndirectFontRef
impl Send for IndirectFontRef
impl Sync for IndirectFontRef
impl Unpin for IndirectFontRef
impl UnwindSafe for IndirectFontRef
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.