Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 01-12-2022, 07:01 AM   #1
Kabukikaiser
Junior Member
Kabukikaiser began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jan 2022
Device: Kindle Paperwhite
How to generate a Nav or TOC w/Pictures

Hello,

So, I am using pictures for my chapter titles in order to use a fancy font and, of course, the TOC generator doesn't recognize them except as empty text when I use <h1></h1> to tag them, which leaves me with a TOC of empty texts.

I don't think I have another choice but to fiddle with the .ncx file so that the chapter titles show instead of nothing... Do you know how to do this or can you think of another solution?
Kabukikaiser is offline   Reply With Quote
Old 01-12-2022, 07:50 AM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,627
Karma: 5433388
Join Date: Nov 2009
Device: many
Yes, embed the fancy font and replace the images with text so that your toc is accessible to those who are visually impaired and need screen reading software.

Alternatively, add a title attribute to each heading tag in text which the toc generation software will give precedence to and still be accessible.
KevinH is offline   Reply With Quote
Old 01-12-2022, 11:50 AM   #3
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,280
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Personally, if you must use images, I would add a title="text" and alt="text". Something like the below:
Code:
<h3 class="center" title="Chapter 6"><img alt="Chapter 6" class="imgw61" src="../Images/chapter_06.jpg"/></h3>
The title will be used to generate the ToC entry while the alt will allow a screen reader to say chapter 6.
DNSB is offline   Reply With Quote
Old 01-12-2022, 12:50 PM   #4
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,627
Karma: 5433388
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by DNSB View Post
Personally, if you must use images, I would add a title="text" and alt="text". Something like the below:
Code:
<h3 class="center" title="Chapter 6"><img alt="Chapter 6" class="imgw61" src="../Images/chapter_06.jpg"/></h3>
The title will be used to generate the ToC entry while the alt will allow a screen reader to say chapter 6.
Good point! I forgot about alt of images being needed as well.
KevinH is offline   Reply With Quote
Old 01-13-2022, 11:17 PM   #5
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Kabukikaiser View Post
So, I am using pictures for my chapter titles in order to use a fancy font and, [...]
Bad idea.

This has been discussed quite a few times over the years. Here's some of the more recent threads:

And why are images-of-text bad?

In the 2018 post I link to in that 2nd response:

Quote:
Originally Posted by Tex2002ans View Post
The gist is that images of text are:
  • Not Accessible
    • Not readable by TTS
    • Not copy/pastable
    • Not able to be looking up by dictionary (Greek->English one)
  • Don't follow user preferences
    • Color, font, font size, [...]
Quote:
Originally Posted by Kabukikaiser View Post
of course, the TOC generator doesn't recognize them except as empty text when I use <h1></h1> to tag them, which leaves me with a TOC of empty texts.
There are a few ways to do this:

- - -

Method 1. Like DNSB said, using title="" is how you manually override what appears in Sigil's TOC generator:

Code:
<h1 title="1. The Beginning">Chapter 1: The Beginning</h1>
Would appear as:
  • 1. The Beginning
    • In the TOC + after Tools > Table of Contents > Generate Table of Contents.
  • Chapter 1: The Beginning
    • In the text itself.

Method 2 (Strongly recommend against). There are ways to "hide" an <h1> using CSS's display: none:

HTML:

Code:
<div class="chaptertitle">[[[Your image code here]]]</div>

<h1 class="invisible">Chapter 1: The Beginning</h1>
CSS:

Code:
 h1.invisible {
	display: none;
}
but this has the potential to break in many readers.

Method 3. Like KevinH said, embed+subset a "fancy font" and use it only for your chapter titles:

HTML:

Code:
<h1 class="fancytitle">Chapter 1: The Beginning</h1>
CSS:

Code:
h1.fancytitle {
	font-family: "Lucida Handwriting", cursive, sans-serif;
}
For info on how to do that, see my mini-tutorial I wrote for embedding Japanese fonts. (Instead of <span class="japanese">, you'll be using <h1 class="fancytitle">. You can then follow Steps 4+.)

For more info on "embedded font" issues (licensing, "Publisher Fonts" setting, etc.), see discussion in this recent thread: "ePub chinese fonts".

- - -

All methods (and pros/cons) were discussed in detail in those linked threads.

I completely recommend against using "chapter heading as images" though.

Last edited by Tex2002ans; 01-13-2022 at 11:29 PM.
Tex2002ans is offline   Reply With Quote
Old 02-07-2022, 02:57 AM   #6
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,088
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by Tex2002ans View Post
Method 1. Like DNSB said, using title="" is how you manually override what appears in Sigil's TOC generator:

Code:
<h1 title="1. The Beginning">Chapter 1: The Beginning</h1>
I have tried to use this in Calibre editor for epub v2 and it does not work for me. Is this a Sigil only function and not standard html/css, or maybe epub v3 only?

I currently use the following, but thought the above might be simpler, if I could get it to work.

Code:
<p class="chapterh3">Chapter 1</p>
<h3><span class="hide">1 - </span>The Casimir Engine</h3>
Karellen is offline   Reply With Quote
Old 02-07-2022, 09:10 AM   #7
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,627
Karma: 5433388
Join Date: Nov 2009
Device: many
Perfectly standard xhtml. Calibre just uses some other way to build ToC entries.
You should really ask in the calibre forums about how they generate ToC entries.
KevinH is offline   Reply With Quote
Old 02-07-2022, 01:50 PM   #8
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,088
Karma: 4911876
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Thanks @KevinH, will do.
Karellen is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
using nav.xhtml for TOC hobnail Sigil 40 11-12-2021 02:00 PM
Can nav be a TOC? AlanHK ePub 4 02-25-2020 02:41 PM
Link to nav.xhtml in TOC cges30901 Sigil 11 01-22-2020 12:01 PM
TOC nav.xhtml issue ebookscovers Conversion 1 05-06-2017 11:12 AM
ToC help needed: nav.xhtml Phssthpok Editor 10 04-14-2017 04:58 AM


All times are GMT -4. The time now is 01:38 AM.


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