pub trait PdfFontResolver {
// Required methods
fn resolve(&self, id: &str) -> Result<ResolvedPdfFont, PdfEditError>;
fn glyphs_for_text(
&self,
font: &ResolvedPdfFont,
text: &str,
) -> Result<Vec<GlyphId>, PdfEditError>;
}Expand description
Resolves catalog font IDs to usable font data and maps text to glyphs (§7.2). Implemented by
pdf_font.rs (lane B2); consumed by the frozen compose_candidate signature
(PDF-EDITOR-DISPATCH.md) as fonts: &dyn PdfFontResolver, so pdf_compose.rs (lane C1) can
build and test against this trait before B2’s real implementation lands.
Required Methods§
fn resolve(&self, id: &str) -> Result<ResolvedPdfFont, PdfEditError>
fn glyphs_for_text( &self, font: &ResolvedPdfFont, text: &str, ) -> Result<Vec<GlyphId>, PdfEditError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".