pub struct FontRegistry {
pub regular: RegisteredFont,
pub bold: RegisteredFont,
}Fields§
§regular: RegisteredFont§bold: RegisteredFontImplementations§
Source§impl FontRegistry
impl FontRegistry
pub fn with_defaults() -> Result<Self, FontError>
Sourcepub fn with_fonts(
regular_bytes: &[u8],
bold_bytes: &[u8],
) -> Result<Self, FontError>
pub fn with_fonts( regular_bytes: &[u8], bold_bytes: &[u8], ) -> Result<Self, FontError>
Builds a registry from caller-supplied static TrueType glyf fonts
(ADR-012, same constraint as the bundled defaults) instead of Source
Sans 3 — always available, independent of the default-fonts
feature. Still exactly the two-weight SANS_REGULAR/SANS_BOLD
model; an arbitrary-weight/arbitrary-FontKey registry is tracked
separately (github.com/casoon/lightweight-pdf/issues/1).
Sourcepub fn font_entries(&self) -> [(FontKey, &RegisteredFont); 2]
pub fn font_entries(&self) -> [(FontKey, &RegisteredFont); 2]
Order matches how the facade registers PDF fonts — used to build
resource names (F1, F2, …) consistently between PDF font
registration and content-stream references.
pub fn entry(&self, key: FontKey) -> &RegisteredFont
Trait Implementations§
Source§impl FontResolver for FontRegistry
impl FontResolver for FontRegistry
fn metrics(&self, key: FontKey) -> &dyn FontMetrics
Auto Trait Implementations§
impl !Freeze for FontRegistry
impl !RefUnwindSafe for FontRegistry
impl !Sync for FontRegistry
impl Send for FontRegistry
impl Unpin for FontRegistry
impl UnsafeUnpin for FontRegistry
impl UnwindSafe for FontRegistry
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