![]() |
working with fonts in css
Whats the difference in using quotes and apostrophe?
@font-face { font-family:font family; example:"font family" or 'font family' font-style: normal; font-weight: normal; src: url(fonts/font family.ttc); example: "fonts/font family.ttc" or 'fonts/font family.ttc' } and the div? div.your div { font-family:font family; example:"font family" or 'font family' |
You can use a double quote inside single quotes, or a single quote/apostrophe inside double quotes.
|
Using double/single quotes
The use of quotes is optional except when the font name contains a space, in that case you must use them. Personally, I prefer double quotes.
|
so if i wanted to use multiple fonts would it look like this?
@font-face { font-family:"1font family" "2font family" "3font family"; font-style: normal; font-weight: normal; src: url(fonts/1font family.ttc); src: url(fonts/2font family.ttc); src: url(fonts/3font family.ttc); } |
If you think of the @font-face { } as a declaration of a font, realize that only a single font can be declared at a time. So your declaraion above needs to be broken up into three @font-face declarations. So if @font-face {} is a declaration, then the font-family: name; in a CSS rule is a reference; at that point you can have a series of font names separated by commas. The first name mentioned is the preferred font, each following name (a fallback) is less preferred. The ereader software uses the first on it can find.
Adobe-based ereaders can get very confused with multiple font-names in an @font-face declaration; one of the few times it doesn't totally reject the stylesheet, as far as I can tell. Oh, and those font names are not for a family, they are a specific style and weight. |
"The first name mentioned is the preferred font, each following name"
I thought you could use multiple embedded fonts in a fixed layout? |
You can specify several fonts in a style, but in a @font-face rule it makes no sense, because the meaning here is different: in a style, font-family gives a list to choose from; in @font-face, font-family specifies which family it is defining.
And anyway, giving a list of families to choose from can be useful when you don't know which ones are available, but with embedded fonts? |
Jellby,
"in a style, font-family gives a list to choose from" can you write an example of what it would looks like with multiple fonts to choose from? I'm pretty sure but unsure if that makes any sense. Thanks. |
Code:
h1 { font-family: Verdana, Arial, sans-serif; }This is mainly for web pages and browsers, which usually can access to the whole set of system-installed fonts, and thus "available" has a meaning for them. In current ebook readers, however, there is often no way to install fonts, and when there is, the actual rendering software has no way (or is not adequately configured) to access them, so in practice there is no font "available" (unless it's embedded). |
Jellby,
Thanks |
| All times are GMT -4. The time now is 06:52 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.