MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   Vanity fonts (https://www.mobileread.com/forums/showthread.php?t=339418)

mt.msla 05-14-2021 11:04 PM

Vanity fonts
 
Hello. Admittedly, this is my first time using Sigil to create an epub, so if I'm doing it wrong, please let me know.

I've declared a specialty font for use in my epub (Belgrano). Long story short, if the font is not installed in my pc, even though Sigil css is declared and used properly, Belgrano is not displayed in the preview window in Sigil.

I had to install the font on my laptop to view it in the preview window of Sigil. Belgrano was already installed on my desktop and thus rendered properly there.

I doubt this is a big deal, because to my (very limited) knowledge, it really doesn't matter what font I prefer / declare, because at end-stage, whatever epub reader the user is using does it's own thing anyway, right?

Was this a big waste of time? Possibly. But let me know? And otherwise, 'Hello world!' :hatsoff:

- Andy

DNSB 05-14-2021 11:12 PM

Generally, If I really want to use a specific font in an ebook, I add it as an embedded font. Otherwise, no guarantee as to what font will be used when the font I want to use is not present on the device I'm reading on.

Doitsu 05-15-2021 01:22 AM

Quote:

Originally Posted by mt.msla (Post 4121614)
I've declared a specialty font for use in my epub (Belgrano). Long story short, if the font is not installed in my pc, even though Sigil css is declared and used properly, Belgrano is not displayed in the preview window in Sigil.

Since it's your first ebook, there's most likely a typo in your CSS file, because Sigil will show embedded fonts in the Preview window, even if they're not installed on a machine.
For an example, have a look at this book with an embedded blackletter font.
You also might find my CSSFromFonts plugin helpful, which'll add a font declaration to your CSS file.

DiapDealer 05-15-2021 11:36 AM

We recently fixed a bug that prevented previewing embedded fonts in a resource tab whenever the path to Sigil's temp directory contained a space, but that didn't effect properly embedded fonts from rendering in the Preview widget. If it's not down to a css syntax or path error, it's typically down to problematic fonts whenever they won't render in a browser (like QtWebEngine or QtWebkit). There's a lot of terrible font files floating around out there. But if it renders when it's installed as a system font, that's usually a dead giveaway that it's just not being embedded in the epub correctly.

hobnail 05-15-2021 02:57 PM

1 Attachment(s)
Did you add the font to the EPUB? It goes in the Fonts folder, highlighted in the image below.

Attachment 187152

hobnail 05-15-2021 03:06 PM

Adding to my response above, I used my own font long ago (no idea if this is still the proper way); here's the css:


Code:

@font-face {
    font-family: ChunkFivePrint;
    font-style: normal;
    font-weight: normal;
    src:url(../Fonts/ChunkFivePrint.otf);
}

.chunk {
    font-family: "ChunkFivePrint", sans-serif;
}


DNSB 05-15-2021 04:16 PM

You can also consider using Doitsu's CSSFromFonts plugin to somewhat automate creating the CSS for embedded fonts.

mt.msla 05-16-2021 02:41 AM

Thanks all for the input. Problem solved!

Notjohn 05-20-2021 11:48 AM

I prefer not to encounter the problem. 1) you must have the legal right to distribute the fonts, 2) you must have the knowledge to embed them, 3) you have to hope that Amazon doesn't rip them out (as it sometimes does, assuming your mean to publish through KDP), and 4) your idea of great typeface may offend the reader who prefers his/her/its own great typeface, and who gives you a one-star review in consequence.

Besides, ARA General Belgrano sank with great loss of life in 1982.

Calenorn 05-20-2021 12:30 PM

Quote:

Originally Posted by Notjohn (Post 4123251)
4) your idea of great typeface may offend the reader who prefers his/her/its own great typeface, and who gives you a one-star review in consequence.

Specifying the font might make sense for presentation on a website, but when ereaders give the user a choice of fonts, why fight against that? Also, what looks good on a website might not impress on a 6-inch eink screen.

hobnail 05-20-2021 01:25 PM

Quote:

Originally Posted by Notjohn (Post 4123251)
I prefer not to encounter the problem. 1) you must have the legal right to distribute the fonts, 2) you must have the knowledge to embed them, 3) you have to hope that Amazon doesn't rip them out (as it sometimes does, assuming your mean to publish through KDP), and 4) your idea of great typeface may offend the reader who prefers his/her/its own great typeface, and who gives you a one-star review in consequence.

Besides, ARA General Belgrano sank with great loss of life in 1982.

In general I agree with you but if the vanity font is for chapter headings, I'll just shrug. But when they specify the body/paragraph font then the steam starts coming out of my ears. (And of course even more comes out when they specify the line spacing, borders/margins, and font size.)

Hitch 05-20-2021 02:58 PM

