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

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 10-13-2024, 04:26 PM   #1
ghastmxn
Junior Member
ghastmxn began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2024
Device: PC/iPhone SE 2
Angry Importing Custom Font (From Local File)

I'm trying to change my e-book's font to OpenDyslexic, a font I found online.

https://opendyslexic.org/

I can't figure out how to get it to work. I'm trying to edit an .epub file.

I imported the font through Preferences>Common options>Embed Font Family

@font-face {
font-family: "OpenDyslexic";
src: url(fonts/OpenDyslexic-Regular.otf);
}

I added the @font-face thingy in a couple of different ways.

I'm getting the error "Unexpected missing generic font family"

I tried messing with the content.opf, but I have no idea what I'm doing.
None of the book appears in the font that I want on the E-book viewer on PC.

I just want my flipping font.

This is my first time using Calibre. I don't even know CSS very well or HTML (a little knowledge, but very small).

It would be even more helpful if someone told me how to include rules so I don't have to do this for every book.

Side note: I don't have dyslexia. I have ADHD. In middle school, I found that using this font helped me focus more on reader which motivated to read more.

I did download the font.
ghastmxn is offline   Reply With Quote
Old 10-13-2024, 06:06 PM   #2
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,590
Karma: 9499994
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by ghastmxn View Post
I'm getting the error "Unexpected missing generic font family"
That just means you have not specified a fallback font

You have added this...
@font-face {
font-family: "OpenDyslexic";
src: url(fonts/OpenDyslexic-Regular.otf);
}

Then you need to specify where the font is used. It is not enough just to embed the font file.

If you want the whole book, I would add it under the <body> tag
body {
display: block;
font-family: "OpenDyslexic", serif;
font-size: 1em;
margin: 0 0 0 0;
padding: 0 0 0 0;
}

Check my post here and download the epub... https://www.mobileread.com/forums/sh...76#post4458576
Karellen is offline   Reply With Quote
Old 10-13-2024, 06:08 PM   #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: 44,284
Karma: 165617033
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I've attached a test file with OpenDyslexic Regular, Italic, Bold and Bold-Italic embedded. This works on my Kobo Sage though you have to remember when using an embedded font to set the Aa font to Published Default.

Basically, you need the 4 font files, the font-face and font-family bits and bobs as mentioned by Karellen. The other item is that I created my test file with Sigil so it uses several directories to store various items.
Attached Thumbnails
Click image for larger version

Name:	screen_001.png
Views:	310
Size:	101.5 KB
ID:	211401  
Attached Files
File Type: epub Open_Dyslexic_embed3.epub (537.3 KB, 302 views)
DNSB is online now   Reply With Quote
Old 10-14-2024, 06:24 AM   #4
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 13,606
Karma: 103503445
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Elephant in room: Open Dyslexic is an Arts Project. No evidence it helps anyone (Dyslexic of ADHD), but there is evidence it is harder to read than simply increasing size.

Otherwise, there is no problem embedding a font as Karellen & DNSB write.

However some Android apps have no "publisher" font option. Conversion to azw3 will work, but four models of Kindle, (K1, K2, DX and DXG) can't be upgraded to azw3 and old mobi neither supports user added fonts or embedded fonts.

If the device has the font (either supplied or added by user in designated location), then the CSS is similar but the font doesn't need embedded.

There are periodical arguments about serif vs sans and it turns out it may be what ever you are used to works best. So if paperback fiction then serif such as Georgia or Times and if web pages and Apps then sans such as Arial or Verdana, or the Google/Android versions.
Quoth is offline   Reply With Quote
Old 10-14-2024, 08:14 AM   #5
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 78,871
Karma: 143095300
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Quoth View Post
Elephant in room: Open Dyslexic is an Arts Project. No evidence it helps anyone (Dyslexic of ADHD), but there is evidence it is harder to read than simply increasing size.

Otherwise, there is no problem embedding a font as Karellen & DNSB write.

