|
|
#1 |
|
Connoisseur
![]() Posts: 82
Karma: 10
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: kindle
|
Am I using @font-face correctly?
![]() Using this HTML Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <link href="../Styles/Garamond.css" rel="stylesheet" type="text/css" /> <link href="../Styles/epub.css" rel="stylesheet" type="text/css" /> </head> <body> <p>none text text text text text text text text</p> <p class="brush">brush text text text text text</p> <p class="fancy">fancy no tags text text<br /></p> <p class="fancy"><i>fancy w/ i tag text text</i></p> <p class="fancyi">fancyi text text</p> </body> </html> and this CSS Code:
@font-face {
font-family: 'Script';
font-weight: normal;
font-style: normal;
src: url('../Fonts/Brush Script MT Italic.ttf');
}
@font-face {
font-family: 'Garamond';
font-weight: normal;
font-style: normal;
src: url('../Fonts/Garamond.ttf');
}
@font-face {
font-family: 'Garamond Bold';
font-weight: bold;
font-style: normal;
src: url('\..\Fonts\Garamond Bold.ttf');
}
@font-face {
font-family: 'Garamond Italic';
font-weight: normal;
font-style: italic;
src: url('..\Fonts\Garamond Italic.ttf');
}
p.fancy {
font-family:'Garamond',serif;
font-size: 4em;
}
p.fancyi {
font-family:'Garamond Italic',serif;
font-size: 4em;
}
p.brush {
font-family:'Script',serif;
font-size: 4em;
}
2. to get the italic, I had to use <i> tags Screen shots attached Is this the way CSS / Sigil / epubs / ADE are supposed to work? I feel I'm doing some wrong. I thought I was following http://web.sigil.googlecode.com/git/...bed_fonts.html Thanks Paul |
|
|
|
|
|
#2 |
|
Staff to 4 Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,690
Karma: 2485828
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2,Black Astak PEz, K4NT(now Wifes)
|
Garmond is the font family
Then there is an @font for each stroke-weight combination that links the font source Code:
@font-face {
font-family: 'Garamond';
font-weight: normal;
font-style: normal;
src: url('../Fonts/Garamond.ttf');
}
@font-face {
font-family: 'Garamond';
font-weight: bold;
font-style: normal;
src: url('\..\Fonts\Garamond Bold.ttf');
}
@font-face {
font-family: 'Garamond ;
font-weight: normal;
font-style: italic;
src: url('..\Fonts\Garamond Italic.ttf');
}
the weight and style will then select which (matching) Family member to use (the weight and style values must match the @ font) In your example, you just have 2 Familys
__________________
Using: Ubuntu(32 bit):Oneric,Precise and XPpro SP3, W7HP(64)- - Libre Office w/Writer2EPUB
|
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
Book Twiddler
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 952
Karma: 1087515
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
Just a reminder that Sigil will show up the basic font face, but won't show the variations such as italic. If correctly done, they will show up in the device.
For checking that, use Reader for PC or some other similar software for your device. |
|
|
|
|
|
#4 | |
|
Connoisseur
![]() Posts: 82
Karma: 10
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: kindle
|
@theducks -- thanks -- that sorted it out for me as far as the epub version is concerned
I was trying to follow the tutorial: http://web.sigil.googlecode.com/git/...bed_fonts.html which had an example Quote:
and I mis-understood that 'font-family' part @mrducks -- thanks for the reminder, I use Adobe Digital Editions to check epubs and Kindle Previewer (not Kindle for PC) to see how well Calibre converted it to mobi or azw3 Thanks again Paul |
|
|
|
|
|
|
#5 | |
|
Staff to 4 Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,690
Karma: 2485828
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2,Black Astak PEz, K4NT(now Wifes)
|
Quote:
I like declaring a single family, then using the variations, knowing they will have the same look. You would NOT declare Brush to be part of the Garmond, it has atotal different look. My PEz (Adobe) is my check
__________________
Using: Ubuntu(32 bit):Oneric,Precise and XPpro SP3, W7HP(64)- - Libre Office w/Writer2EPUB
|
|
|
|
|
|
|
#6 |
|
Connoisseur
![]() Posts: 82
Karma: 10
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: kindle
|
Well, the 'theducks way' has the great advantage of working, and the 'different way' in the tutorial does not (at least the way I was doing it)
(The Brush ttf was easy to not mess up since there were no style or weight options) so only single font-family) Then once I realized that I needed to 1) make a AZW3 file, AND 2) turn [Use Publisher Fonts] on in the Touch, everything works 100% as expected / wanted / hoped for ![]() Paul |
|
|
|
|
|
#7 |
|
Mobile Reader Geek
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 34,205
Karma: 13801264
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad
|
Just a quick note about Garamond...
It's too light for eink screens. When I've seen it used, I've replaced it with the semibold version. But the better solution is to find a better font that works with an eink screen. Also, another issue with Garamond is that the ration of lower case to upper case is not all that good so it leaves a lot of white space between the lines.
__________________
|
|
|
|
|
|
#8 |
|
Connoisseur
![]() Posts: 82
Karma: 10
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: kindle
|
@JSWolf -- You're right about Garamond being a little too light (but it looks so pretty) .
The dead tree version of the book was in Garamond so I just carried along with it The Touch doesn't have the contrast I'd like as it is Are there 'standard' recommendations for highly readable fonts for the KT? I really prefer serif fonts for reading. I'm just converting / fixing / reformatting PD books for personal reading, so the only person I have to please is myself. Paul |
|
|
|
|
|
#9 |
|
Mobile Reader Geek
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 34,205
Karma: 13801264
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad
|
I have a modified (made darker) version of Charis SIL that is very readable on an eink screen. Plus the height of the uppercase to lowercase is very good. Here's the link to download. Also, there are smallcap versions too.
http://www.mediafire.com/download.php?64cse2dshispx08
__________________
Last edited by JSWolf; 02-03-2013 at 06:16 PM. |
|
|
|
|
|
#10 |
|
Connoisseur
![]() Posts: 82
Karma: 10
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: kindle
|
Thanks -- at first glance it seems like it'll will be very readable
I usually use Bookman as my workhorse font, but it's got eink issues also Some of the books I'm Sigil-izing have sub and super scripts, and the Charis seems like it will help there also. Paul |
|
|
|
|
|
#11 | |
|
Mobile Reader Geek
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 34,205
Karma: 13801264
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad
|
Quote:
Happy to help.
__________________
|
|
|
|
|
|
|
#12 |
|
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 33
Karma: 14152
Join Date: Aug 2011
Device: none
|
I'm surprised this hasn't been mentioned in this thread yet. The original post shows four @font-face declarations. The first two look just fine. The fourth one uses backslashes in the “url” line instead of forward slashes. Forward slashes are preferred, but the backslashes might work the same anyway. I'd still change them to forward slashes.
The third declaration begins with a backslash as the first character of the url. Assuming that the backslash works the same as the forward slash, this will take you to the directory of all directories, the top level of the entire filesystem (aka disk). Remove that leading backslash and the declaration for “bold” will have a much better chance of working when you get around to testing it. Also change the backslashes to forward slashes while you're there. |
|
|
|
|
|
#13 |
|
Connoisseur
![]() Posts: 82
Karma: 10
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: kindle
|
@signum -- I did fix them in the CSS and you're right -- it did work much better.
I had a number of other issues with my CSS; some i found myself and other the people here helped me with Paul |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A new face from New Zealand | PeterMNZ | Introduce Yourself | 3 | 10-15-2012 02:28 AM |
| Just Another Pretty Face | PollyN | Introduce Yourself | 6 | 01-08-2012 05:49 AM |
| Gentium Book font (ttf) doesn't render correctly | therealjoeblow | Kobo Reader | 12 | 09-07-2011 11:23 PM |
| Another new face in the crowd! | Rebos1969 | Introduce Yourself | 8 | 06-24-2010 08:01 PM |