pub mod agl;
pub mod cff_parser;
pub mod charstring;
pub mod encoding;
pub mod geometry;
pub mod system_fonts;
pub mod truetype;
pub mod type1_parser;
pub mod type2_charstring;
pub use geometry::{Matrix, PathSegment, PsPath};
pub const FONT_SUBSTITUTIONS: &[(&str, &str)] = &[
("Times-Roman", "NimbusRoman-Regular"),
("Times-Bold", "NimbusRoman-Bold"),
("Times-Italic", "NimbusRoman-Italic"),
("Times-BoldItalic", "NimbusRoman-BoldItalic"),
("Helvetica", "NimbusSans-Regular"),
("Helvetica-Bold", "NimbusSans-Bold"),
("Helvetica-Oblique", "NimbusSans-Italic"),
("Helvetica-BoldOblique", "NimbusSans-BoldItalic"),
("Helvetica-Narrow", "NimbusSansNarrow-Regular"),
("Helvetica-Narrow-Bold", "NimbusSansNarrow-Bold"),
("Helvetica-Narrow-Oblique", "NimbusSansNarrow-Oblique"),
(
"Helvetica-Narrow-BoldOblique",
"NimbusSansNarrow-BoldOblique",
),
("Courier", "NimbusMonoPS-Regular"),
("Courier-Bold", "NimbusMonoPS-Bold"),
("Courier-Oblique", "NimbusMonoPS-Italic"),
("Courier-BoldOblique", "NimbusMonoPS-BoldItalic"),
("ArialMT", "NimbusSans-Regular"),
("Arial-BoldMT", "NimbusSans-Bold"),
("Arial-ItalicMT", "NimbusSans-Italic"),
("Arial-BoldItalicMT", "NimbusSans-BoldItalic"),
("Arial", "NimbusSans-Regular"),
("Arial-Bold", "NimbusSans-Bold"),
("Arial-Italic", "NimbusSans-Italic"),
("Arial-BoldItalic", "NimbusSans-BoldItalic"),
("Symbol", "StandardSymbolsPS"),
("ZapfDingbats", "D050000L"),
("Palatino-Roman", "P052-Roman"),
("Palatino-Bold", "P052-Bold"),
("Palatino-Italic", "P052-Italic"),
("Palatino-BoldItalic", "P052-BoldItalic"),
("NewCenturySchlbk-Roman", "C059-Roman"),
("NewCenturySchlbk-Bold", "C059-Bold"),
("NewCenturySchlbk-Italic", "C059-Italic"),
("NewCenturySchlbk-BoldItalic", "C059-BdIta"),
("Bookman-Light", "URWBookman-Light"),
("Bookman-LightItalic", "URWBookman-LightItalic"),
("Bookman-Demi", "URWBookman-Demi"),
("Bookman-DemiItalic", "URWBookman-DemiItalic"),
("AvantGarde-Book", "URWGothic-Book"),
("AvantGarde-BookOblique", "URWGothic-BookOblique"),
("AvantGarde-Demi", "URWGothic-Demi"),
("AvantGarde-DemiOblique", "URWGothic-DemiOblique"),
("TimesNewRoman", "NimbusRoman-Regular"),
("TimesNewRomanPS", "NimbusRoman-Regular"),
("TimesNewRomanPSMT", "NimbusRoman-Regular"),
("TimesNewRoman-Bold", "NimbusRoman-Bold"),
("TimesNewRoman,Bold", "NimbusRoman-Bold"),
("TimesNewRomanPS-Bold", "NimbusRoman-Bold"),
("TimesNewRomanPS-BoldMT", "NimbusRoman-Bold"),
("TimesNewRoman-Italic", "NimbusRoman-Italic"),
("TimesNewRoman,Italic", "NimbusRoman-Italic"),
("TimesNewRomanPS-Italic", "NimbusRoman-Italic"),
("TimesNewRomanPS-ItalicMT", "NimbusRoman-Italic"),
("TimesNewRoman-BoldItalic", "NimbusRoman-BoldItalic"),
("TimesNewRomanPS-BoldItalic", "NimbusRoman-BoldItalic"),
("TimesNewRomanPS-BoldItalicMT", "NimbusRoman-BoldItalic"),
("ZapfChancery-MediumItalic", "Z003-MediumItalic"),
];
pub fn find_substitution(name: &str) -> Option<&'static str> {
for &(ps_name, urw_name) in FONT_SUBSTITUTIONS {
if ps_name == name {
return Some(urw_name);
}
}
None
}