6 ms·
Using the System Font in Web Content
- applecore 11y agoIs there any legitimate way to use Apple's new system font, San Francisco, in non-Apple systems? Do other platforms support a generic "system" font family?
- dubcanada 11y agoRead the article, it clearly says... 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.
- deleted 11y ago[deleted]
- justwannasing 11y agoUnless Apple makes it available for your use, no. Every system has its own system font and you can find them easily on the web.
- bitwize 11y agoLinux doesn't have a "system font" unless you mean: * 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.
- 127001brewer 11y agoHere's more information about this: http://furbo.org/2015/07/09/i-left-my-system-fonts-in-san-francisco/ http://furbo.org/2015/07/09/i-left-my-system-fonts-in-san-fr...
- jrochkind1 11y agoThanks, that clarifies that indeed this only works in Safari.
- elcapitan 11y agoWhy doesn't Webkit on the Mac just set the respective system font as value for "sans-serif"?
- glitch 11y agoThinking beyond just OS X, the purpose for a general "-system-*" font and style identifier would be that web apps could more easily have the "native look" without having to explicitly identify the operating environment. (And identifying the operating environment still doesn't necessarily tell you what their system font is set to; that's still heavily presumptuous.) 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.
- glitch 11y agoAlso, to more appropriately answer your question, there exists a notion for separating "document" and "UI widget" fonts. Documents often have content to be read at long lengths. UI widgets don't have the "long length" constraint in their design context. As one example, the system font may be lighter in weight to achieve an elegant looking aesthetic. However, while the lighter weight font is acceptable for the UI widgets, it isn't nearly as acceptable for readability of document text. It's a nice to be able to have that design/usability context distinction. The default context for the web is that of the document, not the UI, the default CSS sans serif font should be the "document font".
- pmontra 11y agoIt's hard to test a page that uses a font you don't have access to and you can't virtualize OS X on other OSes. Web pages shouldn't be pixel perfect (there is PDF for that) still sometimes you have to fit text into fixed width areas and you want to see what happens.
- glitch 11y agoIn the context of general "-system-✻" font & style identifiers (not merely -apple-system-✻ specific)... 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 http://browsershots.org, https://www.browserstack.com/screenshots https://www.browserstack.com/screenshots, http://www.crossbrowsertool.com http://www.crossbrowsertool.com, http://www.browsershots.atm http://www.browsershots.atm, https://www.browserling.com https://www.browserling.com, http://dev.modern.ie/tools/screenshots/ 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.
- sbarre 11y agoThis feels like a full-circle back to Internet Explorer (v4 or v5?) in the late 90's where you could specify CSS rules in your HTML to match your styling to the colours (panes, borders, scroll bars, headers, text, all of it) and fonts that users set in their Windows machine's control panel for the operating system window chrome. 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. ;-)
- mixmastamyk 11y agoSystem colors have been around forever, I don't remember them being IE specific. If they were it wasn't for long. http://webdesign.about.com/od/colorcharts/l/blsystemcolors.htm http://webdesign.about.com/od/colorcharts/l/blsystemcolors.h... I always appreciate when they are used, so pages fit my OS theme.
- sbarre 11y agoAh well, my bad, I thought this was an IE-only thing but you appear to be correct, it looks like it was part of the CSS 2.1 spec. Check out an example here: http://www.iangraham.org/books/xhtml1/appd/update-23feb2000.html 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... :)
- mixmastamyk 11y agoYep, that's the page I remember.
- dsr_ 11y agoDoes anyone else think there might be a significant security value in not allowing a web browser access to a font associated with messages from the operating system?
- geofft 11y agoUnless the font is particularly distinctive to the most casual reader, such an approach seems like pseudosecurity. San Francisco is not distinctive enough from other well-designed serif fonts that people will intuitively notice a spoofed message. 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.
- andrewingram 11y agoAgreed on the first point. Your second doesn't make sense to me, since any situation where using San Francisco is going to give an extra sense of authority, is also a situation where it's already available to use.
- geofft 11y agoHmmm, I guess your argument is that Apple could prevent San Francisco from being usable as a font in even a desktop word processor, so you can't make an error message in that font and screenshot it? 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.
- ori_b 11y agoIf you are spoofing content, web fonts already have you covered. Assuming that people even notice the font enough to take it as a security cue.
- mappu 11y ago
- greggman 11y agoSo much for no more prefixes :( http://www.w3.org/blog/CSS/2012/08/30/resolutions-53/ http://www.w3.org/blog/CSS/2012/08/30/resolutions-53/
- gsnedders 11y agoIt was meant to be a non-web feature, till people found out about it and started posting blogs posts elsewhere, AFAIK, hence the decision to prefix does follow that resolution.
- andy_ppp 11y agoMake websites that look like websites. 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.