Subset a name-keyed CFF font without making it CID-keyed

Aperta
#39 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend

Direzione di ricerca

Start by reading the crate's CFF subsetting implementation and its tests; the issue does not name specific files or entry points. Check how SID-keyed fonts are converted to CID-keyed fonts, then assess how a name-keyed subset could retain glyph SIDs, strings, and a custom encoding. Done means an option preserves name-keyed fonts and tests verify that kept glyph codes still resolve by name.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

subset converts SID-keyed CFF fonts to CID-keyed ones. That is right for new PDF output, but a PDF that already embeds a Type1C program for a simple font (/Subtype /Type1 with /FontFile3 /Subtype /Type1C) maps its one-byte codes to glyphs through glyph names (the font's /Encoding and /Differences, else the CFF's built-in encoding). A CID-keyed subset loses the names, so readers fall back to .notdef.

Would an option to keep a name-keyed font name-keyed (a charset with the kept glyphs' SIDs and the string INDEX, and a custom encoding for the kept codes) fit the crate's scope? It is the other half of subsetting fonts that existing PDFs embed; most CFF programs in PDFs are name-keyed Type1C. I can send a PR with tests if the shape is acceptable.

🤖 Generated with Claude Code

Lingua principale
Rust
Stelle
61
Fork
16
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di typst/subsetter

Tutte le issue di typst/subsetter

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.