Quote:

Originally Posted by hobnail (Post 4123308)
In general I agree with you but if the vanity font is for chapter headings, I'll just shrug. But when they specify the body/paragraph font then the steam starts coming out of my ears. (And of course even more comes out when they specify the line spacing, borders/margins, and font size.)

If it's Amazon, they can't, at least, not in the "modern" era. Not for fonts. If you even attempt to stipulate the body font, in any number of ways--set it on the paragraph tag, set it in a body div, set it in a bodysection div, etc., Amazon will just flat-out nuke it right outta de book. Like magic.

So, that's a no-fly-zone. That does not mean that there aren't pre-2014 or 2015 files out there with specified, stipulated body fonts. Ironically, most of them are trade publisher files!

(And WHAT is with trade pubbed books today coming in Kindle with block-style, space-between paragraphs, for novels? I mean, talk about STEAM!)

Hitch

hobnail 05-20-2021 03:04 PM

Quote:

Originally Posted by Hitch (Post 4123343)
(And WHAT is with trade pubbed books today coming in Kindle with block-style, space-between paragraphs, for novels? I mean, talk about STEAM!)

Hitch

Yeah, I recently got one like that, a freebie on ereaderiq. They put a non-breaking space between p tags, between all paragraphs.

JSWolf 05-20-2021 03:12 PM

Quote:

Originally Posted by Notjohn (Post 4123251)
I prefer not to encounter the problem. 1) you must have the legal right to distribute the fonts, 2) you must have the knowledge to embed them, 3) you have to hope that Amazon doesn't rip them out (as it sometimes does, assuming your mean to publish through KDP), and 4) your idea of great typeface may offend the reader who prefers his/her/its own great typeface, and who gives you a one-star review in consequence.

Besides, ARA General Belgrano sank with great loss of life in 1982.

But with a Kindle, most eBooks that have embedded fonts, the embedded fonts never/hardly get seen. The default is not for Publisher Default. However, with Kindle, if you don't do something with the base font, then the default is a poor reading experience.

With ePub, you can embed a font that's only used in some places and that font will be seen.

JSWolf 05-20-2021 03:17 PM

Quote:

Originally Posted by Hitch (Post 4123343)
(And WHAT is with trade pubbed books today coming in Kindle with block-style, space-between paragraphs, for novels? I mean, talk about STEAM!)

Hitch

I cannot stand that and I will go into the code and fix it. Good thing I know what I am doing so it doesn't take too long.

I would love a job reformatting commercial eBooks. But not one like that Churchill eBook. Way too many footnotes to deal with.

Hitch 05-20-2021 11:52 PM

Quote:

Originally Posted by JSWolf (Post 4123357)
I cannot stand that and I will go into the code and fix it. Good thing I know what I am doing so it doesn't take too long.

I would love a job reformatting commercial eBooks. But not one like that Churchill eBook. Way too many footnotes to deal with.

Buddy, you say that NOW. I know you and I think that your head would explode after your 4th-5th book. ;-) If you even made it that far.

It seems like a perfect gig for a perfectionist...but, hell, ask Tex, the biggest perfectionist I know. He'll tell you and you KNOW he has mad formatting skills. Trust me.

Hitch

Uncle Robin 05-21-2021 12:21 AM

Quote:

Originally Posted by JSWolf (Post 4123354)

With ePub, you can embed a font that's only used in some places and that font will be seen.

This is good to know. I might try compiling an ePub for PD Urdu poetry with an embedded nastaliq font instead of the much less appealing naksh that Unicode seems to default to. Since I can't actually read Urdu in anything other than Roman or devnagari, I would prefer maximum aesthetic value, and nastaliq delivers

DNSB 05-21-2021 01:10 AM

Quote:

Originally Posted by Uncle Robin (Post 4123507)
This is good to know. I might try compiling an ePub for PD Urdu poetry with an embedded nastaliq font instead of the much less appealing naksh that Unicode seems to default to. Since I can't actually read Urdu in anything other than Roman or devnagari, I would prefer maximum aesthetic value, and nastaliq delivers

Remember as Hitch mentioned, if you try to use a body font in an ebook sent to Amazon, it will vanish like the disposasteins of yesteryear. Set a chapter header font, no problems.

On the last ebook I saw that attempted to get around this, the author styled each paragraph with the embedded font using style= and it didn't work.

Uncle Robin 05-21-2021 01:15 AM

Quote:

Originally Posted by DNSB (Post 4123520)
Remember as Hitch mentioned, if you try to use a body font in an ebook sent to Amazon, it will vanish like the disposasteins of yesteryear. Set a chapter header font, no problems.

On the last ebook I saw that attempted to get around this, the author styled each paragraph with the embedded font using style= and it didn't work.

