阿拉伯字符(Lam-Alif - ցَ)呈现不同阿拉伯字体渲染T...</desc> <question vote="0"> <p>在以下代码片段中,字母已正确呈现。</p> <p></p><div data-babel-preset-ts="false" data-lang="js" data-hide="false" data-console="true" data-babel="false" data-babel-preset-react="false"> <div> <pre><code><!DOCTYPE html> <html lang="ar"> <head> <meta charset="UTF-8"> <title>Arabic Font Rendering Test</title> <style> body { direction: rtl; /* Right-to-left direction */ text-align: right; /* Align text to the right */ margin: 20px; font-size: 24px; /* Font size for easier reading */ } .font-sample { margin-bottom: 20px; } </style> </head> <body> <div class="font-sample" style="font-family: 'KacstBook', sans-serif;"> KacstBook: لاَ إِلَهَ إِلاَّ أَنْتَ </div> </body> </html></code></pre> </div> </div> <p></p> <p>但我正在使用 asciidoctor-web-pdf 从 .adoc 文件生成 pdf。这里这个句子的翻译方式有所不同:</p> <p><a href="https://i.sstatic.net/65PrGdnB.png" rel="nofollow noreferrer"><img src="https://cdn.txt58.com/i/AWkuc3N0YXRpYy5uZXQvNjVQckdkbkIucG5n" alt="La-Ilaha-Illa-Anta"/></a></p> <p>我在 asciidoctor-web-pdf 中使用的 CSS 是:</p> <pre><code>@font-face { font-family: 'KacstBook'; src: local('KacstBook'); size-adjust: 200%; font-weight: normal; font-style: normal; unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EFD-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1; } body { font-family: "KacstBook", "Noto Serif Bengali", "Noto Serif", serif !important; } </code></pre> <p>我从另一个网站检查过,文本应该如下所示。</p> <p><a href="https://i.sstatic.net/GPZ2j9UQ.png" rel="nofollow noreferrer"><img src="https://cdn.txt58.com/i/AWkuc3N0YXRpYy5uZXQvR1BaMmo5VVEucG5n" alt="How Lam-Alif Should Look Like"/></a></p> <p>这里可能存在什么问题。为什么 (Lam-Alif - ???) 渲染不正确。</p> </question> <answer tick="false" vote="0"> <p>在 <pre><code>font-feature-settings: "liga" 1;</code></pre> 中使用 <pre><code>body</code></pre> 解决了我的问题。</p> </answer> </body></html>

问题描述 投票:0回答:0
css fonts arabic asciidoctor asciidoctor-pdf
© www.soinside.com 2019 - 2024. All rights reserved.