字體字距調整
這個問題特別影響 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;
在你的 HTML 中,然後渲染 PDF。