Thanks. It was mention of epub that caught my eye. This would be a hobby project, initially for my own education, but if the results were ok, i would be nice to be able to embed the font I chose for sharing the epub non-commercially with others I think might enjoy it

Hitch 05-21-2021 11:00 AM

Quote:

Originally Posted by DNSB (Post 4123520)
Remember as Hitch mentioned, if you try to use a body font in an ebook sent to Amazon, it will vanish like the disposasteins of yesteryear. Set a chapter header font, no problems.

On the last ebook I saw that attempted to get around this, the author styled each paragraph with the embedded font using style= and it didn't work.

That ^ is exactly right. Amazon caught on to that trick ages ago (2013, by my personal knowledge) and there's a styling limit, inside the renderer (the publishing workflow renderers/processors) for style= or font=. Nukes it altogether.

We had this truly godawful book. It was...I can't even describe it. It was like a person's journal/memoir/something. And it careened from font to font. It also made extensive use of Arial. Well, like good little obedient doggies, we licensed the fonts and off we go and we could NOT NOT NOT get Arial to "take." Something about the usages, too many fonts, too much Arial in conjunction with (IDK what else).

Seriously, if you removed a paragraph with Arial, you could add one. We demonstrated it over and over. There appeared to be hard limit, in how many paragraphs you could have, in Arial. We tried normal CSS; we tried inline; we even tried putting it on the HTML tags (the customer was ADAMANT!), and we never got it to work. Use it all the time for headings and subheads, and for books where it's the only font...but there is something, somewhere, that makes it explode with a certain (number/type) of other fonts.

Most bizarre font thing--well, almost--that I ever saw. The Daily Prophet Effect--the one where the text appeared to come "unstuck" from the page and float around, in Previewer and on-sale--that was the MOST bizarre. We'd upload this perfectly normal novel, and when you'd preview it, the text of the book simply...came apart. And floated around the page, as if unanchored to lines, grids...weirdest thing ever. Customer as horribly unhappy with us. Never did figure out WHY.


Hitch

Tex2002ans 05-21-2021 05:49 PM

Quote:

Originally Posted by hobnail (Post 4123349)
Yeah, I recently got one like that, a freebie on ereaderiq. They put a non-breaking space between p tags, between all paragraphs.

WTF. It's like pressing ENTER ENTER ENTER in your documents.

And this is in trade published books?

Report it.

Quote:

Originally Posted by Hitch (Post 4123343)
(And WHAT is with trade pubbed books today coming in Kindle with block-style, space-between paragraphs, for novels? I mean, talk about STEAM!)

... what? Are you serious?

I could maybe see a self-help book, programming book, or something like that... but a novel‽

Quote:

Originally Posted by JSWolf (Post 4123357)
I cannot stand that and I will go into the code and fix it. Good thing I know what I am doing so it doesn't take too long.

I would love a job reformatting commercial eBooks.

Do it. Go to your favorite author, publisher, non-profit, etc... and clean it up for them.

There are plenty of abysmal ebooks out there that need reformatting.

Heck, that's how I got started.

Side Note: I even used this method in 2018:

I purchased an ebook from one of the podcasters I listen to.

He only had an Amazon/Kindle version for sale, so I wanted to create an EPUB so it could be sold on all the other stores.

Turns out it was a Word->Kindle conversion... and there were busted footnotes, broken URLs, and other issues.

I blew him away by pointing out tons of errors/typos.

He gave me the original source files, and I was able to generate a super clean, amazing EPUB (and better Kindle version too!).

Now he's one of my best clients/buddies, and I've done 6+ books for them (with more on the way).

But note, you'd probably want to be less abrasive with your "my way or the highway" demeanor.

Quote:

Originally Posted by JSWolf (Post 4123357)
But not one like that Churchill eBook. Way too many footnotes to deal with.

Meh. You know regex.

So once you spot the pattern, it's usually just a handful of regex to normalize the text.

I just reduce everything down to the super-clean:

Code:

<sup>1</sup>
then run my usual Saved Searches on it to instantly produce the footnote code.

Quote:

Originally Posted by Hitch (Post 4123504)
Buddy, you say that NOW. I know you and I think that your head would explode after your 4th-5th book. ;-) If you even made it that far.

lol, but every book that's ever passed through JSWolf's clutches turns out perfectly crisp and clean! :D

In that entire Calibre library of his, there must be hundreds, thousands, millions! He's outproduced us all! :D

Quote:

Originally Posted by Hitch (Post 4123504)
It seems like a perfect gig for a perfectionist...but, hell, ask Tex, the biggest perfectionist I know. He'll tell you and you KNOW he has mad formatting skills. Trust me.

:thumbsup::thumbsup:


All times are GMT -4. The time now is 10:33 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.