However some Android apps have no "publisher" font option. Conversion to azw3 will work, but four models of Kindle, (K1, K2, DX and DXG) can't be upgraded to azw3 and old mobi neither supports user added fonts or embedded fonts.

If the device has the font (either supplied or added by user in designated location), then the CSS is similar but the font doesn't need embedded.

There are periodical arguments about serif vs sans and it turns out it may be what ever you are used to works best. So if paperback fiction then serif such as Georgia or Times and if web pages and Apps then sans such as Arial or Verdana, or the Google/Android versions.
According to what I've read online is that a sans-serif font with letters not too close (or no kerning). Some may need the font size larger. Even Comic Sans can work.

Last edited by JSWolf; 10-15-2024 at 02:48 PM.
JSWolf is offline   Reply With Quote
Old 10-14-2024, 03:50 PM   #6
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 13,606
Karma: 103503445
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Tight kerning gives keming.
Quoth is offline   Reply With Quote
Old 10-14-2024, 08:05 PM   #7
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: 44,284
Karma: 165617033
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Keming from David Friedman's Ironic Sans website.
DNSB is online now   Reply With Quote
Old 10-16-2024, 09:48 PM   #8
ghastmxn
Junior Member
ghastmxn began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2024
Device: PC/iPhone SE 2
Quote:
Originally Posted by Quoth View Post
Elephant in room: Open Dyslexic is an Arts Project. No evidence it helps anyone (Dyslexic of ADHD), but there is evidence it is harder to read than simply increasing size.

Otherwise, there is no problem embedding a font as Karellen & DNSB write.

However some Android apps have no "publisher" font option. Conversion to azw3 will work, but four models of Kindle, (K1, K2, DX and DXG) can't be upgraded to azw3 and old mobi neither supports user added fonts or embedded fonts.

If the device has the font (either supplied or added by user in designated location), then the CSS is similar but the font doesn't need embedded.

There are periodical arguments about serif vs sans and it turns out it may be what ever you are used to works best. So if paperback fiction then serif such as Georgia or Times and if web pages and Apps then sans such as Arial or Verdana, or the Google/Android versions.
Huh! Maybe it was the placebo effect all along.
ghastmxn is offline   Reply With Quote
Old 10-17-2024, 01:05 AM   #9
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: 44,284
Karma: 165617033
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by ghastmxn View Post
Huh! Maybe it was the placebo effect all along.
At one time as part of my IT career, I worked with one school district's special needs people on several projects. One of them was testing multiple fonts to see if they had any effect on dyslexic readers. Basically, OpenDyslexic and Dyslexie did not show any consistent improvements compared to any other fonts and some subjects actually did consistently worse with them. What we did find was sans-serif fonts such as Arial and Comic Sans with a slightly larger font size worked best for the majority of the subjects but some subjects were happier with serif fonts. Basically, find a font you are comfortable with and use it.

See this article from Edutopia: Do Dyslexia Fonts Actually Work?.

Please forgive me for mentioning Comic Sans.
DNSB is online now   Reply With Quote
Old 10-17-2024, 07:07 AM   #10
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 13,606
Karma: 103503445
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Quote:
Originally Posted by ghastmxn View Post
Huh! Maybe it was the placebo effect all along.
Most likely.
Try larger, try better line spacing and a font without too tight kerning (avoid keming).

Drop caps and SMALL CAPS lead-in can be removed/fixed, sometimes just by CSS edit. Or Diap's Span-Div tool (which can be customised) in Calibre Editor.
Quoth is offline   Reply With Quote
Reply

Tags
css, custom font, custom fonts, font, fonts

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
importing metadata into custom columns taleia Library Management 4 10-03-2023 05:56 AM
importing custom icons Rellwood Calibre 4 01-29-2017 02:58 PM
Importing custom fonts doesn't work in Marvin 3.0 Spfamy1 Marvin 4 08-17-2016 07:27 PM
Importing local files within a plugin macr0t0r Plugins 1 11-21-2009 07:41 PM


All times are GMT -4. The time now is 08:03 PM.


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