Closed Bug 1640414 Opened 4 years ago Closed 4 years ago

No-break spaces have different width than plain spaces

Categories

(Core :: Layout: Text and Fonts, defect)

76 Branch
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: wavexx, Unassigned)

Details

Attachments

(3 files)

Attached image ff76-rendering.png

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0

Steps to reproduce:

  and U+00A0 should have the same width as a regular space.

Actual results:

  and U+00A0 are larger than a regular space in FF76.0.1 under Linux (debian unstable), using any font.

Attached image chromium-rendering.png
Attached file test.html

Note that this is a regression. FF used to render this correctly in earlier versions.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Layout: Text and Fonts
Product: Firefox → Core

This is working as expected for me on Nightly.

EDIT: also on 76.0.1, both macOS

Do you see the same problem on a new profile?
https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles#w_manage-profiles-when-firefox-is-open

Flags: needinfo?(wavexx)

Yes, I reproduced this on a fresh profile and on an fresh user account as well to avoid issues with fontconfig.

I cannot test Nighly right now due to my connection, and I'm unsure of when this issue appeared, could have been earlier than 76.0.1 (the change is subtle; I just noticed by chance).

I point out I'm running FF on linux with integrated intel graphics. This combination has known issues with font rendering not grid-fitting properly depending on the HW acceleration settings (notably, it's half-broken on UI elements with acceleration off since FF quantum!). Toggling layers.acceleration.force-enabled=true didn't do anything in this case though. Font rendering seems ok on page elements, it's just the nbsp which seems to have an arbitrary size.

Flags: needinfo?(wavexx)

Please use the Inspector to examine the text in your testcase and see what font or fonts it reports as being used (not what the value of the font-family property is, but what actual font face(s) are reported in the Fonts panel of the inspector). I'm curious if NBSP is being taken from a different font from the rest of the text for some reason.

It shows just Bitstream Vera Serif in this case.

Bitstream Vera Serif has a very wide NBSP glyph, for some reason:

  <hmtx>
    ...
    <mtx name="nonbreakingspace" width="1303" lsb="0"/>
    ...
    <mtx name="space" width="651" lsb="0"/>
    ...
  </hmtx>

I see the same result on macOS in both Firefox and Chrome if I use the Bitstream Vera Serif font. The screenshot in comment 1 shows Chrome using a sans-serif default font; if you explicitly set it to use Vera Serif, I expect it'll show the same result as Firefox.

Wow, ok. Didn't realize nbsp had an actual glyph. Indeed, checking with 'DejaVu Sans' for example renders properly. Sorry for the noise.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
Resolution: WORKSFORME → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: