• Double font-family fallbacks — frowned upon or just plain wrong?
    10 replies, posted
This isn't something I've ever needed to come across before but the situation calls for it so here I am. I'm using a slab-serif font face on a website, but I understand that not everyone has it. I want to fall back to the whatever the default slab-serif font is for the users machine, and if there isn't one I want to fall back to Arial, or the default sans-serif. I'm doing this [code]font-family: 'American Typewriter', Rockwell, slab-serif, Arial, sans-serif;[/code] This seems odd to me. I'm not sure if there's even a default font set for slab-serif's? I can happily just do this instead, but I'd rather it fell back to a slab-serif if it could: [code]font-family: 'American Typewriter', Rockwell, Arial, sans-serif;[/code] Thanks
-snip-
-Removed-
There's no such thing as a slab-serif font. I'd suggest you just look for fonts that look similar to yours on for both Mac and Windows and include their name, and as a last resort include Arial and sans-serif.
[QUOTE=TerabyteS;28481546]There's no such thing as a slab-serif font.[/QUOTE] [url]http://en.wikipedia.org/wiki/Slab_serif[/url] [editline]7th March 2011[/editline] [QUOTE=sebmck;28479100][img_thumb]http://gyazo.com/8d162e9b1634fd65e46d4722c9afca36.png[/img_thumb][/QUOTE] Do you ever make posts that aren't complaining about other people's posts?
In CSS the only defined default families are monospace, serif, sans-serif, cursive and fantasy. So when you write slab-serif, it actually makes the browser look for a font family called "slab-serif", and if they don't have a family by that exact name installed it'll fall back to Arial. Edit: And if the first 2 entries are serif fonts, don't end the list with sans-serif, it's the wrong type of font.
[QUOTE=KmartSqrl;28485748][url]http://en.wikipedia.org/wiki/Slab_serif[/url] [editline]7th March 2011[/editline] Do you ever make posts that aren't complaining about other people's posts?[/QUOTE] I don't think he even does web development stuff, at least I don't remember seeing anything made by him.
[QUOTE=KmartSqrl;28485748][url]http://en.wikipedia.org/wiki/Slab_serif[/url] ?[/QUOTE] I meant in HTML/CSS, as a set like sans-serif or serif.
[QUOTE=TheDecryptor;28487119]In CSS the only defined default families are monospace, serif, sans-serif, cursive and fantasy. So when you write slab-serif, it actually makes the browser look for a font family called "slab-serif", and if they don't have a family by that exact name installed it'll fall back to Arial. Edit: And if the first 2 entries are serif fonts, don't end the list with sans-serif, it's the wrong type of font.[/QUOTE] This is the answer I was looking for. I wasn't sure whether slab-serif was a recognised font family in CSS. As for your edit, I wouldn't class American Typewriter and Rockwell as serif fonts. Having a font like Georgia, Garamond, Times, whatever, as a fallback for a slab font doesn't seem right to me. I'd rather it fell back to something that looks right.
A slab-serif is a type of serif font, since it has serifs (while a sans-serif doesn't)
Why not use @font-face to include the font with the website? [php] @font-face{ font-family: Lobster; //Name of the font src: url('fonts/Lobster.otf'); //Path to the font } [/php] [editline]10th March 2011[/editline] And then just use it like any other font.
Sorry, you need to Log In to post a reply to this thread.