2015-01-23, 5:30, Philippe Wittenbergh wrote:

|body{ font-family:  "Helvetica, Arial,sans-serif;     font-weight:
200; }

If the font is named “Helvetica LT Std” then you probably want to
name it thus in your stylesheet.

According to specifications, the right way would be to specify font-family (such as Helvetica) and font-weight separately, to get a particular font (typeface) such as Helvetica Light.

In practice, it’s messy, and declaring a particular font as if it were a font family often works better. But in my tests, I have also seen the opposite phenomenon: such an approach has failed on some browsers where the “theoretical” way works.

The name to be used for a particular font is a tricky issue; in principle you should use the “full name” or the “PostScript name” as defined in the font file, and this may differ from a marketing name and from the name shown by the OS, as it may used a localized name (according to the language of the OS).

This, however, is of very limited practical impact. Referring to different weights (except normal and bold) of fonts installed in the system is meaningful only in special, controlled environments where you know the conditions and they are controlled. This means e.g. an HTML5 application (an application programmed in JavaScript, with content rendered using HTML and CSS and with a web browser as execution environment) for use inside a company or otherwise in a limited context where all devices used can be known to have specific fonts with known names (and the repertoire of browsers used is known).

So we indeed come to this conclusion:

That said, as Gjim already noted,
(very) few people will have that font available. @font-face is the
way to go then.

This means that you need to buy a license for the fonts used, or find suitable free fonts, or to create your own fonts, or to stay tuned to getting into a big trouble (if you use fonts without permission).

When using @font-face, you typically use services like FontSquirrel to generate font files in different formats, as needed for making things work cross-browser. Such services typically generate the relevant pieces of CSS, namely @font-face rules and sample font-family declarations, for you. They may use the “theoretical” approach, or the the approach where each font is declared as a font family. When using @font-face, both approaches work. But the choice of approach has implications on writing your HTML and CSS.

Other OS
would see Arial if available or their default OS font. If you include
“Roboto” in your font-stack, users of Android 4.3 and newer will also
see a “lighter” font-weight. Windows users are the losers…

Roboto is available as a Google font, so it could be served to Windows users, with @font-face. On the other hand, you could simply serve it to everyone. You might think that Helvetica is better than Roboto and therefore make it the first choice. But having two font families means that you would need to consider both alternatives when designing all the other formatting. The choice of a font affects, or should affect, many things like font size, line height, column width, and font feature settings. It is much easier to work with just one font family, so you would need to ask whether the superiority of Helvetica is important enough to justify the added complexity.

Yucca

______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to