Patches & Hyphen Dicts: c.f., autopatch.sh ;).
----
Enable Full-Screen Reading:
Edit .kobo\Kobo eReader.conf
Add:
[FeatureSettings]
fullScreenReading=true
And then check out the Reading Settings UI.
NOTE: RIP since FW 4.12 ;'(
----
As for quality dithering, this may help (in Reading?):
highQualityDithering=true
NOTE: Not sure this actually does anything...
If you want to kill the Quick Turn thingy:
disableQuickTurn=true
(Also of potential interest: readingColumnCount, disableForcedGC16, disableRegal)
To kill the stupid swipe to unlock on the Forma: (in PowerOptions):
UnlockEnabled=false
NOTE: Of potential interest, the Dev section:
(Some of this might be available via the UI after entering "devmodeon" in the Search bar (this brings back Kindle memories ;)), c.f., https://www.mobileread.com/forums/showpost.php?p=3795567&postcount=5)
[DeveloperSettings]
EnableDebugServices=true
EnableInspector=true
ForceWifiOn=false
ShowWidget=true
NOTE: And the Feats section:
[FeatureSettings]
Screenshots=false
ShowLayoutRectangles=true
NOTE: And, possibly, in the App section:
[ApplicationPreferences]
Debugging=true
----
kePub output: Copy a (preferrably small) DRM-free kepub to reference.kepub.epub in .config/calibre/plugins
And set margins to 0 in the output's Page Setup! (To avoid applying margins to the body element, which shifts everything to the right. [apparently a kepub bug/spec violation])
----
kobo_extra.css at the USB root:
# Nerf stupid page margins
@page {margin: 0;}
div, p {widows:1; orphans:1;}
# Might want to go w/ this instead, if the null margins are too extreme/unbalanced
@page {margin: 10px 0 0 0}
# Optionally:
body {orphans: 1; widows: 1;}
# And to make sure we don't apply padding/margin to the body, which screws up kepubs:
# NOTE: May be overkill/already fixed/handled by a patch
body { margin: 0 0 0 0 !important; padding: 0 0 0 0 !important; }
# Fix monospace (w/ a real custom font, instead of Dark Courier):
# NOTE: Now also handled by a patch.
@font-face {font-family: monospace; font-weight: normal; font-style: normal; src: url("res:///fonts/normal/Dark Courier")}
@font-face {font-family: monospace; font-weight: bold; font-style: normal; src: url("res:///fonts/bold/Dark Courier")}
@font-face {font-family: monospace; font-weight: normal; font-style: italic; src: url("res:///fonts/italic/Dark Courier")}
@font-face {font-family: monospace; font-weight: bold; font-style: italic; src: url("res:///fonts/bolditalic/Dark Courier")}
----
Speaking of fonts, if the UI and the ACCESS (KePub) reader mangles some styles with custom fonts, make sure the Panose stuff is sane (OS/2 > Panose).
Keep the usual Kindle Line-height tweaks in mind, that might also help w/ the line-height < 1.0 issue...
c.f., http://www.mobileread.com/forums/showpost.php?p=2866441&postcount=218 for the line-height thing,
and https://www.mobileread.com/forums/showpost.php?p=3606469&postcount=2 & https://www.mobileread.com/forums/showpost.php?p=3608181&postcount=9 for the Panose tweaks.
Don't forget about ttfautohint if a TTF font has broken bytecode...
Also, supposedly kerning has to be old-style for the ACCESS renderer to make use of it...
Although a quick check didn't yield definitive results on that front (stuff might even be unkerned by default...)
Might require ligatures & stuff to be enabled?
Other random notes:
* ACCESS really doesn't like unhinted fonts (TTF or CFF)
* RMSDK deals fairly well with unhinted CFF, and only slightly less badly than ACCESS with unhinted TTF
* ACCESS may not care too much about the naming scheme, but RMSDK does (better fix it for nametable-from-filename anyways)
* RMSDK doesn't appear to care too much about the Panose stuff, but ACCESS does.
Fun, right? :D.
You should be able to automate a lot of that stuff w/ gftools:
* fix-vertical-metrics for the line-heights & co.
* fix-weightclass in case the OS/2 weights are borked
* More generally, nametable-from-filename which will handle all the OS/2 & TTF names shenanigans based on the filename (Family-Style).
* Based on list-panose, it should be fairly easy to set every field to 0 (or the right values) via fontTools, c.f., fix-panose.py in this folder.
e.g., for Bookerly:
fonts=("${(@f)$(ls -1 ./Bookerly-*.ttf)}")
for font in "${fonts[@]}" ; do
gftools fix-vertical-metrics -a 802 -d -198 -l 0 "${font}"
mv -v "${font%.*}.fix.ttf" "${font}"
gftools nametable-from-filename "${font}"
mv -v "${font}.fix" "${font}"
#gftools fix-isfixedpitch --fonts "${font}"
#mv -v "${font}.fix" "${font}"
~/SVN/Configs/trunk/Kindle/Kobo_Hacks/Patches/fix-panose.py "${font}"
mv -v "${font}.fix" "${font}"
done
----
Speaking of fonts, quick recap to rebuild the latest Literata sources...
# Install fontmake & gftools:
pipenv --python 3.11
pipenv install fontmake
pipenv install gftools
# Make sure that ends up in $PATH:
pipenv shell
# Clone Literata (https://github.com/googlefonts/literata)
## For Literata 3.103+ (check commit history for older releases)
# Patch line-heights:
sed -e 's/value = -308;/value = -200;/g' -i sources/*.glyphs
sed -e 's/value = 308;/value = 200;/g' -i sources/*.glyphs
sed -e 's/value = 1177;/value = 800;/g' -i sources/*.glyphs
# Rename:
sed -e 's/familyName = Literata;/familyName = Lit3rata;/g' -i sources/*.glyphs
sed -e 's/familyName: "Literata"/familyName: "Lit3rata"/' -i sources/config.yaml
sed -e 's/Literata\[opsz,wght\].ttf/Lit3rata\[opsz,wght\].ttf/' -i sources/config.yaml
sed -e 's/Literata-Italic\[opsz,wght\].ttf/Lit3rata-Italic\[opsz,wght\].ttf/' -i sources/config.yaml
# We want to build the OTF version:
sed -e 's/buildOTF: false/buildOTF: true/' -i sources/config.yaml
# Rebuild
cd sources
# NOTE: Alternatively comment out the !Italic & Italic glyphs file from source to build each one separately, if ninja errors out
# w/ something along the lines of "multiple rules generate master_ufo/Lit3rata.designspace"
# NOTE: Disable OTF if otfautohint falls on its ass (or disable autohinting, gftools builder --no-autohint seems to do the trick...).
# If you *want* to keep the autohinting pass for the TTfs, add an autohintOTF: false entry to the config instead (it's not documented, but it exists).
# Probably related to AFDKO 4.0 switching from psautohint to otfautohint?
# Let's hope both of those issues will miraculously disappear in later updates of the tools involved ;).
gftools builder config.yaml
# Setup Panose for Kobo...
otfs=("${(@f)$(ls -1 ../fonts/otf/*.otf)}")
ttfs=("${(@f)$(ls -1 ../fonts/ttf/*.ttf)}")
for font in "${otfs[@]}" "${ttfs[@]}" ; do
~/SVN/Configs/trunk/Kindle/Kobo_Hacks/Patches/fix-panose.py "${font}"
mv -v "${font}.fix" "${font}"
done
# Final notes:
NOTE: Pretty happy with 12pt (Text) (i.e., the default unprefixed master) Regular. I'll probably keep using Medium on Android.
NOTE: I would also tend to prefer the OTF variant to avoid a Cubic to Quadratic conversion (AA on the TTF variant might be *ever* so slightly darker, though).
----
Same deal w/ Adobe's Source Serif Pro
# Install AFDKO
pipenv --python 3.11
pipenv install afdko
pipenv shell
# Clone it (https://github.com/adobe-fonts/source-serif-pro (sources are in the main branch))
# Patch line-heights:
sed -e 's/1036;/800;/g' -i familyTables.fea familyOS2.fea
sed -e 's#1036#800#g' -i */*/*/*/*.ufo/fontinfo.plist
sed -e 's/-335;/-200;/g' -i familyTables.fea familyOS2.fea
sed -e 's/335;/200;/g' -i familyOS2.fea
sed -e 's#-335#-200#g' -i */*/*/*/*.ufo/fontinfo.plist
sed -e 's#335#200#g' -i */*/*/*/*.ufo/fontinfo.plist
# Rebuild:
./build.sh