Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 05-13-2025, 04:52 AM   #1
ElMiko
Addict
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 398
Karma: 65460
Join Date: Jun 2011
Device: Kindle
Font embedding path irregularities

Historically, I've used the following font-face styling in the css file:

Code:
@font-face {
	font-family: "Courier";
	font-style: normal;
	font-weight: normal;
	src: url(../Fonts/cour.ttf);
	}
But in Sigil 2.4.2. it seems that it sometime won't render correctly unless I change it to:

Code:
@font-face {
	font-family: "Courier";
	font-style: normal;
	font-weight: normal;
	src: url(Fonts/cour.ttf);
	}
... but other times it only works with the leading "../"!

Does anyone know what's going on here? I also haven't been able to discern any pattern when one path is needed over the other.
ElMiko is offline   Reply With Quote
Old 05-13-2025, 06:15 AM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,386
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Are these with preexisting epubs, or are they built from scratch? If the former, the easiest explanation for the difference is that the paths to the font files ARE actually different. Remember that Sigil no longer automatically restructures epubs to its older mandated layout.

The Book Browser tree is a logical one based on media types, and not a physical folder structure. So unless you're manually running "Restructure epub to Sigil Norm", the underlying paths could be different than what ../Fonts expects. Hold your mouse over resources in the Book Browser and the tooltip will show you the physical path to the resource within the archive. There's also a preference setting to show the full path in Book Browser.

Conversely: if you always run the "Restructure EPUB..." tool before adding embedded font css, then the ../Fonts path should always work.

Last edited by DiapDealer; 05-13-2025 at 06:22 AM.
DiapDealer is offline   Reply With Quote
Advert
Old 05-13-2025, 06:22 AM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,321
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
The old Sigil would automatically force a restructuring of the file system to keep everything in a standard location. There were some reasons why you might want to keep it the way it was originally put together…. So, the Sigil default now is to leave the file structure as it is.

You can, however, make it go to the Sigil standard by clicking on the tools menu and then “restructure epub to Sigil norm”.

Quote:
Restructure Epub to Sigil Norm: Starting with Sigil 1.0.0, EPUBs loaded into Sigil are kept “as-is”; no files or folders are moved or renamed. This is a departure from Sigil 0.9.18 and earlier, which automatically restructured each EPUB into a standard Sigil form (one OEBPS folder, specific names for the OPF and NCX, only one folder for text, images, etc.). Users who prefer the standard Sigil form may use Restructure Epub to Sigil Norm to manually restructure their EPUB to the old Sigil standard.
I almost always do this… and then you can use the “../Fonts”… otherwise you need to use the actual path to the files. You can see that path if you hover over the file in question, or go to preferences and select to always see the full path.
Turtle91 is offline   Reply With Quote
Old 05-13-2025, 06:24 AM   #4
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,321
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Ugh… ninja’d again…
Turtle91 is offline   Reply With Quote
Old 05-13-2025, 06:26 AM   #5
ElMiko
Addict
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 398
Karma: 65460
Join Date: Jun 2011
Device: Kindle
@DiapDealer - built from scratch-ish. They're usually epubs converted from html. But the epub file that I'm working in doesn't come with any embedded fonts; I'm adding them (and the styling) myself.

Ahhh... that might be it. The older files were automatically restructured, so when I try to go back and modify them, they aren't structured the same as a default calibre conversion... Whereas the new files (sans "../") are using the default calibre structure.

Is that right, do you think?

EDIT: Well, if it makes you feel better, Turtle91, your ninja'd post ninja'd me...
ElMiko is offline   Reply With Quote
Advert
Old 05-13-2025, 06:38 AM   #6
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,321
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
I at least feel better that my answer was pretty close to Diap’s - it makes me feel a little smarter!!!
Turtle91 is offline   Reply With Quote
Old 05-13-2025, 06:47 AM   #7
ElMiko
Addict
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 398
Karma: 65460
Join Date: Jun 2011
Device: Kindle
So, to confirm, whatever file path "works" in Sigil is actually correct. I don't have to go back and change old epubs to the new path, nor vice versa.

And going forward, as long as I use the "Restructure" option, I can go back to using the "standard" "../" path.
ElMiko is offline   Reply With Quote
Old 05-13-2025, 07:01 AM   #8
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,321
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Yes.

Just remember to do the restructure at the very beginning of your editing - if you choose to do it. If you add default css files or images that have the “../“ reference AND THEN do the restructure you could have “../../“ show up… which can be difficult to troubleshoot. I don’t know if that qualifies as a bug, it isn’t too difficult to fix once you are aware of it.
Turtle91 is offline   Reply With Quote
Old 05-13-2025, 09:36 AM   #9
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: 8,503
Karma: 5703586
Join Date: Nov 2009
Device: many
Yes, hand inputing incorrect paths will confuse the updating process. But if was broken beforehand it will not be magically fixed.

I always turn on showing full paths in BookBrowser as I like to hand input my paths and I need to understand where files really are.

I thought there was also a plugin that handled embedding fonts?

Update: There is ...

See Doitsu's CSSFromFonts plugin here:

https://www.mobileread.com/forums/sh...0&postcount=17


And since plugins may be new to you, here is the link for plugins for Sigil that are freely available:

https://www.mobileread.com/forums/sh...d.php?t=247431

Last edited by KevinH; 05-13-2025 at 11:16 AM.
KevinH is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Troubleshooting Embedding font breaks font-family? Calan Amazon Kindle 1 06-13-2020 11:48 AM
PRS-350 About the epub custom font path And how to know the path? 52manhua Sony Reader Dev Corner 6 12-20-2013 01:28 AM
Embedding font in books that already have embedded font Barty Calibre 2 10-16-2013 11:38 PM
Do I need a font license if all I'm doing is referring to the font (not embedding)? Stodder Workshop 21 04-21-2011 04:19 AM
Help: Font Sizing Irregularities wolfdown Amazon Kindle 4 09-24-2010 08:01 PM


All times are GMT -4. The time now is 01:34 PM.


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