11-08-2011, 11:52 AM | #1 |
Zealot
Posts: 134
Karma: 10
Join Date: Nov 2009
Location: Okotoks, AB, Canada
Device: iPad V-3
|
Embedded fonts
I would like to be able to insert hand writing like script output in an ePub file. I downloaded the free Elegant.ttf file. I added this to the Fonts directory of my ePub file. In my stylesheet.css I added the following code:
@font-face {font-family: "Elegant"; font-style: normal; font-weight: normal; src:url("Fonts/Elegant.ttf");} p.letter {font-family: "Elegant"; margin: 20px 40px 20px 40px; text-indent: 0; border: none; padding: 0px;} And then I created a test file with a <p class="letter">text text text</p> in it. It does not appear as script. It appears as the normal Sigil font. What have I done wrong? |
11-08-2011, 12:11 PM | #2 |
Enthusiast
Posts: 48
Karma: 1916
Join Date: Sep 2010
Device: Cybook Opus
|
Try it out (the resulting EPUB file, I mean) in ADE or another reading system (other than calibre's ebook-viewer), it's probably the known bug of QTWebKit (upon which Sigil and calibre both based their rendering system).
|
11-08-2011, 12:32 PM | #3 |
Zealot
Posts: 134
Karma: 10
Join Date: Nov 2009
Location: Okotoks, AB, Canada
Device: iPad V-3
|
I loaded the file onto my PRS-505 and got the same result as Sigil and E-book-reader. I guess I'm doing something really silly in here some place.
|
11-08-2011, 01:48 PM | #4 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Did you check the case? The stuff is case sensitive. Another thing that sometimes is forgotten, did you declare the stylesheet in your page?
|
11-08-2011, 02:20 PM | #5 |
Zealot
Posts: 134
Karma: 10
Join Date: Nov 2009
Location: Okotoks, AB, Canada
Device: iPad V-3
|
The name of the .ttf file is Elegant with a cap E. When I open the font in the font viewer (Kubuntu Linux) the title seems to be "Elegant, Thin". Do I need the ", Thin" part. I'll try it anyway. I have the link in the file to the .css. I've been caught by that in some other files.
Last edited by dicknskip; 11-08-2011 at 02:58 PM. Reason: WORKED: It was "Elegant, Thin" PS: the QTWebKit issue also gets you. I had to restart my system to see the correct font. |
11-08-2011, 04:58 PM | #6 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
|
11-08-2011, 05:19 PM | #7 |
Zealot
Posts: 128
Karma: 238654
Join Date: Aug 2009
Device: Kobo Mini (4GB), Nook Classic wi-fi, iPod Touch (Bluefire Reader)
|
+1 to changing to "../Fonts/Elegant.ttf", that's the format I use in my ePubs.
|
11-08-2011, 05:50 PM | #8 |
Zealot
Posts: 134
Karma: 10
Join Date: Nov 2009
Location: Okotoks, AB, Canada
Device: iPad V-3
|
I'll give the ../ prefix a try the next time I need a script font. It's not very often. Thanks
|
11-08-2011, 11:00 PM | #9 | |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
I'm glad you worked it out.
Next time you find the solution and edit a post to let us all know, as you did in post 5, update the actual post so folks can easily see that you found a solution. The small edit box is the reason for editing, not the actual edit. Something like the following: Quote:
|
|
11-10-2011, 01:25 PM | #10 |
Zealot
Posts: 134
Karma: 10
Join Date: Nov 2009
Location: Okotoks, AB, Canada
Device: iPad V-3
|
OK - I got this to work on Calibre's ebook-viewer and in Sigil. As soon as I move it through Calibre to my PRS-505 the script is gone and I get a serif font in very small type.
Here is the css code: @font-face {font-family: "Elegante, Regular"; font-style: normal; font-weight: normal; src:url("res:///Fonts/elegital.ttf");} I didn't like how light the other font was so I changed to Elegante. When I save the epub and then open it again in Sigil the res"///Fonts gets changed to ../Fonts The definition of class letter is: p.letter {font-family: "Elegante, Regular"; font-size:65%; line-height:225%; margin: 20px 40px 20px 40px; text-indent: 0; border: none; padding: 0px;} I have a couple of lines of text defined as <p class="letter">. In Sigil it is in Elegante script. In the ebook-viewer it is Elegante script. On the PRS-505 it is the default serif font, but very small, this is due to the font-size and line-height in the css. Can anyone see what I'm doing wrong here? |
11-10-2011, 04:30 PM | #11 |
Enthusiast
Posts: 30
Karma: 300
Join Date: Oct 2011
Location: Barcelona
Device: Sony PRS-650, PRS-T2
|
I think the problem is in the path. As other people mention above in the css code it should be written:
src:url(../Fonts/elegital.ttf); I use this in my PRS-650 for embedded fonts and it works fine. Alternatively, sometimes instead of embedding the fonts in the ePub file I create a folder called 'Fonts' in the root of the internal memory of the reader and save the fonts there. Then the syntax used in the css is: src: url(res:///Data/Fonts/elegital.ttf); And don't forget that css is case sensitive! I hope it will help. |
11-10-2011, 05:03 PM | #12 |
Enthusiast
Posts: 30
Karma: 300
Join Date: Oct 2011
Location: Barcelona
Device: Sony PRS-650, PRS-T2
|
If you want a more detailed info about working with fonts I found this pdf in the forum:
https://www.mobileread.com/forums/att...id=58204&d=... It has been really useful to me. And regarding the font size I can say that in my experience 65% looks really small in the reader. Even for notes I never use a size below 75%, most often something around 80-90%. |
11-11-2011, 07:21 AM | #13 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
As paragraph font size I always use 1em and use the sizing option of the reader if I want to have it bigger or smaller.
|
11-11-2011, 09:53 AM | #14 |
Zealot
Posts: 134
Karma: 10
Join Date: Nov 2009
Location: Okotoks, AB, Canada
Device: iPad V-3
|
I played with the font size like that because I found that the long risers and tails on the style overlapped from line to line. I did go a little far and will clean that up once I get the font to show on the reader. We have company for the next two days so I won't get back to fiddling with this until Sunday. Thanks for all the help so far.
|
11-11-2011, 03:59 PM | #15 |
Enthusiast
Posts: 30
Karma: 300
Join Date: Oct 2011
Location: Barcelona
Device: Sony PRS-650, PRS-T2
|
May be you can also try playing with the line-height, increasing it more, to avoid the overlapping.
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Embedded fonts? | Greenmantle | Kobo Reader | 66 | 07-27-2011 08:20 PM |
Embedded fonts not always visible | James_Wilde | ePub | 15 | 12-15-2010 12:19 PM |
Problem with embedded fonts | James_Wilde | ePub | 25 | 09-24-2010 04:07 PM |
Embedded fonts, Calibre, and choice of fonts | AlexBell | ePub | 8 | 05-30-2010 06:00 AM |
iPad Embedded Fonts | JSWolf | Apple Devices | 24 | 04-26-2010 02:41 PM |