1 reply [Last post]
p3aul
Offline
Regular
Last seen: 8 years 25 weeks ago
Timezone: GMT-4
Joined: 2008-10-19
Posts: 17
Points: 19

Hi!
I've been trying to use @font-face to get my epubs to display the way I want them. All an epub is is a zip file with the book material in xhtml and controlled by a css file called "stylesheet.css. even though the text is broken down in to classes they all have the

tag. Looking on the net I found this:

@font-face {
font-family: DeliciousRoman;
src: url(/Delicious-Roman.otf);
}

I substituted a font on my computer(yeah I know I'm supposed to own the font, this was for practice) , one called HoboStd.otf.
I put that in the src: url line and put "Hobo Std" which is it's name on the computer in the font-family line. I then did this just below the @font-face:

p
{
font-family:"Hobo Std";
font-size:2em;
}

I then added the file HoboStd.otf to the folder where the css and html are. It didn't work!

to troublshoot I got rid of the @font-face lines and just used css for the p tag and everything worked fine on any font I chose.
What am I doing wrong?
Thanks,
Paul

p3aul
Offline
Regular
Last seen: 8 years 25 weeks ago
Timezone: GMT-4
Joined: 2008-10-19
Posts: 17
Points: 19

Ok I figured it out or else a

Ok I figured it out or else a work-a-round. I downloaded my book from project gutenberg as an html file. There DOCTYPE was out of date so i used the most recent Xhtml doctype I could find. I used their in-line css in the html file and placed the @font-face code there. I selected the tag for the text I wanted and inserted the font-family there. I used a free font that I knew was not on my system. For some reason it has to be OTF. I checked it to make sure it was working in firefox. I then used Calibre to convert it to an epub and installed it on my ereader. It worked perfectly!

I have explained what i did so that if anyone needs the info and does a search they will find it here.
Thanks,
Paul