Forum Bugs

Character/Word spacing issue

vivek.yaji
Hello Mike,

Please find details/reproducible steps below.

Sample html content –
<html>
<body>
<div style="width: 282pt">
<p><span style="font-family: arial; font-size: 10pt;">This is a little Japanese text but Arial font is applied here. Hoping that you will be able to help me out.</span></p>
<p><span style="font-family: MS Mincho; font-size: 10pt;">これは少し日本語のテキストです。どのようにしないと表示いと表示</span></p>
</div>
</body>
</html>

- The content within the first <p> tag flows as follows(within the div width) in browser and Prince generated PDF as below:
o Browser - the first line ends with “Hoping” and remaining content appears in second line
o PDF – the word “Hoping” starts in the second line as opposed to what we see in browser
- The same occurs in the second <p> tag as well. The only difference being the text is Japanese.

Can you please look into the issue and let me know the next steps.

Cheers!!!
Vivek
mikeday
The width of text is highly dependent upon the exact fonts and layout algorithms used, and in general is not reproducible across different programs. For example, in the Firefox browser the word "Hoping" is on the second line, the same as in Prince, at least for me.

Even the same browser can produce different results when run on different operating systems. You can also get different results depending on the font settings, eg. if ClearType is enabled.

I'm afraid that you cannot rely on exact line-breaking when using different programs unless you explicitly break lines using <br/> elements where you want the line breaks to end up.