Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 04-09-2010, 12:55 AM   #16
Dellaster
本の虫
Dellaster has a complete set of Star Wars action figures.Dellaster has a complete set of Star Wars action figures.Dellaster has a complete set of Star Wars action figures.Dellaster has a complete set of Star Wars action figures.
 
Dellaster's Avatar
 
Posts: 242
Karma: 344
Join Date: May 2008
Location: USA
Device: Kindle3, DXG, Fire · iPad, iPod
For the benefit of curious bystanders, the calibre2 TNR removal fixed text display in my iRex, but not in my Cybook Gen3. Removing all references in the CSS to Times New Roman does solve it.

You know, I definitely know a lot less about this stuff than I thought I did. Dumber every day, that's my motto.

Last edited by Dellaster; 04-09-2010 at 01:12 AM. Reason: Decided not to include the photo for now
Dellaster is offline   Reply With Quote
Old 08-18-2010, 06:25 AM   #17
pixiesteps
Junior Member
pixiesteps began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Aug 2010
Device: iphone/ipad
Fonts in sigil

Hi guys

I have been trying to add fonts to my epub file in sigil, however with no programming background I have no idea how to do this, and when I right click on the font file and select add file, go to select the font, nothing happens. Can someone please feel sorry for me and help me out. Please!!

Thanking you ahead

Pixie

Last edited by pixiesteps; 08-19-2010 at 11:55 PM.
pixiesteps is offline   Reply With Quote
Advert
Old 08-20-2010, 01:55 AM   #18
JaneFancher
Zealot
JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.JaneFancher has a complete set of Star Wars action figures.
 
JaneFancher's Avatar
 
Posts: 123
Karma: 496
Join Date: Feb 2009
Location: Spokane, Washington
Device: Kindle2
Full sympathy!

Basically, you'll have to take a quick course in programming to do it, but only in the code for fonts. It's not hard...just be aware that every letter, comma and colon is significant.

Are you dealing with an epub file with a separate style.CSS file? (In Sigil, this will appear in the folder "style" right under the "html" folder and above the "fonts" folder.)

Personally, I take a really clean html file, complete with fonts, into Calibre and let it make the epub file. It creates a nice style.css file with all the font calls identified. Once you have that, open it in Sigil and find those "calls" in the style.css file. When you put your code into the very top of the Style.css file, you'll have to use exactly the same language (font name and generic name) as appears in those "calls".

You might have to copy your fonts into a folder other than your windows "fonts" folder, then add those fonts to the epub font folder by right clicking on the folder.

Check out the code in my post #11 of this thread. That @font code (modified for your fonts natch) goes right at the top of the style.css file, just under that first line as shows in the post...or something very similar, and just before the first style code (in the case of a Calibre-generated epub, that will be the .calibre paragraph)

You need to make sure to give a "generic" font type (serif, sans-serif) along with the special font in case the reader doesn't support the embedded fonts.

