Implemented Type3Font struct and loader with: - /CharProcs: HashMap of glyph name -> stream reference (strips "/" prefix) - /FirstChar, /LastChar: character code range - /Widths: per-code advance widths in glyph space - /FontMatrix: 3x3 transform from glyph to text space (default [0.001 0 0 0.001 0 0]) - /Resources: optional resource dict for nested content streams - /Encoding: code -> glyph name mapping (FontEncoding) Key features: - advance_for() applies FontMatrix[0] to scale glyph space to text space - Missing /Widths defaults to all-zero with FONT_PARSE_FAILED diagnostic - Widths length mismatch emits FONT_TYPE3_WIDTHS_LENGTH_MISMATCH - Missing /CharProcs returns empty map (malformed but valid) - Arbitrary glyph names supported (not limited to AGL) Added FontType3WidthsLengthMismatch to diagnostics.rs severity() method. Acceptance criteria: - PASS: Valid Type3 font loads with all fields populated - PASS: /FontMatrix [0.001 0 0 0.001 0 0]: width 500 -> 0.5 text-units - PASS: /FontMatrix [1 0 0 1 0 0]: width 500 -> 500 text-units - PASS: Missing /Widths defaults to all-zero with diagnostic - PASS: Code outside [FirstChar, LastChar] returns advance 0, no panic All 13 Type3 tests pass. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| pdftract-cer-diff | ||
| pdftract-cli | ||
| pdftract-core | ||
| pdftract-libpdftract | ||
| pdftract-py | ||