View Full Version : How to embed fonts in epub file ?


banhgau
03-08-2012, 03:02 AM
Hi, everyone.
Now, I'm researching Sigil but I don't use HTML code.
I need embed fonts in epub file and I did as follow:

-I click right mouse on Fonts folder then choose Add existing file

http://nj3.upanh.com/b2.s16.d1/0c347d448f71af04382acd8a59ad06f1_41785663.20120308 144944.png

-But when I click "Validate epub", I received the notice from Sigil as image blow:

(http://www.upanh.com/2012-03-08_144944_upanh/v/bned7ncy6dd.htm)http://nj4.upanh.com/b4.s16.d1/0703d53ac5dd0641eedc4957f23bc58a_41785664.20120308 145035.png (http://www.upanh.com/2012-03-08_145035_upanh/v/5ne6bn7ybif.htm)

Plz point out if I have made any mistakes.
Thank you very very much.

huebi
03-08-2012, 03:56 AM
Well, nobody is using this font. You have to declare this font in the CSS stylesheet and then you need to assign the declared font to special rules.

Just by adding files the only effect you will get that the epub will will be larger.

banhgau
03-08-2012, 04:11 AM
Well, nobody is using this font. You have to declare this font in the CSS stylesheet and then you need to assign the declared font to special rules.

Just by adding files the only effect you will get that the epub will will be larger.

Oh, I only used that font as samples.

Can you show me how to declare that font in the CSS stylesheet ?

And I don't understand this sentences "you need to assign the declared font to special rules." Can you show me more details or give me a example ?

:thanks:

My English is not good :smack:

huebi
03-08-2012, 04:21 AM
As this has nothing to do with Sigil i would prefer to ask this in the epub forum. And there are some sticky threads, its a good idea to read them first before asking questions already answered.

Doitsu
03-08-2012, 04:57 AM
Some time ago I created a simple ePub template (http://www.mobileread.com/forums/showpost.php?p=1927237&postcount=13) with an embedded free font. Have a look at the style definitions, add you own font and simply change the font name references.

BTW, if your native language happens to be French, there's also a French subforum (http://www.mobileread.com/forums/forumdisplay.php?f=160).

Toxaris
03-08-2012, 10:47 AM
To be more specific, it is not possible in BookView. You must do it in CodeView.

HarryT
03-08-2012, 12:03 PM
Hi, everyone.
Now, I'm researching Sigil but I don't use HTML code.


You need to learn. You can't create ePub without a reasonable knowledge of HTML. ePub books are HTML.

It's not hard to learn.

mmat1
03-08-2012, 02:47 PM
Can you show me how to declare that font in the CSS stylesheet ?


There's a book here in MR: "Howard: Savage Stories", which gives you a good example, how to embed fonts.

My English is not good

For me it's next to perfection :)

banhgau
03-08-2012, 10:18 PM
Some time ago I created a simple ePub template (http://www.mobileread.com/forums/showpost.php?p=1927237&postcount=13) with an embedded free font. Have a look at the style definitions, add you own font and simply change the font name references.

BTW, if your native language happens to be French, there's also a French subforum (http://www.mobileread.com/forums/forumdisplay.php?f=160).

You need to learn. You can't create ePub without a reasonable knowledge of HTML. ePub books are HTML.

It's not hard to learn.

There's a book here in MR: "Howard: Savage Stories", which gives you a good example, how to embed fonts.

For me it's next to perfection :)

Thank you all so much. I will keep researching Sigil and HTML code, if I have another question, I will ask you later

roger64
03-11-2012, 07:55 PM
Hi,

I certainly will not deny the need to understand and practice html and css, if only because it's the stuff ebooks are made of.

You can however produce standard EPUBs and embed fonts using LibreOffice in a graphical way only.

You have to know how to use styles with this word-processor.
You will also need to be able to attach (still within LibreOffice) a very basic css style-sheet containing a @font-face declaration like this one, which even can be written for you by dedicated sites like FontSquirrel:

@font-face {
font-family: 'LinuxLibertineOCRegular';
src: url('linlibertine_c-4.0.4ro-webfont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}

Here is an exemple of one ebook of this kind, embedding the true smallcaps font quoted above. (http://www.mobileread.com/forums/showthread.php?p=1999604#post1999604) It has been realized using exclusively LibreOffice (and its W2X extension)

I would like this post not to be deemed as offensive on this particular forum, so I must add that Sigil is invaluable to check and edit your EPUB for whatever may go wrong and that I have been making use of it for a long time and still do.