Skip to content

Commit 8060957

Browse files
nicoawesomekling
authored andcommitted
LibPDF: Use Appendix A instead of Appendix C for standard names
From "10 String INDEX": "Further space saving is obtained by allocating commonly occurring strings to predefined SIDs. These strings, known as the standard strings, describe all the names used in the ISOAdobe and Expert character sets along with a few other strings common to Type 1 fonts. A complete list of standard strings is given in Appendix A. The client program will contain an array of standard strings with nStoStrings elements. Thus, the standard strings take SIDs in the range 0 to (nStaStrings-1)." And "13 Charsets" says that charsets store SIDs. Fixes all "Couldn't find string for SID $n, going with space" messages when going through the encoding pages (page 1010 and thereabouts) in the PDF 1.7 spec.
1 parent aba787a commit 8060957

File tree

1 file changed

+163
-1
lines changed
  • Userland/Libraries/LibPDF/Fonts

1 file changed

+163
-1
lines changed

Userland/Libraries/LibPDF/Fonts/CFF.cpp

Lines changed: 163 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ PDFErrorOr<NonnullRefPtr<CFF>> CFF::create(ReadonlyBytes const& cff_bytes, RefPt
153153
return cff;
154154
}
155155

156-
/// Appendix C: Predefined Charsets
156+
/// Appendix A: Standard Strings
157157
static constexpr Array s_cff_builtin_names {
158158
".notdef"sv,
159159
"space"sv,
@@ -384,6 +384,168 @@ static constexpr Array s_cff_builtin_names {
384384
"yacute"sv,
385385
"ydieresis"sv,
386386
"zcaron"sv,
387+
"exclamsmall"sv,
388+
"Hungarumlautsmall"sv,
389+
"dollaroldstyle"sv,
390+
"dollarsuperior"sv,
391+
"ampersandsmall"sv,
392+
"Acutesmall"sv,
393+
"parenleftsuperior"sv,
394+
"parenrightsuperior"sv,
395+
"twodotenleader"sv,
396+
"onedotenleader"sv,
397+
"zerooldstyle"sv,
398+
"oneoldstyle"sv,
399+
"twooldstyle"sv,
400+
"threeoldstyle"sv,
401+
"fouroldstyle"sv,
402+
"fiveoldstyle"sv,
403+
"sixoldstyle"sv,
404+
"sevenoldstyle"sv,
405+
"eightoldstyle"sv,
406+
"nineoldstyle"sv,
407+
"commasuperior"sv,
408+
"threequartersemdash"sv,
409+
"periodsuperior"sv,
410+
"questionsmall"sv,
411+
"asuperior"sv,
412+
"bsuperior"sv,
413+
"centsuperior"sv,
414+
"dsuperior"sv,
415+
"esuperior"sv,
416+
"isuperior"sv,
417+
"lsuperior"sv,
418+
"msuperior"sv,
419+
"nsuperior"sv,
420+
"osuperior"sv,
421+
"rsuperior"sv,
422+
"ssuperior"sv,
423+
"tsuperior"sv,
424+
"ff"sv,
425+
"ffi"sv,
426+
"ffl"sv,
427+
"parenleftinferior"sv,
428+
"parenrightinferior"sv,
429+
"Circumflexsmall"sv,
430+
"hyphensuperior"sv,
431+
"Gravesmall"sv,
432+
"Asmall"sv,
433+
"Bsmall"sv,
434+
"Csmall"sv,
435+
"Dsmall"sv,
436+
"Esmall"sv,
437+
"Fsmall"sv,
438+
"Gsmall"sv,
439+
"Hsmall"sv,
440+
"Ismall"sv,
441+
"Jsmall"sv,
442+
"Ksmall"sv,
443+
"Lsmall"sv,
444+
"Msmall"sv,
445+
"Nsmall"sv,
446+
"Osmall"sv,
447+
"Psmall"sv,
448+
"Qsmall"sv,
449+
"Rsmall"sv,
450+
"Ssmall"sv,
451+
"Tsmall"sv,
452+
"Usmall"sv,
453+
"Vsmall"sv,
454+
"Wsmall"sv,
455+
"Xsmall"sv,
456+
"Ysmall"sv,
457+
"Zsmall"sv,
458+
"colonmonetary"sv,
459+
"onefitted"sv,
460+
"rupiah"sv,
461+
"Tildesmall"sv,
462+
"exclamdownsmall"sv,
463+
"centoldstyle"sv,
464+
"Lslashsmall"sv,
465+
"Scaronsmall"sv,
466+
"Zcaronsmall"sv,
467+
"Dieresissmall"sv,
468+
"Brevesmall"sv,
469+
"Caronsmall"sv,
470+
"Dotaccentsmall"sv,
471+
"Macronsmall"sv,
472+
"figuredash"sv,
473+
"hypheninferior"sv,
474+
"Ogoneksmall"sv,
475+
"Ringsmall"sv,
476+
"Cedillasmall"sv,
477+
"questiondownsmall"sv,
478+
"oneeighth"sv,
479+
"threeeighths"sv,
480+
"fiveeighths"sv,
481+
"seveneighths"sv,
482+
"onethird"sv,
483+
"twothirds"sv,
484+
"zerosuperior"sv,
485+
"foursuperior"sv,
486+
"fivesuperior"sv,
487+
"sixsuperior"sv,
488+
"sevensuperior"sv,
489+
"eightsuperior"sv,
490+
"ninesuperior"sv,
491+
"zeroinferior"sv,
492+
"oneinferior"sv,
493+
"twoinferior"sv,
494+
"threeinferior"sv,
495+
"fourinferior"sv,
496+
"fiveinferior"sv,
497+
"sixinferior"sv,
498+
"seveninferior"sv,
499+
"eightinferior"sv,
500+
"nineinferior"sv,
501+
"centinferior"sv,
502+
"dollarinferior"sv,
503+
"periodinferior"sv,
504+
"commainferior"sv,
505+
"Agravesmall"sv,
506+
"Aacutesmall"sv,
507+
"Acircumflexsmall"sv,
508+
"Atildesmall"sv,
509+
"Adieresissmall"sv,
510+
"Aringsmall"sv,
511+
"AEsmall"sv,
512+
"Ccedillasmall"sv,
513+
"Egravesmall"sv,
514+
"Eacutesmall"sv,
515+
"Ecircumflexsmall"sv,
516+
"Edieresissmall"sv,
517+
"Igravesmall"sv,
518+
"Iacutesmall"sv,
519+
"Icircumflexsmall"sv,
520+
"Idieresissmall"sv,
521+
"Ethsmall"sv,
522+
"Ntildesmall"sv,
523+
"Ogravesmall"sv,
524+
"Oacutesmall"sv,
525+
"Ocircumflexsmall"sv,
526+
"Otildesmall"sv,
527+
"Odieresissmall"sv,
528+
"OEsmall"sv,
529+
"Oslashsmall"sv,
530+
"Ugravesmall"sv,
531+
"Uacutesmall"sv,
532+
"Ucircumflexsmall"sv,
533+
"Udieresissmall"sv,
534+
"Yacutesmall"sv,
535+
"Thornsmall"sv,
536+
"Ydieresissmall"sv,
537+
"001.000"sv,
538+
"001.001"sv,
539+
"001.002"sv,
540+
"001.003"sv,
541+
"Black"sv,
542+
"Bold"sv,
543+
"Book"sv,
544+
"Light"sv,
545+
"Medium"sv,
546+
"Regular"sv,
547+
"Roman"sv,
548+
"Semibold"sv,
387549
};
388550

389551
PDFErrorOr<Vector<StringView>> CFF::parse_strings(Reader& reader)

0 commit comments

Comments
 (0)