Commit Graph

22 Commits (master)

Author SHA1 Message Date
Benoit Pierre 346d8eb83e
Decrease fonts memory use (#10618)
Instead of opening the same font multiple times for each different
size (multiple face instances), share one face instance and create
multiple size instances.
9 months ago
NiLuJe 5c24470ea9
Logger: Use serpent instead of dump (#9588)
* Persist: support serpent, and use by default over dump (as we assume consistency > readability in Persist).
* Logger/Dbg: Use serpent instead of dump to dump tables (it's slightly more compact, honors __tostring, and will tag tables with their ref, which can come in handy when debugging).
* Dbg: Don't duplicate Logger's log function, just use it directly.
* Fontlist/ConfigDialog: Use serpent for the debug dump.
* Call `os.setlocale(C, "numeric")` on startup instead of peppering it around dump calls. It's process-wide, so it didn't make much sense.
* Trapper: Use LuaJIT's serde facilities instead of dump. They're more reliable in the face of funky input, much faster, and in this case, the data never makes it to human eyes, so a human-readable format didn't gain us anything.
1 year ago
NiLuJe 62059f8d68
Misc: Get rid of the legacy defaults.lua globals (#9546)
* This removes support for the following deprecated constants: `DTAP_ZONE_FLIPPING`, `DTAP_ZONE_BOOKMARK`, `DCREREADER_CONFIG_DEFAULT_FONT_GAMMA`
* The "Advanced settings" panel now highlights modified values in bold (think about:config in Firefox ;)).
* LuaData: Isolate global table lookup shenanigans, and fix a few issues in unused-in-prod codepaths.
* CodeStyle: Require module locals for Lua/C modules, too.
* ScreenSaver: Actually garbage collect our widget on close (ScreenSaver itself is not an instantiated object).
* DateTimeWidget: Code cleanups to ensure child widgets can be GC'ed.
2 years ago
NiLuJe 2fe2515ace
FontList: Always use the binary cache format (#9519)
Since I never actually needed to look into that data ever until today, let's just get rid of the weird debug-specific behavior.

Instead, just add a dedicated "Developer options" entry that will dump it on demand (and it'll be sorted to boot, which makes it 500% more usable).

Plus, since yesterday's change, the cache format switch between debug or not miiiight actually be crashy, so re-trigger the migration ;p.

* Includes a couple of noteworthy base bumps:

https://github.com/koreader/koreader-base/pull/1516 (update to sdcv 0.5.4 + fixes pending upstream)
https://github.com/koreader/koreader-base/pull/1517 (fix ffiUtil.orderedPairs with keys of mixed types)
2 years ago
NiLuJe 13e8213e0a
A random assortment of fixes (#9513)
* Android: Make sure sdcv can find the STL
* DocCache: Be less greedy when serializing to disk, and only do that for the *current* document ;).
* CanvasContext: Explicitly document API quirks.
* Fontlist: Switch the on-disk Persist format to zstd (it's ever so slightly faster).
* Bump base for https://github.com/koreader/koreader-base/pull/1515 (fix #9506)
2 years ago
Utsob Roy 357bc65217
Keyboard: add Bengali Probhat layout (#8887)
Add keyboard with Bengali Probhat layout.
Bump koreader-fonts for added Noto Sans Bengali UI,
and include it among our fallback fonts.
2 years ago
yparitcher 035be38430 Dispatcher: Set font
Closes: #8531
2 years ago
hius07 3a01ab7899
fontlist: disable/enable some Kindle fonts (#8233)
Some Kindle system fonts cannot be registered and cause errors in crash.log.
Disabling them, and enabling one good font.
Tested on PW4, Voyage, Oasis.

Also https://github.com/koreader/koreader/issues/8228#issuecomment-922335608.
3 years ago
Martín Fernández 53234fcdc1
add hasSystemFonts device property (#7535)
Add system + user paths to the ReMarkable (has normal linux paths)
3 years ago
NiLuJe a62561e81e Fontlist: Move cache file in a subdirectory, so as not to mess with
Cache's state tracking

Re #7510

Legacy cache has to be deleted in Cache,
*before* the first getDiskCache call.

Reword the "Clear caches" Dev menu entry & callback:
We now have an actual "Restart" action (on most, if not all, platforms).
And we clear the whole cache folder, which may host other things (e.g.,
fontlist)
3 years ago
Martín Fdez 1148e46651 migrate fontlist to persist 3 years ago
ezdiy 144fd78986
fontlist: Skip fonts with missing family_name (#6820)
* Also don't trip on pipes
3 years ago
ezdiy a73bf1afda
fontlist: Cache categorized font info (for mupdf) (#6786)
Info about each face (l10n, name, family, style etc) is
now cached offline, so fonts can be queried ahead of time.

Fixes https://github.com/koreader/koreader/issues/6763
3 years ago
Martín Fdez 454ed0ebeb enable usage of system fonts 4 years ago
Martín Fdez 8e831eb756 desktop: disable battery on touch menu and reader footer
isDesktop and isEmulator are now different entities
4 years ago
NiLuJe bb0c01757d
Blacklist a few Amazon Ember styles to get the main ones to behave. (#5951)
Fix #5950
4 years ago
Martín Fernández a5069f1c26 android: make system fonts toggable (#5670)
Also add droid font back to android and remove the workaround
4 years ago
Martín Fernández 87334801ea android: fix ko paths when primary storage is a SD card 5 years ago
Frans de Jonge 2cd9b50137
[Android] Don't ship Noto (#5310)
Follow-up to <https://github.com/koreader/koreader/pull/5252>. This greatly reduces the Android package size.

See discussion in <https://github.com/koreader/koreader/pull/5264#issuecomment-525517001>.
5 years ago
Frans de Jonge 418aa1e5d6 Cache fontlist 5 years ago
Martín Fernández 3a957d71e3 [Desktop] Open writable font dir, toggle system+user/user fonts, fix openLink on mac (#5220)
Fixes #5093
5 years ago
Qingping Hou 587758939e split UI agnostic code from font.lua into fontlist.lua 5 years ago