pub struct TableStyle {
pub header_background: Option<Color>,
pub header_text_color: Option<Color>,
pub font_size: f64,
pub header_font: Option<Font>,
pub header_bold: Option<bool>,
}Expand description
Predefined table styles
Fields§
§header_background: Option<Color>Header background color
header_text_color: Option<Color>Header text color
font_size: f64Default font size
header_font: Option<Font>Header font override. None keeps the legacy default (Font::Helvetica).
See issue #217.
header_bold: Option<bool>Header bold override. None keeps the legacy default (true).
Combined with header_font, the rendering layer maps non-oblique
builtin fonts to their *Bold variant (e.g. TimesRoman + bold=true
→ TimesBold); oblique fonts and custom fonts are passed through
unchanged.
Implementations§
Source§impl TableStyle
impl TableStyle
Sourcepub fn professional() -> Self
pub fn professional() -> Self
Create a professional table style
Sourcepub fn with_header_font(self, font: Font) -> Self
pub fn with_header_font(self, font: Font) -> Self
Override the header font. Chainable on presets.
use oxidize_pdf::page_tables::TableStyle;
use oxidize_pdf::text::Font;
let style = TableStyle::professional().with_header_font(Font::TimesRoman);
assert_eq!(style.header_font, Some(Font::TimesRoman));Sourcepub fn with_header_bold(self, bold: bool) -> Self
pub fn with_header_bold(self, bold: bool) -> Self
Override the header bold flag. Chainable on presets.
use oxidize_pdf::page_tables::TableStyle;
let style = TableStyle::simple().with_header_bold(false);
assert_eq!(style.header_bold, Some(false));Trait Implementations§
Source§impl Clone for TableStyle
impl Clone for TableStyle
Source§fn clone(&self) -> TableStyle
fn clone(&self) -> TableStyle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TableStyle
impl RefUnwindSafe for TableStyle
impl Send for TableStyle
impl Sync for TableStyle
impl Unpin for TableStyle
impl UnsafeUnpin for TableStyle
impl UnwindSafe for TableStyle
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