
如何將 KOMA-Script 與軟體套件一起使用mathbbol
?
%\documentclass{article} % works
\documentclass{scrartcl} % fails
\usepackage{mathbbol}
\usepackage{pdfx} % just to calm PDF/A-validators a bit
\begin{document}
\thispagestyle{empty}
$\scriptstyle\mathbb{E}$
\end{document}
pdflatex
(Ubuntu 18.04 LTS 上的 TeX Live 2019)不會報告任何錯誤或警告。然而,veraPDF 和 Acrobat 的 Preflight 都抱怨同一個字型不一致。 veraPDF 狀態
<validationReport profileName="PDF/A-1B validation profile" statement="PDF file is not compliant with Validation Profile requirements." isCompliant="false">
<details passedRules="102" failedRules="1" passedChecks="398" failedChecks="1">
<rule specification="ISO 19005-1:2005" clause="6.3.6" testNumber="1" status="failed" passedChecks="0" failedChecks="1">
<description>For every font embedded in a conforming file and used for rendering, the glyph width information in the font dictionary and
in the embedded font program shall be consistent.</description>
<object>Glyph</object>
<test>renderingMode == 3 || isWidthConsistent == null || isWidthConsistent == true</test>
<check status="failed">
<context>root/document[0]/pages[0](5 0 obj PDPage)/contentStream[0](7 0 obj PDContentStream)/operators[11]/usedGlyphs[0](ZCDUID+BBOLD7 69 0 0)</context>
</check>
</rule>
</details>
</validationReport>
Acrobat 的預檢說
List of glyph width mismatches (PDF data versus embedded font data)
649.3 versus 676.593 (676.593/1000)
FontForge 確認 PDF 中 BBOLD7 的寬度(676,其中“Em Size”為 1000),並且 RUPS(或 $EDITOR)有效地顯示
<< /Type /Font /FirstChar 69 /LastChar 69 /Widths [649.3] … >>
造成這種不一致的原因是什麼?
該軟體包pdfx
似乎不影響此問題。如果article
使用該類,\scriptstyle
或\mathbb
刪除該類,或將包mathbbol
替換為amssymb
.
答案1
字體bbold7
等最初是在 MetaFont 中設計的,並使用 MetaFont 的工俱生成大量光學縮放字體。因此,對於每種字體大小,字體(包括字母的寬度)都略有不同。 (這就是為什麼會有bbold5/bbold7/bbold10
。)這些 MetaFont 字體最終在 PDF 中成為 Type 3 位元圖字體,因此今天我們更喜歡向量字體,在本例中為 Adobe 的 Type 1 格式。的向量版本bbold
僅存在三種尺寸:5
、7
和10
,但僅提供這三種尺寸會導致使用這些字體的所有 LaTeX 文件略有變化。
尤其是字體規格(主要是每個字元的寬度/深度/高度)不應改變,無論您使用 Type 1 還是 MetaFont 版本,因此 LaTeX 仍然會載入tfm
最初具有單獨字體的所有尺寸的檔案(TeX 從中讀取字體規格) ,5
、6
、7
、8
、9
、10
和12
。17
每個尺寸都對應到封閉的現有 Type 1 版本。然後重新調整這個最接近的版本以獲得正確的尺寸。這會失去所有光學尺寸中最初存在的細微變化,但由於 TeX 仍然使用原始 tfm 文件,TeX 仍然為每個字元保留相同的空間量,從而導致現有文件中的整體變更較少。現在,由於這些tfm
文件實際上描述了不存在向量字體的字體版本,因此度量(尤其是寬度)與字體文件中的實際寬度不匹配,從而導致這些錯誤。
你能為這個做什麼?如果你不介意稍微改變你的字體規格,你可以告訴 LaTeX 僅使用現有字體的規格:
% \documentclass[11pt]{article} % works
\documentclass[11pt]{scrartcl} % works
\DeclareFontFamily{U}{bbold}{}
\DeclareFontShape{U}{bbold}{m}{n}
{ <5> <6> bbold5
<7> <8> bbold7
<9> <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> bbold10
}{}
\usepackage{mathbbol}
\usepackage{pdfx} % just to calm PDF/A-validators a bit
\begin{document}
\thispagestyle{empty}
$\scriptstyle\mathbb{E}$
\end{document}
如果您喜歡現有的解決方案,並且希望保留原始字體的指標,即使相應的字體不再存在,您也可以創建虛擬字體bbold6/8/9/12/17
,明確加載來自bbold5/7/10
.使用虛擬字體而不是僅使用錯誤的字體規格可確保 pdfTeX 理解您在做什麼並在 PDF 文件中正確報告這一點。
但我建議先嘗試上述解決方案,因為為此創建虛擬字體要複雜得多。