Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 10-20-2012, 03:14 PM   #1
jayz
Member
jayz began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Jun 2012
Device: kindle fire,android
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'
jayz is offline   Reply With Quote
Old 10-21-2012, 04:29 AM   #2
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,315
Karma: 4963983
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
You can use a double quote inside single quotes, or a single quote/apostrophe inside double quotes.
Jellby is offline   Reply With Quote
Old 10-24-2012, 04:49 PM   #3
Grey Ram
Member
Grey Ram began at the beginning.
 
Posts: 11
Karma: 10
Join Date: May 2011
Device: Kindle 3
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.
Grey Ram is offline   Reply With Quote
Old 10-25-2012, 04:59 AM   #4
jayz
Member
jayz began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Jun 2012
Device: kindle fire,android
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);
}
jayz is offline   Reply With Quote
Old 10-26-2012, 10:14 PM   #5
pholy
Booklegger
pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.
 
pholy's Avatar
 
Posts: 1,800
Karma: 7999034
Join Date: Jun 2009
Location: Toronto, Ontario, Canada
Device: BeBook(1 & 2010), PEZ, PRS-505, Kobo BT, PRS-T1, Playbook, Kobo Touch
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.
pholy is offline   Reply With Quote
Old 10-28-2012, 04:29 AM   #6
jayz
Member
jayz began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Jun 2012
Device: kindle fire,android
"The first name mentioned is the preferred font, each following name"

I thought you could use multiple embedded fonts in a fixed layout?
jayz is offline   Reply With Quote
Old 10-28-2012, 05:20 AM   #7
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,315
Karma: 4963983
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
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 is offline   Reply With Quote
Old 10-28-2012, 08:05 PM   #8
jayz
Member
jayz began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Jun 2012
Device: kindle fire,android
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.
jayz is offline   Reply With Quote
Old 10-29-2012, 09:36 AM   #9
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,315
Karma: 4963983
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Code:
h1 { font-family: Verdana, Arial, sans-serif; }
This uses, for <h1> elements, the Verdana font if available, else Arial, and as a last choice the default sans-serif font (which sometimes the user can select and sometimes it's hard-coded in the rendering software).

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 is offline   Reply With Quote
Old 10-29-2012, 05:09 PM   #10
jayz
Member
jayz began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Jun 2012
Device: kindle fire,android
Jellby,

Thanks
jayz is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-T1 Adding two fonts into the CSS? WarGhSt Sony Reader 1 02-02-2012 02:41 AM
Am i doing it right?PRS+ and CSS forced Epub fonts via Calibre melkorbauglir Sony Reader 20 07-29-2011 11:09 AM
Opus Fonts directory for Calibre -> External CSS fiery Bookeen 12 02-20-2011 11:05 PM
nook fonts via CSS danrodney Barnes & Noble NOOK 1 12-21-2010 08:56 AM
Possible to embed fonts in CSS of .lit file? tanzer21 Calibre 9 06-30-2010 08:26 PM


All times are GMT -4. The time now is 07:16 PM.


MobileRead.com is a privately owned, operated and funded community.