incorrect character spacing
Categories
(Core :: Graphics: Text, defect)
Tracking
()
People
(Reporter: g1201, Unassigned)
Details
Attachments
(1 file)
947 bytes,
image/png
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Steps to reproduce:
load page https://code.jsoftware.com/wiki/System/ReleaseNotes/J903
see sentence "the cases where f or h are [ ] @[ @] are handled"
Note: they are correctly rendered above as I write my report in Firefox 89.
Expected results:
The space between characters @[ should be the same as the one between @].
They are visually not. Edge does not have this imperfection.
IOW, @[ is a token similar to @] in J language.
Note that there is no extra character. It is just the rendering.
Updated•3 years ago
|
Comment 1•3 years ago
|
||
I don't think there's a bug here; this is simply the result of how the Courier New font is designed. The square brackets [
and ]
have their vertical stroke centered within the glyph width, but then the ends of the bracket project in only one direction, with the result that ]
has much less left sidebearing space than [
. So in the combination @[
, there is a lot more visual space between the glyphs than in @]
.
In many other fonts, the vertical strokes of [
and ]
are off-center to the left and right respectively, so that the overall glyph (including the bracket ends) appears more centered. If you try changing the monospaced font preference to Consolas instead of Courier New, for example, the spacing of these pairs looks more consistent.
To see more clearly what's going on, try a comparison such as
data:text/html,<style>span{background:silver}pre{margin:0;font-size:10em}</style>Courier New:<pre style="font-family:courier new">@<span>[</span> @<span>]</span></pre>Consolas:<pre style="font-family:consolas">@<span>[</span> @<span>]</span></pre>
where the brackets have been given a background to indicate the overall extent of the glyphs. This makes it easier to see the positioning of the actual glyph shape within its advance width.
So this is simply how the font is designed. To get a different appearance, use a different font. (Maybe Edge is configured to use Consolas as its default monospace font? We've considered making such a change; see bug 1607913.)
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Jonathan Kew has the correct explanation. Edge indeed uses the Consolas font. So I changed my Firefox font from Courier to Consolas. The display is now visually correct. Thanks for your VERY quick reply.
Comment 3•3 years ago
|
||
Closing this, as there's not actually a Firefox bug here, just a quirk of the Courier font design. (Per bug 1607913, we'll probably end up changing our default monospaced font, but that's another matter. For the current font settings, it was behaving as expected.)
Description
•