MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   Sigil 0.2.0 Embedding Fonts - Adding all the bits (https://www.mobileread.com/forums/showthread.php?t=77430)

ghostyjack 03-16-2010 03:59 PM

Sigil 0.2.0 Embedding Fonts - Adding all the bits
 
If I embed a font into an epub and put the @font-face declaration statement into the CSS file, will sigil 0.2.0 add all the rest of the bits when saving? i.e. adding to manifest, etc.

I'm not sure all the bits that need to be added or in which files they need to be added.

Valloric 03-16-2010 04:05 PM

Quote:

Originally Posted by ghostyjack (Post 832413)
If I embed a font into an epub and put the @font-face declaration statement into the CSS file, will sigil 0.2.0 add all the rest of the bits when saving? i.e. adding to manifest, etc.

Yes! :)

ghostyjack 03-16-2010 04:18 PM

:yahoo:

Fantastic!

I've been waiting for this to work as it's been pretty hit-and-miss for me in adding fonts and I've just been too lazy to ask on MR for help, now I don't have to.

Thanks Valoric, I know you've had a lot of praise for Sigil (I know as I've heap a little bit of that myself), but I can't thank you enough for it. As having an application that takes out all the work that would otherwise take quite some time to learn as a novice ebook maker means that I can make books that look good and still take my time to learn how this all works. I don't have to wait until I've gathered enough knowledge to hand-code them, I can just plough straight in.

Thanks again!

JaneFancher 04-07-2010 08:23 PM

Can I scream?

I'm really frustrated at the moment. I've been trying to get my ToC and embedded fonts to work. I can't figure how to import an html doc into sigil and have it recognize the internal TOC, so I made a Mobi file MobiCreator with a ToC pointer, brought that into Calibre to create the epub. Everything looks fine in the Calibre reader except no pretty fonts. So I then brought the Calibre generated epub file into Sigil to embed the fonts.

I copied the fonts into the font folder. I put in the @font code into the style sheet, and everything looks PERFECT in sigil. I save down, open the epub in the Calibre reader...and it's a mess. None of the special fonts are showing and the sizes on the rest have gone haywire.

Anyone have any idea what might be going on? I'm really ready to tear my hair out on this one. I'm SOOOOOO close!

Dellaster 04-07-2010 11:07 PM

Jane, it sounds like you're doing everything right so without looking at it there's no chance of determining what's wrong. There aren't, like, font declarations in the HTML as well as in the CSS are there?

As before, I'll take a look if you want me to. Maybe it just needs another pair of eyes.

Edit: I just sent you a nonsense-filled ePub with six different font embeddings. It works for me in EPUBReader (Firefox plugin), Adobe Digital Editions, Calibre, and Sigil. If it works for you as well, try to find what's different from yours. If mine doesn't work for you there's something fishy going on. ;)

Dellaster 04-07-2010 11:57 PM

On a whim I had Calibre convert that ePub into an ePub. Yikes! Not a pretty result. Methinks Calibre doesn't handle embedded fonts well.

Montyp535 04-08-2010 04:32 AM

with sigil you can create a real good epub - I don't need calibre for filling my reader - the font-thing is the next I will test...

JaneFancher 04-08-2010 12:35 PM

I LOVE SIGIL! Valloric, if you were within reach, I'd hug you. You, too, Dellaster! Virtual group hug!

The problem was definitely in the reader. I didn't realize MobiPocket would read Epub files. It's perfect there. And the Firefox reader does it perfectly. I don't know why they don't show in Calibre...other books that used the same coding show their embedded fonts...but that's okay.

I'm so HAP-PY! It means using four different programs...WordPerfect to Namo to MobiCreator to Calibre to Sigil, but despite all those translations, it looks to end up with some fairly pristine files.

You programmers are goooooood!

JaneFancher 04-08-2010 12:46 PM

Quote:

Originally Posted by Montyp535 (Post 862099)
with sigil you can create a real good epub - I don't need calibre for filling my reader - the font-thing is the next I will test...

The advantage for me of going through MobiCreator and Calibre is that it adds the cover as a cover rather than part of the main file, puts in the pointers for the internal ToC and breaks down the one huge file into several smaller files, which makes cleanup in Sigil much easier.

If I import the html directly into Sigil, it's one huge file and makes the poor program chug.

It sounds like a lot of steps, but it's a process my old brain understands. :D My total CSS programming experience probably amounts to... oh...four hours? Including analyzing other people's code. :rolleyes:

I've been writing html for decades, but only when I needed it. And I'm pretty quick to figure what code is doing...but figuring out just where to put things in CSS is...intrustin'. :chinscratch:

And since I'm trying to create a commercial product...I want to make something that all you guys aren't sneering at behind my back!!!! :eek:

Ah...pride...

Dellaster 04-08-2010 04:29 PM

Quote:

Originally Posted by JaneFancher (Post 862563)
The advantage for me of going through MobiCreator and Calibre is that it adds the cover as a cover rather than part of the main file, puts in the pointers for the internal ToC and breaks down the one huge file into several smaller files, which makes cleanup in Sigil much easier.

If I import the html directly into Sigil, it's one huge file and makes the poor program chug.

