Fonts!

For topics about current BETA or future releases, including feature requests.
Post Reply
User avatar
RSteinwand
Rank VI - Professional
Rank VI - Professional
Posts: 551
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Fonts!

Post by RSteinwand » Wed Oct 23, 2013 12:20 pm

Hi Albert,

Saw this today in the latest beta.

For this code:

Code: Select all

font:13px bolder Arial,Helvetica,sans-serif;
... CSE flagged this warning:
The following typeface was not recognized (check spelling): bolder Arial.
I had a similar warning when I used 700 for the font weight in the same position.

W3.org is a big cryptic about the order required for font declarations, but it suggests that the font size and families should be last: http://www.w3.org/community/webed/wiki/ ... rence#Font

Not sure how you want to handle this.
Rick

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3222
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Fonts!

Post by Albert Wiersch » Thu Oct 24, 2013 7:32 pm

Hi Rick,

The spec says "font" should be "[ [ <‘font-style’> || <font-variant-css21> || <‘font-weight’> || <‘font-stretch’ ]? <‘font-size’> [ / <‘line-height’> ]? <‘font-family’> ] | caption | icon | menu | message-box | small-caption | status-bar".

These values should (optionally) come before the font-size: [ <‘font-style’> || <font-variant-css21> || <‘font-weight’> || <‘font-stretch’ ]?

So the font-weight (bolder in the code example) should come before the size (13px), not after it. CSE HTML Validator sees the size, then assumes the rest of the font value are font-family names.

It's an interesting situation. If CSE HTML Validator was to generate a more specific message, then it would have to make the assumption that certain font-family names (or parts of them) are instead suppose to be something other than font-family names since it wouldn't be able to know this for sure. There could actually be a font named "bolder Arial" on someone's system. :D

I suppose it is something to keep in mind for a future update.

But this should be used instead:

Code: Select all

font: bolder 13px Arial,Helvetica,sans-serif;
Image
Albert Wiersch

User avatar
RSteinwand
Rank VI - Professional
Rank VI - Professional
Posts: 551
Joined: Mon Jun 09, 2008 2:12 pm
Location: Fargo, ND
Contact:

Re: Fonts!

Post by RSteinwand » Thu Oct 24, 2013 8:53 pm

Hi Albert,

Like I said, "not sure how you want to handle this". :D

The only thing you can do IMO is see if you have a number followed by "em" or "px" and check what position it's in. Like you said, anything else is a guess.

I just thought I'd mention it in case you were really, really, really bored.
Rick

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3222
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Fonts!

Post by Albert Wiersch » Thu Oct 24, 2013 10:16 pm

RSteinwand wrote:I just thought I'd mention it in case you were really, really, really bored.
I suppose there is a slight chance that that could happen. :mrgreen:
Image
Albert Wiersch

Post Reply