![]() |
#1 |
Junior Member
![]() 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? |
![]() |
![]() |
![]() |
#2 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
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. |
![]() |
![]() |
![]() |
#3 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,597
Karma: 168431235
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, 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> |
![]() |
![]() |
![]() |
#4 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
Join Date: Nov 2009
Device: many
|
Quote:
|
|
![]() |
![]() |
![]() |
#5 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
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:
Quote:
- - - 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>
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> Code:
h1.invisible { display: none; } 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> Code:
h1.fancytitle { font-family: "Lucida Handwriting", cursive, sans-serif; } 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. |
|||
![]() |
![]() |
![]() |
#6 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,600
Karma: 9499994
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
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> |
|
![]() |
![]() |
![]() |
#7 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5703082
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. |
![]() |
![]() |
![]() |
#8 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,600
Karma: 9499994
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Thanks @KevinH, will do.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |