<pre> in variable width font when pref to 'always use my fonts' is set

VERIFIED FIXED in mozilla0.9



18 years ago
7 years ago


(Reporter: BenB, Assigned: Marc Attinasi)



Firefox Tracking Flags

(Not tracked)



(2 attachments)



18 years ago
1. Open testcase (will attach)

Actual result:

in a variable width font

Expected result:

in a fixed width font

Additional comments:
Observed with Linux build just built. Does not happen with 2000-10-03 nightly
(and I didn't notice this bug with my former build from 2000-10-09 or -10).

IMO MUSTFIX for M18, ccing Asa.

Comment 1

18 years ago
Created attachment 16832 [details]


18 years ago
Keywords: mozilla0.9, regression

Comment 2

18 years ago
No, wait, please don't fix this bug - BugZilla looks much nicer with this bug ;).

Comment 3

18 years ago
Today I was seeing every single page use my default font, even <PRE> content or
text files. I tried turning the "always use my font" pref on and back off, and
now everything works.

Comment 4

18 years ago
Marc, please look into this. It may be a serious regression due to the change in
font prefs.

Comment 5

18 years ago
Looking into it now.

Comment 6

18 years ago
My changes are only on the trunk, so I'm assuming this is being seen on the
trunk (though it is not clear from the comments). Can somebody compare against
the branch build?

I am not seeing the bug with my trunk build from yesterday. I created a new
profile and still, the testcase shows up in the monospace font.

The comment from Decklin worries me, because it would suggest that the initial
value of the font-pref is wrong, however I double-checked and the initial value
is set to 'useDocumentFonts = TRUE', even if the pref value is not present.
Assignee: erik → attinasi

Comment 7

18 years ago
Hmm. I cannot reproduce this using either today's trunk or branch build on NT,
nor can I reproduce it using my local builds from yesterday on NT or Linux.

I have tried old and new profiles, and it didn't make any difference. I wonder
if there is an issue with the profile value 'always use my fonts' having been
already set when the pref didn't work and then suddenly working? I'll post a
reference to this bug on some newsgroups and see if anybody else has seen it.

Comment 8

18 years ago
per dmose:  today's 12:00 trunk build on linux shows me fixed width chars
looking at the attachment

Comment 9

18 years ago
From howard, Mozilla contributor:  "using Linux 2000101212, it looks okay as
long as I don't use "always use my font settings."

Comment 10

18 years ago
From BenB: works fine with a new profile.

Perhaps Ben can attach his prefs to see if we can find what may be causing this.

Comment 11

18 years ago
I spoke (chatted) with Ben B. and he had the 'always use my fonts' box checked
in his profile. The problem is simply that when the pref to 'always use my
fonts' is set, we are applying the variable space font instead of
the monospace font to the PRE element. This is not directly related to the
changes I made, however since the 'always use my fonts' pref is now working, we
are seeing a problem in the font handling of the <PRE> element.

If this is important enough, I might be able to special-case the -moz-fixed font
in the code where the normal font handling is superceded for the pref, but
that would also allow other style rules that specified -moz-fixed to get
through. I'm not sure what the full impact would be.

Comment 12

18 years ago
Update summary: problem only occurs when the option to 'always use my fonts' is
set. Lowered severity to normal.
Severity: major → normal
Keywords: regression
Summary: <pre> in variable width font → <pre> in variable width font when pref to 'always use my fonts' is set

Comment 13

18 years ago
Same problem for <PRE>, <CODE>, and <TT>. 

Comment 14

18 years ago
I have a fix for this now. The problem *was* in my changes. In
nsCSSStyleRule.cpp and nsHTMLFontElement.cpp I was neglecting to set the font
flags to NS_STYLE_FONT_USE_FIXED when the face is "-moz-fixed" when we were
otherwise ignoring the font face (because the pref to 'always use my fonts' is set).

Comment 15

18 years ago
Created attachment 17164 [details] [diff] [review]
Patch to fix monospace fonts when document fonts are being overriden via prefs.

Comment 16

18 years ago
I've attached the patch to fix this. If somebody wants to review it, or better 
yet take it and land it on the trunk, that would be great. I'm not sure if I can 
get approval to land this or not, but I'll try.


18 years ago
Target Milestone: --- → mozilla0.9

Comment 17

18 years ago
The fix for this was just checked into the branch (for bug 40340, along with the
rest of the pref work that was landed on the trunk a week ago).

Note to self: The trunk now needs to be updated with the attached patch so it is
on par with the branch.


18 years ago
OS: Linux → All
Hardware: PC → All

Comment 18

18 years ago
Fix ehceked into trunk - resolving as fixed.
(nsHTMLFontElement.cpp, nsCSSStyleRule.cpp)
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 19

18 years ago
Marking verified in the 2001020308 linux build.
You need to log in before you can comment on or make changes to this bug.