bugzilla.mozilla.org will be intermittently unavailable on Saturday, March 24th, from 16:00 until 20:00 UTC.

Fullwidth latin characters (U+FF00-U+FF5X) are not rendered correctly




Graphics: Text
2 years ago
8 months ago


(Reporter: boekewurm, Unassigned)



46 Branch

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [gfx-noted], URL)



2 years ago
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
Build ID: 20160502172042

Steps to reproduce:

I was playing around with some unicode stuff, and tried to implement a monospace website without specifying the font. For that I looked up some things, and then I noticed that at the wikipedia page the fullwidth latin characters are not rendered all at the same width. 

URL: https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms

I do have the droid-sans-fallback font installed. 

Actual results:

Rendering the fullwidth latin characters does not respect the fullwidth property of the letters, it adjusts the letter's width to the 'render' width, or the maximum width the glyph has. 

Expected results:

The characters should be rendered all the same width, respecting the unicode.

It could be that the font used is wrong. In that case the default font for sans-serif should be changed, as Wikipedia's styling was 'font: sans-serif' (inherited from body).

This issue has been here since at least 43.0


2 years ago
Component: Untriaged → Graphics: Text
Product: Firefox → Core
Flags: needinfo?(jfkthame)
Keywords: correctness
Whiteboard: [gfx-noted]
AFAICS, this is simply a "feature" of the MS PGothic font, which is the default sans-serif for Japanese on Windows. If you change the default Japanese sans-serif font from MS PGothic to MS Gothic (in Options / Content / Fonts & Colors / Advanced), you'll get its fixed-width versions of the glyphs instead.

So this doesn't look like a Firefox bug as such, but simply a quirk of the Windows fonts. It's possible that updating the default font preferences to use some of the newer Asian fonts in more recent Windows versions will make a difference.

Masayuki, do you think we should do anything here?
Flags: needinfo?(jfkthame) → needinfo?(masayuki)

Comment 2

2 years ago
Apparently MS PGothic is specifically derived from MS Gothic to have this 'feature' [1]. Changing the font used for Japanese characters to MS Gothic fixes the problem indeed.

As MS PGothic does not comply with the Unicode standard by design, is it still OK to use this font as the default font for Japanese characters? I think it is strange to use broken-by-design fonts as default.

[1] 'MS PGothic is a Japanese font with proportional latin in the gothic (sans serif) style' (https://www.microsoft.com/typography/fonts/family.aspx?FID=335)
Indeed, modern fonts has same width for all Fullwidth Latin characters. However, as far as I've tested, legacy (traditional) fonts have various widths per character.

I think that we should not do any quirks at rendering them because we should think that the reason why such legacy fonts are still proportional even for Fullwidth Latin characters must be for keeping compatibility with older documents.

On the other hand, changing default font is still risky, I think. Google Chrome still uses MS PGothic and it also renders the characters same as us. (Although, IE and Edge are using modern fonts if web pages specify font-family with generic family name.) See bug 1016792.
Flags: needinfo?(masayuki)
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.