pub struct WidgetAppearance { /* private fields */ }Expand description
A widget’s appearance characteristics — its /MK dictionary.
The generator reads /MK on every regeneration, so writing one is
enough to change how a field is drawn: there is no separate appearance to
keep in step. An unset field leaves that key alone rather than writing a
default, which is what lets this edit one characteristic of a widget
without flattening the rest.
use pdfrum_edit::WidgetAppearance;
use peniko::Color;
let mk = WidgetAppearance::new()
.background(Color::from_rgb8(240, 240, 240))
.border(Color::from_rgb8(0, 0, 0));
// Characteristics left unset keep whatever the widget already had.
assert_eq!(mk, mk.clone());Implementations§
Source§impl WidgetAppearance
impl WidgetAppearance
Sourcepub fn background(self, color: Color) -> Self
pub fn background(self, color: Color) -> Self
/BG: the colour behind the field.
Sourcepub fn border(self, color: Color) -> Self
pub fn border(self, color: Color) -> Self
/BC: the border colour.
A widget’s border is drawn only when this names one — the /BS width
alone does not produce a visible edge.
Trait Implementations§
Source§impl Clone for WidgetAppearance
impl Clone for WidgetAppearance
Source§impl Debug for WidgetAppearance
impl Debug for WidgetAppearance
Source§impl Default for WidgetAppearance
impl Default for WidgetAppearance
Source§impl PartialEq for WidgetAppearance
impl PartialEq for WidgetAppearance
impl StructuralPartialEq for WidgetAppearance
Auto Trait Implementations§
impl Freeze for WidgetAppearance
impl RefUnwindSafe for WidgetAppearance
impl Send for WidgetAppearance
impl Sync for WidgetAppearance
impl Unpin for WidgetAppearance
impl UnsafeUnpin for WidgetAppearance
impl UnwindSafe for WidgetAppearance
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<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
Convert this type into
T, using the provided data to resolve any offsets.