修正 IronPDF 中的字體字距問題
2022年1月19日
已更新 2024年10月20日
This article was translated from English: Does it need improvement?
TranslatedView the article in English
此問題特別影響我們庫的WebKit版本(<=2021.3.1)。 系統字體如 Arial 和 Arial Bold 的字體字偶距問題是由 Windows 系統字體中的錯誤字偶距引起的。 為了解決這個問題,我們建議過渡到更新版本的IronPDF。 從版本(>=2021.9.3678)開始,我們引入了Chrome引擎渲染,提供了更好的相容性並解決了這些字體字距問題。
變通方法
請移除系統字體,並從線上資源下載新字體(例如 ArialMT)。 然後,使用@font-face
將此字體連結到 HTML:
@font-face {
font-family: 'ArialMT Regular';
font-style: normal;
font-weight: normal;
src: local('ArialMT Regular'), url('arialmt.woff') format('woff');
}
將 font-family: Arial;
替換為 font-family: ArialMT Regular;
,然後渲染 PDF。