Using the System Font in Web Content
webkit.org
webkit.org
We used those style rules extensively for our Intranet web apps (mod_perl y'all) to make them look more "native". And it worked, it was a big part of our wow factor when showing our stuff off.
I'm glad we're finally catching up to Microsoft on this. ;-)
http://webdesign.about.com/od/colorcharts/l/blsystemcolors.h...
I always appreciate when they are used, so pages fit my OS theme.
Check out an example here: http://www.iangraham.org/books/xhtml1/appd/update-23feb2000....
At the time, it was Internet Explorer vs. Netscape, and we were building Intranet web apps for Windows users, so our target browser was pretty much only Internet Explorer. Mostly because of the more advanced JScript and XML processing capabilities, and eventually HTAs and early XMLHttpRequest support that came with IE6.
Surprisingly we never got into ActiveX components. Even back then, they seemed like a bad idea... :)
Maybe someone's Linux distro is using a serif typeface, or a monospaced serif typeface, or a monospaced sans-serif typeface, or something more like Comic Sans (have seen this more than once) as their system font.
The point is, we can do better than what we have now with regard to the goal of making web applications approach the "native look and feel" more easily and more simply. It's a balance game; a balance between adding features like this (every feature adds a little bloat) that also potentially help eliminate bloat elsewhere in code (e.g., javascript to fingerprint the environment). Further, getting the system font is something that CSS should be able to know about without the aid of JavaScript; there are lots of simple forms and data entry "applications" that don't use any JavaScript (nor should they) and would benefit from a better presentation. Writing a native application for any platform, I want to get the system font, and not have to know or assume any qualities of what that font is. With typical native applications, the default font is intrinsic in the UI widgets your using, so you don't have to think about it. With the web, typically the default font is a "document font" and not the UI widget font, so you need to be able to have some sort of mechanism beyond the default font in order to get the system UI font.
Personally, I think it would make way more sense if you could specify something like a "base style" meta-tag, with values like:
• "browser" (the default): do what we're doing now, where every browser styles things a bit differently, and a default Chrome <button> looks nothing like a default Safari <button>, and so forth.
• "legacy": make the page look exactly like it would when displayed in NCSA Mosaic in 1994. (This style could be inferred from the headers and auto-applied if the server sends a very old modification date or the page uses an older version of HTML.)
• "reset": a WHATWG-standardized set of CSS reset values
• "native": make tags resemble native OS controls—<p> should look like label-control text, <h1> should look like a native header style, <button> like an OS button (instead of a browser button), etc.
The interesting part of this is that this would allow the "browser" style to diverge further from the "legacy" and "native" styles than it already has, since any web designer could just ask the browser to drop all its customizations in a quick-and-convenient way.
1. Knowing extremes and layout boundary conditions: You can reasonably test extremes of wide and condensed font metrics; it's not that hard.
2. Rigid designs: If you don't want to use the ambiguous system font, you don't have to; it doesn't change that. If you have a design that requires certain rigidity and inflexibility, you can have your explicitly imported web fonts and be happy.
3. Flexible designs: Be flexible and fluid. Be like water. Heck, there are slight unknowns with using any non-explicitly defined font. Using CSS generic-family identifiers (serif, sans-serif, cursive, fantasy, and monospace) have variation and are not guarantees, but you can still use them without much concern for layouts that are designed to be appropriately accommodating.
4. Native look and feel: If you want to achieve something closer to the native system look and feel, being able to use the system font from CSS helps you out immensely. For those that (1) design their layout to flow relatively nicely without being overly fixed or constrained and (2) want to have an appearance matching the system font, then it's great!
5. Testing: From my experience, this doesn't pose any significant testing issues. Besides testing artificial extremes of wide and condensed font metrics, practical testing across multiple environments isn't anything new. It's something that already gets done by any skilled front-end designer. Many shops will test across many browsers under may platforms anyway. Sites like http://browsershots.org, https://www.browserstack.com/screenshots, http://www.crossbrowsertool.com, http://www.browsershots.atm, https://www.browserling.com, http://dev.modern.ie/tools/screenshots/ and many others are out there for people who don't have or don't want to deal with the setup in-house to do testing. (You might have to supplement it with mobile devices in-house, sure.) You can easily cover 95% of the actually used environments (browsers/platforms) very explicitly, and for the environments you don't explicitly test for, at that point of successful testing, it's very likely there won't be an issue, and if there is an issue, it should be minor and not significantly matter. Be pragmatic.
On platforms which do not support “-apple-system,” the browser will simply fall back to the next item in the font-family fallback list. This provides a great way to make sure all your users get a great experience, regardless of which platform they are using.
There are currently discussions in the w3c regarding standardizing this value so authors could simply specify “system.” However, these discussions have not reached consensus, so WebKit prefixes this value.
* the console font
* one of the various "fixed" fonts that come with X11
* any of the default X11 fonts
None of which are likely to be used as the default for title bars, menus, etc.
Oh well. Something else to roll into systemd!
Graphical distros have a standard font in their UI.
Besides, malware authors generally cannot be expected to follow copyright law. They can just steal the system font OTF and convert it to a web font, or render text as an image (which may not even be illegal), or any number of similar things.
It seems like this boils down to DRM on the font -- only making it accessible to Apple-signed applications (not even to third-party apps, since I can write a third-party app that pops up a custom error message and then take a screenshot of my app). This is untenable for the usual reasons that DRM is untenable.
Cf. http://www.guanotronic.com/~serge/papers/fc15-fonts.pdf & http://pet-portal.eu/files/articles/2011/fingerprinting/cros...
Do not try to match them to desktops, unless you are wrapping the website in a desktop launcher!
I personally find the character of the San Francisco Font to be very Apple these days, clear to the point of being patronising and devoid of a soul.