mpdf
mpdf copied to clipboard
Add option to disable autoScriptToLang on certain elements if wanted
Having autoScriptToLang globally is quite a fine function, but for some elements in the document, it might be a need to have only one language set for it so proper font is used and no language determination is done.
Example:
<body>
<table>
<tr>
<td lang="ja">ンターJA健康ー康</td>
</tr>
</table>
<div>Hello 健康</div>
</body>
Currently, it's split into something like:
<body>
<table>
<tr>
<td lang="ja"><span lang="ja">ンタ</span>ーJA<span lang="und-Hans">健康ー康</span></td>
</tr>
</table>
<div>Hello <span lang="und-Hans">健康</span></div>
</body>
Where a more desired output would be:
<body>
<table>
<tr>
<td lang="ja">ンターJA健康ー康</td>
</tr>
</table>
<div>Hello <span lang="und-Hans">健康</span></div> <!-- process only this -->
</body>
I was thinking about some attribute on element level, e.g. disableAutoScriptToLang which will be taken into the account only if autoScriptToLang is set to true in mpdf configuration. It might work also on hierarchy level, so it means that this attribute will apply to all children elements too. In HTML template it might look like:
<body>
<table>
<tr>
<td lang="ja" disableAutoScriptToLang>ンターJA健康ー康</td>
</tr>
</table>
<div>Hello 健康</div>
</body>