pub struct FreeTextSpec { /* private fields */ }Expand description
A free-text annotation (/Subtype /FreeText): text drawn on the page
rather than held behind an icon.
The one subtype whose text is required — a free-text annotation with no
/Contents has nothing to draw — so it is a constructor argument here
rather than the optional contents every other builder has, and this
builder declares the shared metadata setters itself instead of taking them
from spec_builder!.
Implementations§
Source§impl FreeTextSpec
impl FreeTextSpec
Sourcepub fn new(rect: Rect, color: Color, contents: impl Into<String>) -> Self
pub fn new(rect: Rect, color: Color, contents: impl Into<String>) -> Self
Free text over rect, with DEFAULT_DA as the
default appearance.
Sourcepub fn da(self, da: impl Into<String>) -> Self
pub fn da(self, da: impl Into<String>) -> Self
Sets /DA, the default-appearance string naming the font and size the
body is laid out with.
Left unset this is DEFAULT_DA.
Sourcepub fn align(self, align: Alignment) -> Self
pub fn align(self, align: Alignment) -> Self
Sets /Q, the text alignment.
Unset leaves the key out, which a reader takes as flush left.
Sets /T, the author.
Sourcepub fn name(self, name: impl Into<String>) -> AnnotWrite
pub fn name(self, name: impl Into<String>) -> AnnotWrite
Sets /NM, the annotation’s unique name.
Sourcepub fn modified(self, modified: impl Into<String>) -> AnnotWrite
pub fn modified(self, modified: impl Into<String>) -> AnnotWrite
Sets /M, the modification date.
Sourcepub fn flags(self, flags: AnnotFlags) -> AnnotWrite
pub fn flags(self, flags: AnnotFlags) -> AnnotWrite
Sets /F, the annotation flags.
Sourcepub fn meta(self, meta: AnnotMeta) -> AnnotWrite
pub fn meta(self, meta: AnnotMeta) -> AnnotWrite
Sets every metadata field at once.
Trait Implementations§
Source§impl Clone for FreeTextSpec
impl Clone for FreeTextSpec
Source§impl Debug for FreeTextSpec
impl Debug for FreeTextSpec
Source§impl From<FreeTextSpec> for AnnotSpec
impl From<FreeTextSpec> for AnnotSpec
Source§fn from(b: FreeTextSpec) -> Self
fn from(b: FreeTextSpec) -> Self
Source§impl From<FreeTextSpec> for AnnotWrite
impl From<FreeTextSpec> for AnnotWrite
Source§fn from(builder: FreeTextSpec) -> Self
fn from(builder: FreeTextSpec) -> Self
Source§impl PartialEq for FreeTextSpec
impl PartialEq for FreeTextSpec
impl StructuralPartialEq for FreeTextSpec
Auto Trait Implementations§
impl Freeze for FreeTextSpec
impl RefUnwindSafe for FreeTextSpec
impl Send for FreeTextSpec
impl Sync for FreeTextSpec
impl Unpin for FreeTextSpec
impl UnsafeUnpin for FreeTextSpec
impl UnwindSafe for FreeTextSpec
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.