(Note: The .calibre# numbers are generated by calibre as it encounters new stylistic forms. The cleaner and more consistent your html file, the fewer of these .calibre# codes and so the shorter your style.css file. Basically what you're doing with that @font command is telling the files where to find the font in question when the .calibre# style code calls for it.)

Make sure you spell the name of the font exactly as it appears in the .calibre code and the font file exactly as it appears in the fonts folder, caps matter. Oh...and take out any spaces in the file name, as I recall.

Hope this helps. It can be very futsy and until you get it just right, it won't show in the file.

Oh...and if you're making files to sell, you've got to be very careful about what fonts you use. Fonts can't be copyrighted, but the digitalization of them can be. You need to search around for fonts that allow for distribution.

Good luck!

Last edited by JaneFancher; 08-20-2010 at 01:57 AM.
JaneFancher is offline   Reply With Quote
Old 05-11-2011, 07:02 PM   #19
noteon
Connoisseur
noteon is on a distinguished road
 
Posts: 55
Karma: 54
Join Date: Apr 2011
Location: NYC
Device: Many
Quote:
Originally Posted by Valloric View Post
Yes!
Then I'm doing something wrong, and I CAN'T FIGURE OUT WHAT!

I added fonts (Old Standard), declared them in template.css (correctly, I hope), and (1) everything's still rendering in generic serif, and (2) I don't see anything about Old Standard in the manifest. Do I need to unzip the .opf, open in Text Wrangler, and declare Old Standard in the manifest that way?

Thanks for any advice. I've been searching and experimenting for a couple of hours like a responsible newbie, and I just can't get it working.

noteon is offline   Reply With Quote
Old 05-11-2011, 07:16 PM   #20
noteon
Connoisseur
noteon is on a distinguished road
 
Posts: 55
Karma: 54
Join Date: Apr 2011
Location: NYC
Device: Many
Well, this is embarrassing, but apparently quitting and reopening Sigil did it. I'm going to blame some oddness in my system.

<gildaradner>Never mind...</gildaradner>
noteon is offline   Reply With Quote
Advert
Old 05-12-2011, 01:11 AM   #21
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
i though that e-readers each had their own proprietary font sets ( unless hacked) and would substitute their own fonts for any explicit assignments that you make - so why do this embedded fonts trick at all ?
I am sure that is how my Sony PRS650 works.

Also, I have taken to adding the line
font-family: "Times New Roman", serif;
to CSS, to improve how sigil's book view looks.

Adding that line has no effect on what i see on Sony - it certainly does not cause my reader to "freak out"!
cybmole is offline   Reply With Quote
Old 05-12-2011, 05:30 AM   #22
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by cybmole View Post
i though that e-readers each had their own proprietary font sets ( unless hacked) and would substitute their own fonts for any explicit assignments that you make - so why do this embedded fonts trick at all ?
I am sure that is how my Sony PRS650 works.
It shouldn't. If you don't specify a specific font, the reader will use its own fonts. However, you can use a specific font if you want and the readers should honor this. It is sometimes used for chapters. My PRS-300 does honor it.
For some readers the fonts cannot be hacked and this is the only way. Also, sometimes you only want a part in a different font (chaptertitles, notes, letters, etc).
When possible, I avoid using fonts. On much readers is it more of a hit-and-miss.
Toxaris is offline   Reply With Quote
Old 05-12-2011, 08:46 AM   #23
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
interesting. so in theory, the device firmware is able to work with ANY font so long as it is correctly specified AND embedded, & the firmware will still know how to justify, reflow etc.
the font has to be .ttf though, yes?
and if you go crazy & want dozens of fonts ( which all have to be in reader RAM ?) then you'll hit memory limitations ?

& if you specify, but do not embed, then the reader will decide what to use ?

the reader must still make some arbitrary decisions though e.g. sony has 6 size settings, XS, S, M , L XL & XXL, so it has to overlay an interpretation of what those will mean ?
cybmole is offline   Reply With Quote
Old 05-13-2011, 02:25 AM   #24
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
If the supplied font is in the right format and embedded correctly then yes. It depends on the implementation of the reader of course what the correct method of embedding is and whether it supports it at all.
However, if your reader has enough memory you could use as much fonts as you would like (separate from legal issues of course). I doubt that reading the book is pleasurable or fast though. Since the font is embedded in the epub, it will only be read/used when the book is openend. I think it will open the font only when used, but I am not sure.

If you specify a font family or type which the reader does not have and is not included in the epub, the reader will decide. Usually readers will use 2 fonts for that, serif and non-serif. However, the epub must still validate of course.

The font size depends on the reader. Some have only 3 sizes (like my PRS-300). That is the reason why a lot of epub-creators use em as size measure instead of pt. In this case 1 em is the default font size of the reader. In the PRS-300 case that is the setting on S and the letters are about 3-4 mm I think. It could happen that if you specify the font in pt or px that sizing the font will no longer work. Could be nice for chapter headings (stress could), but in general I think that is a pain in the a*s.
Toxaris is offline   Reply With Quote
Old 05-13-2011, 06:50 AM   #25
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
its handy to know that sony default size (S) is that same as font-size 1em

assuming it's the same for all sony readers.

that's a useful reference point. pretty much all CSS that have inspected use ems for font size sizing.
cybmole is offline   Reply With Quote
Old 05-13-2011, 06:59 AM   #26
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: 7,522
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by cybmole View Post
its handy to know that sony default size (S) is that same as font-size 1em
Hmm... "font-size: 1em" actually means "scale the font such that 1em is as long as 1em of the current font", or, in other words, do nothing. It's the same as "font-size: 100%".

If you set a relative font size like "font-size: 1.5em" or "font-size: 150%", it will grow or sink as you change the font size in your reader. If you set an absolute font size like "font-size: 12pt", it will stay fixed (unless the reader has some way of overriding this)
Jellby is offline   Reply With Quote
Old 05-13-2011, 07:02 AM   #27
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Thanks for the update Jellby, that is better info than I had. Since my reader usually starts at size S I assumed that this was the same as 1em. Always great to learn.
Toxaris is offline   Reply With Quote
Old 05-13-2011, 08:11 AM   #28
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
does line -height also default to 1em?

i oftern see 1.2 em in CSS but have not messed with that to date

I also see font sizes with about 6 decimal places - suspect that is a side effect of conversions from word or from PDF
e.g.
font-size: 1.29167em; font-size: 1.41667em;
cybmole is offline   Reply With Quote
Old 05-13-2011, 10:06 PM   #29
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by cybmole View Post
does line -height also default to 1em?

i oftern see 1.2 em in CSS but have not messed with that to date
I don't believe so, I have a feeling it needs to be set differently for each different font face. I also assumed "normal" line-height would be 1em but when I created an epub with the Charis font and explicitly set line-height to 1em it looked horribly squashed. It worked best for me if I completely removed the line-height attribute. If I remember correctly, with Charis, it seemed like removing it was probably equivalent to having explicitly set it at 1.15em. A lot of retail epubs, which embed Charis, use the 1.2em setting you mentioned. I suppose what looks "correct" is very subjective though because 1.2em looks too wide to me.

Quote:
Originally Posted by cybmole View Post
I also see font sizes with about 6 decimal places - suspect that is a side effect of conversions from word or from PDF
e.g.
font-size: 1.29167em; font-size: 1.41667em;
This usually means it's been converted by Calibre. Font sizing is a bit complex in Calibre but all its font scaling seems to use pts as input and ems as output. If your source is 12pt and you convert in Calibre with base font-size set to 12pt then you end up with an epub whose main body text has font-size 1em. Thus 1.29167em is 15.5pt and 1.41667em is 17pt. This probably means 15.5pt and 17pt formed part of the Calibre Convert - Look&Feel - Font-size key string when the epub was created.

I've probably made that clear as mud
jackie_w is offline   Reply With Quote
Old 05-14-2011, 12:53 AM   #30
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by jackie_w View Post


This usually means it's been converted by Calibre. Font sizing is a bit complex in Calibre but all its font scaling seems to use pts as input and ems as output. If your source is 12pt and you convert in Calibre with base font-size set to 12pt then you end up with an epub whose main body text has font-size 1em. Thus 1.29167em is 15.5pt and 1.41667em is 17pt. This probably means 15.5pt and 17pt formed part of the Calibre Convert - Look&Feel - Font-size key string when the epub was created.

I've probably made that clear as mud
NOT at all - I figured that fractions weer being converted somewhere to create those weird decimals, but did not guess 17/12 or 15.5/12. I leave the calibre font size key string on default, but tweak most large values down a little in css, if they look overpowering on Sony.
cybmole is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Embedding fonts with Sigil? MacEachaidh Sigil 4 08-20-2010 07:16 AM
Embedding fonts JaneFancher Calibre 14 04-10-2010 09:28 PM
Embedding fonts with Sigil and Calibre JaneFancher Calibre 1 04-09-2010 12:35 AM
Embedding fonts AprilHare ePub 6 01-02-2010 11:42 AM
Embedding fonts jash Calibre 2 09-09-2008 05:05 PM


All times are GMT -4. The time now is 11:37 PM.


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