![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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);
}
Code:
@font-face { font-family: "Courier"; font-style: normal; font-weight: normal; src: url(Fonts/cour.ttf); } 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. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
|
|
![]() |
![]() |
![]() |
#4 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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…
|
![]() |
![]() |
![]() |
#5 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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... |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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!!!
![]() |
![]() |
![]() |
![]() |
#7 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#8 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#9 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |