08-29-2010, 07:19 PM | #1 |
Zealot
Posts: 123
Karma: 496
Join Date: Feb 2009
Location: Spokane, Washington
Device: Kindle2
|
Are the SGC_# a sigil code?
I'm having just more fun than should be legal with embedded fonts. Have just discovered that some of my books show just fine in Adobe Digital Editions, and some don't. Have tracked one problem to the sgc_1 code in the paragraph's html style code.
Basically, I had a font type, font size, ital, and this sgc code all in one style call in the html. When I took out the ital and the sgc code, I got my font, if not in italics. I can't figure what these sgc codes refer to. Can any one here help? And can I safely delete them? Of course, one of the books that displays properly in ADE also has them. Go figure.... Thanks as always! |
08-29-2010, 10:01 PM | #2 | |
Well trained by Cats
Posts: 29,981
Karma: 56143930
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
In Code view, if you go near the top of the page: there is a style section (olive color), when you use one of the Sigil style buttons (Bold, underline, center) a Sigil code appears here (not always the same SGC code, page to page), you can replace SGC codes with your own styles, . Just read the SGC defined style and replace the usage you found with yours that does similar things.. |
|
Advert | |
|
08-30-2010, 09:07 AM | #3 | |
Wizard
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
|
Quote:
<p><i>Some italic text</i></p> becomes <p class="sgc-1">Some italic text</p> with p.sgc-1 {font-style:italic} in a style item in the header. I think Valloric has said he'll add an option to turn this off in a future version, but for now the way to avoid it is to use <p><em>Some italic text</em</p> instead, which is better usage anyway. |
|
08-30-2010, 01:13 PM | #4 |
Connoisseur
Posts: 87
Karma: 204
Join Date: Dec 2007
Location: Exeter, Devon, UK
Device: PRS-300
|
I don't think it is - is one of the few times the <em> tag is correctly used. The majority of times you actually want <i>, e.g. titles of works, names of ships, foreign words, character thoughts and many others.
|
08-30-2010, 02:13 PM | #5 |
Wizard
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
|
No, The whole point of html/css is that the presentational aspects are separated from the semantic. <em> indicates empahsis, which may be conveyed in different ways in different situations, eg if someone with impaired vision uses a text-to-speech system to read your book. If you want to italicise text for purely visual reasons you should be using css to do it, the <i> tag is retained purely because it's still so commonly used.
|
Advert | |
|
08-30-2010, 05:02 PM | #6 |
Not who you think I am...
Posts: 374
Karma: 30283
Join Date: Jan 2010
Location: Honolulu
Device: PocketBook 360 -- Ivory
|
<em class="text_emphasis">
<em class="ship_name"> <em class="title_of_work"> And so on. Lot of work, but it will let you distinguish how you want them to look: small caps, italics, font, etc. Just don't overuse <span>s, that's nearly as bad as overusing <div>s. |
09-03-2010, 05:07 PM | #7 |
Zealot
Posts: 123
Karma: 496
Join Date: Feb 2009
Location: Spokane, Washington
Device: Kindle2
|
Thanks everyone!
Interesting input. I kinda forgot about this because I figured it out. Pretty obvious what it was for when I actually LOOKED at the file. What remains strange to me is that it only put it in in a handful of places, when there were lots of italics throughout the (very long) book. Calibre, which created the epub file, had translated all the <i> code to a css code and that was present in all the instances where I used ital, including the handful that sigil inserted it's ital into. I'm sure there's a pattern, but I'm not going to bother to find it. I just took out the redundant code. Thanks again. |
09-03-2010, 05:17 PM | #8 |
Zealot
Posts: 123
Karma: 496
Join Date: Feb 2009
Location: Spokane, Washington
Device: Kindle2
|
Oh...I actually have another question now on the same subject. If the idea is to use <em> for emphasis and to keep it out of the CSS...what is the alternative for bold <b>?
Thanks! |
09-03-2010, 05:28 PM | #9 |
Not who you think I am...
Posts: 374
Karma: 30283
Join Date: Jan 2010
Location: Honolulu
Device: PocketBook 360 -- Ivory
|
<strong>
|
09-03-2010, 08:21 PM | #10 |
Bookmaker & Cat Slave
Posts: 11,466
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
|
09-03-2010, 11:10 PM | #11 | |
Well trained by Cats
Posts: 29,981
Karma: 56143930
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
2) You can have/use more than one CSS at a time 3) You can add (file) local styles in the same place that Sigil puts theirs between the <style type="text/css"> </style>, just take care to be unique. |
|
09-04-2010, 02:05 AM | #12 |
Not who you think I am...
Posts: 374
Karma: 30283
Join Date: Jan 2010
Location: Honolulu
Device: PocketBook 360 -- Ivory
|
|
09-04-2010, 05:37 AM | #13 |
Bookmaker & Cat Slave
Posts: 11,466
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
|
09-04-2010, 12:48 PM | #14 |
Not who you think I am...
Posts: 374
Karma: 30283
Join Date: Jan 2010
Location: Honolulu
Device: PocketBook 360 -- Ivory
|
<talldarkandhandsome>
|
09-06-2010, 04:08 AM | #15 |
Bookmaker & Cat Slave
Posts: 11,466
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
<hunkahunkaburninlove>
|
Tags |
adobe digital editions, disappearing fonts, embedded fonts, sgc code |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sigil 0.2.4 | Valloric | Sigil | 16 | 09-09-2010 11:04 AM |
Let's create a source code repository for DR 800 related code? | jraf | iRex | 3 | 03-11-2010 12:26 PM |
sigil 0.2.0 | bobcdy | Sigil | 16 | 03-09-2010 08:31 AM |
When do we get Sigil v0.2.0??? | delphidb96 | Sigil | 0 | 10-08-2009 04:24 PM |
Sigil 0.1.1 | Valloric | Sigil | 29 | 08-08-2009 02:16 PM |