Monospace/Fixed-width font render bug for other languages in 'Region and Language/Formats' setting Topic is solved

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
User avatar
Nostaljaded
Newbie
Newbie
Posts: 5
Joined: 2021-09-21, 04:26

Monospace/Fixed-width font render bug for other languages in 'Region and Language/Formats' setting

Unread post by Nostaljaded » 2021-09-21, 04:52

As per subject title, tab indent (&Tab;) also works differently with other languages 'Format' settings [may be also due to Pale Moon ignoring <tt> & <pre> HTML tags(?)].

HTML code sample

Code: Select all

<html>
<head>
<title>Monospace/Fixed-width font text render bug for other language format settings</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>

<body>
<tt><pre>
 _   _
|1| |2|
|‾| |‾|
| |_|_|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  |
|3  |         |4  |       |5|6| |7| | |
 ‾ ‾           ‾ ‾         ‾ ‾   ‾|̲̅8|_|
                                    |9|
                                     ‾</pre></tt>
<br>
<tt><pre>
1: 1234 &Tab;&Tab; 5: 1234
2: 12345 &Tab;&Tab; 6: 1234
3: 123456 &Tab;&Tab; 7: 1234
4: 1234567 &Tab;&Tab; 8: 1234</pre></tt>
</body>
</html>

'Region and Language/Formats' setting in Win 7

Image


Chromium on all tested language 'Format' settings; same output display
Image

Pale Moon English/German, last line 1 LESS indent as compared to Chromium
Image

Pale Moon Arabic
Image

Pale Moon Chinese/Japanese, second last line 1 MORE indent
Image

Pale Moon Hebrew, last line 1 LESS indent
Image

Pale Moon Hindi
Image

Pale Moon Korean, second last line 1 MORE indent
Image


Firefox does not even display the complex ASCII symbol correctly in English
Image


Test System:
Win 7, all tested browsers using latest portable versions with default settings

Desired Behavior:
Monospace font rendering should produce same output display regardless/independent of 'Region and Language/Formats' setting, as per Chromium.

Is there a Pale Moon about:config setting or a fix for the above issue?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35481
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Monospace/Fixed-width font render bug for other languages in 'Region and Language/Formats' setting

Unread post by Moonchild » 2021-09-21, 10:01

Sorry but Pale Moon does this correctly, and Chromium does this wrong, as far as I can tell.

Explanation:
Your 4: line has the content:

Code: Select all

4: 1234567 &Tab;&Tab; 8: 1234
In western scripts (narrow characters) this counts to 12 characters for "4: 1234567 " (mind the trailing space after 7) which is a full 3 tabs width and therefore will jump that line's second portion to the next tab indent.

In Asian double-width characters, the same applies, only in that case you are dealing with a double count of characters for tabs, resulting in the last 2 lines jumping an indent because of the double-width counting (you're mixing single width and double width in your lines which makes counting a little tricky, but you'll see what I mean).

IOW: Chromium seems to ignore a space before a tab, which is wrong in preformatted text.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Nostaljaded
Newbie
Newbie
Posts: 5
Joined: 2021-09-21, 04:26

Re: Monospace/Fixed-width font render bug for other languages in 'Region and Language/Formats' setting

Unread post by Nostaljaded » 2021-09-21, 14:04

I may have put too much info in a single post to cause readers to miss the point.
Apologies, here's another attempt:

RE: <pre> HTML tag
The pre element represents a block of preformatted text, in which structure is represented by typographic conventions rather than by elements.

Some examples of cases where the pre element could be used... Displaying ASCII art.

Source HTML Standard: https://html.spec.whatwg.org/#the-pre-element
Focusing on the ASCII art in the screenshots above, Pale Moon is not recognizing/ignoring the <pre> HTML tag to use a monospace font.
The ASCII art render in Hindi language being the most obvious one, whereas Chromium in all tested languages renders the ASCII art correctly and with identical output.

In other words, Pale Moon uses each languages' default font to render preformatted text. This does not conform to HTML standard.

Is there a Pale Moon about:config setting to tweak or a fix for it?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35481
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Monospace/Fixed-width font render bug for other languages in 'Region and Language/Formats' setting

Unread post by Moonchild » 2021-09-21, 15:27

You will need a monospace system-installed font that supports your localized character set for whatever foreign characters will be used.
Then you can set this in the Pale Moon preferences -> content -> Fonts & colors -> button "advanced"
Select the desired locale setting at the top then select what font you want to use for "monospace".
Due to the wide range of system setups we default to a font that can at least display the expected characters over them being monospace accurate if we don't have knowledge of a guaranteed-installed monospace font.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Nostaljaded
Newbie
Newbie
Posts: 5
Joined: 2021-09-21, 04:26

Re: Monospace/Fixed-width font render bug for other languages in 'Region and Language/Formats' setting

Unread post by Nostaljaded » 2021-09-22, 00:25

Got it, I've standardized the monospace font to 'Consolas' for all the locales I'm using.

Thanks. :)

Locked