You'd have to put up with the chugging during the process, but Sigil does allow insertion of chapter breaks. Then you go Tools>Split On SGF Chapter Markers to break the file into pieces.

As to the cover, I actually prefer my ebooks to have it included on the first page. It's the only way to see it in its full size and beauty. The icon cover in an ebook reader is too tiny to appreciate. Yeah, it gets bigger in readers on the PC or Mac, but I don't often read at my desktop.

That said, an option in Sigil to set the cover image wouldn't be bad.

JaneFancher 04-08-2010 10:26 PM

Okay, all you smart people...there's still a problem with my fonts. I'm taking my html code into Calibre to create basic epub file. Nothing special done, just straight conversion, adding meta and cover. Looks good in Calibre, epub reader and MobiPocket. I bring that epub file up in Sigil and add the fonts and @font code as follows:


@namespace h "http://www.w3.org/1999/xhtml"; (first line in Style.css as constructed by Calibre)

@font-face {
font-family: "Vivaldi", cursive;
font-style: normal;
font-weight: normal;
src:url(../Fonts/Vivaldii.TTF) format(opentype);;
}

@font-face {
font-family: "Trajan Pro", serif;
font-style: normal;
font-weight: normal;
src:url(../Fonts/TrajanPro-Bold.otf) format(opentype);;
}

@font-face {
font-family: "HansonsHand", sans-serif;
font-style: normal;
font-weight: normal;
src:url(../Fonts/HANSON-H.TTF) format(opentype);;
}

@font-face {
font-family: "Schwarzwald", sans-serif;
font-style: normal;
font-weight: normal;
src:url(../Fonts/SCHWARZW.TTF) format(opentype);;
}

@font-face {
font-family: "BankGothic Md BT", sans-serif;
font-style: normal;
font-weight: normal;
src:url(../Fonts/BNKGOTHM.TTF) format(opentype);;
}

@font-face {
font-family: "Brush Script MT Italic", cursive;
font-style: normal;
font-weight: normal;
src:url(../Fonts/BRUSHSCI.TTF) format(opentype);;
}

Returning to Calibre code
.calibre {
display: block;
font-family: "Times New Roman", serif;
font-size: 1em;
font-style: normal;
font-weight: normal;
margin-bottom: 0;
margin-left: 5pt;
margin-right: 5pt;
margin-top: 0;
page-break-before: always;
text-align: justify
}

After the code is added, the file is imported back into Calibre and the default font is suddenly huge. Also, the special fonts don't show.

File looks good, proper default font with special fonts showing, in the other two readers I have.

Anybody?

Dellaster 04-08-2010 10:52 PM

Jane, see my email. If it's the same issue as the oddly-sized fonts in my dedicated readers we're talking about, the problem is with declaring Times New Roman when it's not embedded. My e-readers don't have that font so they freak out. ;)

JaneFancher 04-08-2010 11:42 PM

Quote:

Originally Posted by Dellaster (Post 863410)
Jane, see my email. If it's the same issue as the oddly-sized fonts in my dedicated readers we're talking about, the problem is with declaring Times New Roman when it's not embedded. My e-readers don't have that font so they freak out. ;)

Thanks! Weird.

I thought the reason everyone used TNR was because it was so universal.

But I'm still confused...I thought the reason you put the font=TNR, serif was to have it default to a serif font if TNR wasn't available.

I've tried putting in the changed, but the default font size/weight is still goofy in Calibre's reader.

This is so goofy.

Dellaster 04-08-2010 11:55 PM

Quote:

Originally Posted by JaneFancher (Post 863453)
But I'm still confused...I thought the reason you put the font=TNR, serif was to have it default to a serif font if TNR wasn't available.

I've tried putting in the changed, but the default font size/weight is still goofy in Calibre's reader.

This is so goofy.

I honestly don't know why it wouldn't ignore the TNR and go with serif like a normal browser. The default fonts in my Cybook and iRex are indeed serif. I do know that when I took out those TNR, serif, declarations the ebook no longer had any problems.

The Calibre and embedded fonts thing is probably a separate issue. I have no clue.

JaneFancher 04-09-2010 01:24 AM

Quote:

Originally Posted by Dellaster (Post 863466)
I honestly don't know why it wouldn't ignore the TNR and go with serif like a normal browser. The default fonts in my Cybook and iRex are indeed serif. I do know that when I took out those TNR, serif, declarations the ebook no longer had any problems.

The Calibre and embedded fonts thing is probably a separate issue. I have no clue.

I don't think so. I think maybe my initial wordperfect-generated html file is the culprit. I checked out that .calibre2 definition and the handful of paragraphs that were showing properly in calibre didn't have that style code. It was a silly reiteration of the TNR command...which then tried, I suspect, to override the "default" command.

WP's HTML has both the "default" command at the top [I]and[I] a line by line font style command. I don't know why it does that...I suspect it's related to its fonts on and off commands, but I'm betting that's the source of the calibre2 definition and the calibre2 definition is the source of the messed up fonts in your file.

Simply wiping the .calibre2 definition took care of the Calibre problem...on my computer which has TNR in it. I can certain take it out of the body definition as well, but I'm curious to see it it works with that TNR, serif command in there. So...I've sent you yet one more file, if'n ya don't mind taken a peek.


All times are GMT -4. The time now is 06:53 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.