- From: Steven Pemberton <steven.pemberton@cwi.nl>
- Date: Thu, 19 Sep 2002 13:33:50 +0200
- To: <www-style@w3.org>
- Cc: "HTML WG" <w3c-html-wg@w3.org>
(Apologies for lateness) 3. Font specification s/it's name/its name/ 3.1 Font Matching Algorithm Matching on glyphs: is matching on <body> (for instance) required to look at the whole document content to determine which glyphs are required? Or only at the textual content at the top level (and not in children)? I couldn't work it out. How does 'none' fit it with this algorithm? If I have "font-family: times, serif, none" then 'serif' will always be chosen, even if it doesn't cover the character range, right? "d. 'font-size' [...] Outside the margin of tolerance the UA should use another font as listed in the font-family property (if available)." => "Outside the margin of tolerance font-size will fail" (Otherwise step 2. will not work). I found that the algorithm was very hard to read and follow, and verify, particularly because of the spaghetti style ("and repeat from step 2"). Here is an attempt to synthesise the algorithm (but still not treating 'none'): <<<< Find the first family in the 'font-family' property that is a candidate and covers the required character range. If no family matches then use a UA dependent family value, and find either the best candidate that can be obtained that covers the required character range, or otherwise the best candidate that can be obtained. A font is a candidate if it matches first the font-style, then the font-variant, then the font-weight and then the font-size. If font-style is italic, and there is a font face marked italic, it matches; if font-style is italic, and there is a font face marked oblique, it matches; otherwise the values must match exactly. For 'font-variant', 'normal' matches a font not labeled as 'small-caps'; 'small-caps' matches a font labeled as 'small-caps', a font in which the small caps are synthesized, or a font where all lowercase letters are replaced by uppercase letters. (A small-caps font may be synthesized by electronically scaling uppercase letters from a normal font.) 'font-weight' is matched according to the rules under 'font-weight' below. It always matches. 'font-size' matches within a UA-dependent margin of tolerance (otherwise it is not a candidate). (Typically, sizes for scalable fonts are rounded the nearest whole pixel, while the tolerance for bitmapped fonts could be as large as 20%.) Further computations, e.g., by 'em' values in other properties, are based on the computed 'font-size' value. A font covers the required character range if the element in question is not a textual element, or if the element is a textual element and the font has glyphs corresponding to the textual content. (The 'unicode-range' characteristic may be used to rapidly eliminate from consideration those font faces that do not have the needed glyph. If the 'unicode-range' characteristic indicates that a font contains a glyph in the correct range, that font must be used. If there is a corresponding glyph, then the matching font-face is the nominal font for the textual element.) >>>> 3.2 Font-family I think that it would be far better if a font-family property was *required* to end with a generic. So many people make this mistake on the web. What's the point of allowing more than one generic-family in the list? I suggest: font-family: family*, [generic|none] You also need to define 'none' better. What if someone defines 'font-family: none'? Doesn't seem to be defined what happens. Otherwise, always require a font-family, which would mean: font-family: family*, generic | family+, none. Example HTML: please use HTML 4.01, not 4.0 Example II: s/CSS2/CSS2 and CSS3/ ":lang(zh-tw)": aren't you going to offend some sensibilities here? Just asking. 3.3 Font styling: font-variant "The 'font-variant' property requests such a font for bicameral (having two cases, as with Latin script)." Missing word? "bicameral use"? font-weight: "darker than the inherited one/lighter than the inherited one": I presume "inherited value" is meant here. Example V: the comment "/* 500 if available */" This comment only relates to a <strong> within a <p>/<body> (and not an <h1>); and shouldn't it read "500 or higher if available"? I think an example of inheritance might be in order here: Suppose I have p {font-weight: 400} strong {font-weight: bolder} and there are weights at 400, 600 and 700. <p>Take me <strong>further and <strong>higher</strong></strong>. Then "Take me" will be weight 400; "further and" would be 600, and "higher" 700, right? 3.4 font-size: <relative-size> "If the parent element's size is not close to a table entry, the user agent is free to interpolate between table entries or round off to the closest one." Why not just say that the size is the next table size larger/smaller than the parent? "Round off to the closest one" should be "Round up to the closest one for 'larger', and round down to the closest one for 'smaller'." "The user agent may have to extrapolate table values if the numerical value goes beyond the keywords." This is vague ('may'). Please specify that larger keeps working after reaching xx-large, and smaller keeps working after xx-small, but that the UA may stop at a given size. "The following table provides user agent's guideline for the absolute-size scaling factor and their mapping to XHTML heading and absolute font-sizes" Please make that HTML, not XHTML, and similarly in the table. Scaling factor h6=3/5 of medium; h5=8/9 medium: There are people who object to headings *ever* being smaller than the surrounding text. I'm not sure of the normative value of adding the headings to this table, and would prefer not to see it here. font-size-adjust: "y(a/a') = c" is more understandable (to me) as c = y x (a/a') where 'x' is × Example VII: seems to be missing a piece of CSS. "The first image below shows several typefaces rasterized at a common font size (11pt. at 72 ppi)" I think you mean "(11pt at 1px per pt)" otherwise I don't understand it. "The next image shows the results of 'font-size-adjust' " => "The next image shows the results of 'font-size-adjust' with a value of 0.58" 3.6 Generic font families "For optimum typographic control, particular named fonts should be used in style sheets." This could be misread because of the 'should'. Either delete, or rephrase as "For optimum typographic control, use particular named fonts in style sheets". "User agents should provide reasonable default choices for the generic font families, which express the characteristics of each family as well as possible within the limits allowed by the underlying technology." s/should/must/, since 'reasonable' and 'within the limits allowed' already cover the 'should' part. "User agents are encouraged to allow users to select alternative choices for the generic fonts." s/are encouraged to/should/ 4. Font decoration "they differ by being close related": closely related 4.2 font-smooth "always always smooth text at any size." => "if possible smooth text at any size" Steven Pemberton Chair, HTML WG
Received on Thursday, 19 September 2002 08:04:20 UTC