09-12-2013, 11:05 AM | #1 |
Connoisseur
Posts: 86
Karma: 470352
Join Date: Dec 2012
Device: Kindle Fire, IPad
|
Adding a stylesheet in Sigil
Just want to make sure I get this right, I have a word doc which is made using two separate fonts. I already converted the .doc to html, opened in Sigil and realize that in order for the font to appear it needs to be added in the font folder and then create a separate css page to layout the tags.
But in the body of the html inside Sigil I see the the original definitions so how do I go about adding a css page which will have the font display in the tags irs supposed to? Do I leave the orginal text/css which is in the body of the html or remove it. if I remove I know I would have to re style the whole document. Any help? HI |
09-12-2013, 11:29 AM | #2 | |
Grand Sorcerer
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Adding a stylesheet is relatively easy. Right-click the Styles folder in the Book Browser and select Add blank stylesheet. Then select all styles in the .html file(s) and cut & paste them into the blank stylesheet. Then select your .html file(s) in the Book Browser, right-click them, select Link StyleSheets and tick the check box before your stylesheet. Font embedding is explained in the online help. |
|
Advert | |
|
09-12-2013, 12:12 PM | #3 |
Connoisseur
Posts: 86
Karma: 470352
Join Date: Dec 2012
Device: Kindle Fire, IPad
|
OK so if I decided NOT to add a separate stylesheet, how do I go about this? Do I just embed the font in the folder in Sigil and make sure the spelling is correct?
here is an excerpt of the sales from the html doc <div class="WordSection1"> <p align="center" class="FreeForm" style="text-align:center"><span style="font-size:18.0pt;font-family:"Times New Roman""> </span></p> <p align="center" class="FreeForm" style="text-align:center"><span style="font-size:18.0pt;font-family:"Times New Roman""> </span></p> <p align="center" class="FreeForm" style="text-align:center"><span style="font-size:18.0pt;font-family:"Times New Roman""> </span></p> <p align="center" class="FreeForm" style="text-align:center"><span style="font-size:64.0pt;font-family:"Comic Sans MS"">Math Problem Solving Menus</span></p> <p align="center" class="FreeForm" style="text-align:center"><span style="font-size:18.0pt;font-family:"Comic Sans MS""> </span></p> <p align="center" class="FreeForm" style="text-align:center"><span style="font-size:18.0pt;font-family:"Comic Sans MS""> </span></p> <p align="center" class="FreeForm" style="text-align:center"><span style="font-size:18.0pt;font-family:"Comic Sans MS""> </span></p> <p align="center" class="FreeForm" style="text-align:center"><span style="font-size:18.0pt;font-family:"Comic Sans MS""> </span></p> |
09-12-2013, 01:55 PM | #4 |
Well trained by Cats
Posts: 29,785
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Those are Licensed fonts. Embedding is expensive.
Since the Font Family names are pretty common, you could depend on the reading system to supply them All yo may need on the stylesheet, if you choose to a similar looking Open Sourced font is the @font lines declaration for each family that links the Family name to the font file you are using. I keep the following 'CSS clip' Code:
@font-face { font-family: "\1"; font-style: normal; font-weight: normal; src:url(../Fonts/\1.ttf); } You could leave the family name as 'Times New Roman' and link a different (Free) file to SUBSTITUTE that: @font-face { font-family: "Times New Roman"; font-style: normal; font-weight: normal; src:url(../Fonts/liberation.ttf); } << Just an example |
09-12-2013, 02:01 PM | #5 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
I would seriously clean that Word HTML mess up, this will cause issues for you in the end. Even filtered HTML is still full of reduntant and unnecessary code that will cause unexpected things in readers like fonts not scalable and other things.
|
Advert | |
|
09-12-2013, 02:45 PM | #6 |
Connoisseur
Posts: 86
Karma: 470352
Join Date: Dec 2012
Device: Kindle Fire, IPad
|
OK whats the best way to clean up the un needed code that word leaves?
|
09-12-2013, 03:45 PM | #7 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Try using the Atlantis Word Processor for any future writing which needs to be converted to EPUB, it's supposed to be VERY clean. It should also do a good job of cleaning up the code if you open an MSWord doc and resave with Atlantis -- how well this compares to MSWord's filtered html setting I haven't got a clue, because I basically know this from Google+MobileRead lurking, but it could be worth a try.
Or try using Open/LibreOffice, which tends to output cleaner code to begin with, and has the Writer2ePub extension, although I believe this achieves its wonders by ignoring tag soup and assuming there isn't fancy weird stuff in the document. Again, try opening, in LibreOffice this time, saving as a native .odt and then using the export tool. |
09-12-2013, 04:01 PM | #8 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
If you have a newer version of Word, you can use the tools listed under Toxaris' messages. They are Word macros, so he can help you out if you run into a problem. But they have been used extensively so I would expect they would do you well.
AWP works well and leaves you working in a word processor until the moment you export to epub. It takes a bit of getting used to but the learning curve is not bad. Unless you use the Comic Sans a lot, you might get by by making images of the items for which you use the Comic Sans. That way you don't get stuck with the vagaries of font embedding, which is something of a world unto itself. |
09-15-2013, 04:21 PM | #9 |
mostly an observer
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
Just to point out: any file with the extension *.css in the folder you're working in will be incorporated into the epub on the fly. One doesn't have to do anything to make that happen.
I clean up my Word 2000 docs by running them through word2cleanhtml.com online, adding a template and style sheet (see http://notjohnkdp.blogspot.com for examples). |
09-15-2013, 05:44 PM | #10 |
Grand Sorcerer
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
09-15-2013, 06:01 PM | #11 |
Well trained by Cats
Posts: 29,785
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Huh!
I can create all the stylesheets in the world and none of them will be used until I make a Link entry in the HTML file The easy way: Rightclick on the file(s) in the book browser: Link stylesheets (select) Note: any previous linked sheets references will be removed. process exceptions seperatly |
09-15-2013, 06:23 PM | #12 |
Grand Sorcerer
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Even if you're talking about importing or opening an (x)html file with Sigil, no css files in the same folder will be pulled in along with it if they're not properly linked in the file first.
(and in that case, any css file that is properly linked in the (x)html file will be incorporated into the epub--regardless of what folder it's in, but it all starts with proper linking) |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding photos to Sigil | Greg7976 | Sigil | 9 | 05-27-2013 09:11 AM |
Sigil not finding stylesheet | Alda | Sigil | 3 | 03-19-2013 10:46 AM |
Sigil Adding White Space? | beingnickb | Sigil | 20 | 07-31-2012 07:43 AM |
Sigil Automatically Adding Code | christinerose | Sigil | 7 | 04-28-2011 11:07 AM |
Adding Namespace to Stylesheet | ghostyjack | ePub | 0 | 12-07-2010 07:49 AM |