Need special font for form controls




CSS Parsing and Computation
18 years ago
17 years ago


(Reporter: rods (gone), Assigned: Pierre Saslawsky)


Windows NT

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [nsbeta2-])


(1 attachment)



18 years ago
I need a a special font for form control buttons and selects. The text field 
uses moz-fixed, which sets a specific monospace font and size that is then 

I need the same for but for a sans-serif font. It could be called 
"moz-variable-width-font" or something like that. The problem today is if I set 
the font in the style shett to the correct family and size to make the form 
controls look and size correctly then the font isn't overridable ny use style 
sheets or inline style.

It is getting late in the M15 cycle for this but this is definitely a beta2 bug

Comment 1

18 years ago
markig as beta2
Keywords: beta2

Comment 2

18 years ago
If I'm correct, the meaning of '-moz-fixed' is "use the user's fixed font *and* 
size". It is the only difference with 'monospace' which means "use the user's 
fixed font".

I understand we may need someday a '-moz-variable-width-font' but for the form 
controls you mentioned, we should the CSS2 and CSS3 system fonts described in

The constants are currently defined in nsIDeviceContext.h 
(eSystemAttr_Font_Button, eSystemAttr_Font_PullDownMenu...). Later, they may move 
to the LookAndFeel.

Marking as Invalid. Please reopen if it doesn't do what you are looking for.
Last Resolved: 18 years ago
Resolution: --- → INVALID


18 years ago
Keywords: nsbeta2

Comment 3

18 years ago
Setting self to QAContact while chrisd out on sabbatical...

Rod, could you add comments on this one?  Thanks.  -ckritzer
QA Contact: chrisd → ckritzer

Comment 4

18 years ago

I was having problems getting this to work and marc and I took a quick look. It 
appears that when "font-family: button;" is specified, ParseFamily in the 
CSSParser doesn't convert the text "button" to the proper enum. 

MapDeclarationFontInto in nsCSSStyleRule first checks to see if it has a string 
which it does and the it tries to find a fon for it. it should fail on the check 
for a string and drop down into where it is checking for enums.
Resolution: INVALID → ---
Target Milestone: --- → M16

Comment 5

18 years ago
Closed as invalid again. System fonts are only defined for the 'font' property, 
not for 'font-family', because (per the spec) system fonts can only be accessed 
as a whole; that is, the font-family, size, weight, style, etc. are all set at 
the same time. See the spec at the two URLs above for more info.

Also, you are not allowed to write "font: 32px button" but you can write "font: 
button; font-size: 32px".
Last Resolved: 18 years ago18 years ago
Resolution: --- → INVALID

Comment 6

18 years ago
Duh - missed that syntactical nuance, Pierre.

However, specifying 'font:button' gives a font that is NOT my system-specified 
font (on Windows). There is still a problem here. I'll attach a testcase showing 
a bunch of buttons that have fonts specified using 'button', 'menu', 'dialog' - 
they all use the same font and it it not the correct one. If I get a chance I'll 
look into it more, unless you know what's wrong already.

Comment 7

18 years ago
Created attachment 9418 [details]
Testcase showing 'font:button' not mapping to correct font face on Windows

Comment 8

18 years ago
With the default settings, CSS system fonts don't work on Windows because of bug 
22031 (see the comments from Erik on 2000-05-31 15:28).

Comment 9

18 years ago
Why is this marked INVALID?  Shouldn't it be DUPLICATE?  Reopening to set correct 
Resolution: INVALID → ---

Comment 10

18 years ago
Pierre & Rod, I can't find info in the CSS Spec about "font:button;" in the 
following example found in the testcase Rod supplied:

<input type="button" style="font:button; font-size:12pt;" value="Button Button">

Could either|both you gentlemen vend me a clue or two?

Comment 11

18 years ago
Putting on [nsbeta2-] radar. Not critical to beta2. 
Whiteboard: [nsbeta2-]

Comment 12

18 years ago
Chris, "font:button" is defined in Specifying "font:button" 
should set simultaneously the font family, size and decorations.

The bug as originally described is invalid. If "font:button" wasn't working, it 
was because of bug 22031 which is fixed now. Note that for a full support, we 
also need to fix bug 33312.

Closed as Invalid again: we shouldn't need a special font when we can use the 
standard CSS2/CSS3 system fonts.
Last Resolved: 18 years ago18 years ago
Resolution: --- → INVALID

Comment 13

17 years ago
Marking VERIFIED INVALID per Pierre's comments.
You need to log in before you can comment on or make changes to this bug.