Use Times metrics for bold and italic text

Add ptmb8t/ptmri8t/ptmbi8t metrics and TimesBold/TimesItalic/TimesBoldItalic
paragraph faces. A ptm document now maps Roman, bold, italic and bold-italic
base faces to the Times family, so headings and emphasised runs use Times
widths while the PDF backend continues to embed Liberation Serif.

The arXiv output is unchanged at 3 pages; previews measured 12.5-17.5 ms warm
and 191 ms cold. Test count is 1076.
This commit is contained in:
gloamxun committed 2026-10-28 00:08:19 +08:00
1 parent e9bbd4bd87
commit fd9ee0740b
12 files changed
+100 -18

No files matched your search

+11 -4
View File
@@ -9817,6 +9817,9 @@ fn nfss_font_with_size(
ParagraphFont::BoldSlanted => (Family::Roman, true, false),
ParagraphFont::MonoItalic => (Family::Mono, false, true),
ParagraphFont::TimesRoman => (Family::Roman, false, false),
ParagraphFont::TimesBold => (Family::Roman, true, false),
ParagraphFont::TimesItalic => (Family::Roman, false, true),
ParagraphFont::TimesBoldItalic => (Family::Roman, true, true),
};
let mut small_caps = base == ParagraphFont::SmallCaps;
let mut slanted = matches!(base, ParagraphFont::Slanted | ParagraphFont::BoldSlanted);
@@ -14118,10 +14121,14 @@ fn build_document_with_labels(
xspace_skip: geometry.xspace_skip,
};
let plain = strip_hrefs(&text).replace('~', " ");
let face = if geometry.roman_family.as_deref() == Some("ptm")
&& paragraph.font == ParagraphFont::Roman
{
ParagraphFont::TimesRoman
let face = if geometry.roman_family.as_deref() == Some("ptm") {
match paragraph.font {
ParagraphFont::Roman => ParagraphFont::TimesRoman,
ParagraphFont::Bold => ParagraphFont::TimesBold,
ParagraphFont::Italic => ParagraphFont::TimesItalic,
ParagraphFont::BoldItalic => ParagraphFont::TimesBoldItalic,
other => other,
}
} else {
paragraph.font
};