pub struct FakePageConfig {Show 14 fields
pub show_header: bool,
pub show_footer: bool,
pub header_text: Option<String>,
pub footer_text: Option<String>,
pub header_page_number: bool,
pub footer_page_number: bool,
pub header_total_pages: bool,
pub footer_total_pages: bool,
pub number_format: CounterFormat,
pub skip_first_page: bool,
pub header_height: f32,
pub footer_height: f32,
pub font_size: f32,
pub text_color: ColorU,
}Expand description
Temporary configuration for page headers/footers without CSS @page parsing.
Provides programmatic control over page decoration until full CSS @page
rule support is implemented.
§Supported Features
- Page numbers in header and/or footer
- Custom text in header and/or footer
- Number format (decimal, roman numerals, alphabetic, greek)
- Skip first page option
§Example
use azul_layout::solver3::pagination::FakePageConfig;
let config = FakePageConfig::new()
.with_footer_page_numbers()
.with_header_text("My Document")
.skip_first_page(true);
let header_footer = config.to_header_footer_config();Fields§
§show_header: boolShow header on pages
Show footer on pages
header_text: Option<String>Header text (static text, or None for page numbers only)
Footer text (static text, or None for page numbers only)
header_page_number: boolInclude page number in header
Include page number in footer
header_total_pages: boolInclude total pages count (“of Y”) in header
Include total pages count (“of Y”) in footer
number_format: CounterFormatNumber format for page counters
skip_first_page: boolSkip header/footer on first page
header_height: f32Header height in points
Footer height in points
font_size: f32Font size for header/footer text
text_color: ColorUText color for header/footer
Implementations§
Source§impl FakePageConfig
impl FakePageConfig
Enable footer with “Page X of Y” format.
Sourcepub fn with_header_page_numbers(self) -> Self
pub fn with_header_page_numbers(self) -> Self
Enable header with “Page X” format.
Enable both header and footer with page numbers.
Sourcepub fn with_header_text(self, text: impl Into<String>) -> Self
pub fn with_header_text(self, text: impl Into<String>) -> Self
Set custom header text.
Set custom footer text.
Sourcepub fn with_number_format(self, format: CounterFormat) -> Self
pub fn with_number_format(self, format: CounterFormat) -> Self
Set the number format for page counters.
Sourcepub fn skip_first_page(self, skip: bool) -> Self
pub fn skip_first_page(self, skip: bool) -> Self
Skip header/footer on the first page.
Sourcepub fn with_header_height(self, height: f32) -> Self
pub fn with_header_height(self, height: f32) -> Self
Set header height.
Set footer height.
Sourcepub fn with_font_size(self, size: f32) -> Self
pub fn with_font_size(self, size: f32) -> Self
Set font size for header/footer text.
Sourcepub fn with_text_color(self, color: ColorU) -> Self
pub fn with_text_color(self, color: ColorU) -> Self
Set text color for header/footer.
Convert this fake config to the internal HeaderFooterConfig.
This is the bridge between the user-facing API and the internal pagination engine.
Trait Implementations§
Source§impl Clone for FakePageConfig
impl Clone for FakePageConfig
Source§fn clone(&self) -> FakePageConfig
fn clone(&self) -> FakePageConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FakePageConfig
impl Debug for FakePageConfig
Auto Trait Implementations§
impl Freeze for FakePageConfig
impl RefUnwindSafe for FakePageConfig
impl Send for FakePageConfig
impl Sync for FakePageConfig
impl Unpin for FakePageConfig
impl UnsafeUnpin for FakePageConfig
impl UnwindSafe for FakePageConfig
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<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>
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>
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