Commit Graph

56 Commits (357bc65217ed7bdfaae6a433449d0f21baa6abc5)

Author SHA1 Message Date
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
poire-z 21932c24a2
UI font fallbacks: allow using more "Noto Sans xyz" (#8722)
Add a submenu allowing users to add Noto Sans fonts
to be used as UI fallback fonts.
Lots of them are alrady there on Android, but can be
downloaded (manually) and side-loaded by the user
on other platforms.
2 years ago
poire-z eb137d720e Font menu: show font names with their own font 4 years ago
poire-z f9e06c8d8b Font: fix possible messy font sizes when geometry/dpi change 4 years ago
NiLuJe 283187efb7
Update fonts & add Noto Sans Devanagari UI (#5803)
* Update fonts

https://github.com/koreader/koreader-fonts/pull/11

* Add Noto Sans Devanagari UI to the UI fallback font list (fix #2895).
4 years ago
poire-z 55f3575a10
UI font rendering: use available bold fonts for bold (#5675)
A few fixes and enhancement related to bold text:
- When using bold=true with a regular font, use its bold
  variant if one exists (can be prevented by manually
  adding a setting: "use_bold_font_for_bold" = false).
- When using a bold font without bold=true, promote bold
  to true, so fallback fonts are drawn bold too.
- Whether using a bold font, or using bold=true, ensure
  fallback fonts are drawn bold, with their available bold
  variant if one exists, or with synthetized bold.
- When using a bold variant of a fallback font, keep using
  the regular variant as another fallback (as bold fonts
  may contain less glyphs than their regular counterpart).
- Allow providing bold=Font.FORCE_SYNTHETIZED_BOLD to
  get synth bold even when a bold font exists (might be
  interesting to get text in bold the same width as the
  same text non-bold).
- Use the font realname in the key when caching glyphs,
  instead of our aliases (cfont, infont...) to avoid
  duplication and wasting memory.
5 years ago
Martín Fernández a5069f1c26 android: make system fonts toggable (#5670)
Also add droid font back to android and remove the workaround
5 years ago
poire-z c2e2c00db6 Font rendering: add some helpers for use by xtext
bump base for libkoreader-xtext.so:
- ffi/pic.lua: fix memory leak with some unsupported PNG files
- FreeType ffi: add methods for use with Harfbuzz shaping
- thirdparty: adds libunibreak
- Adds libkoreader-xtext.so: enhanced text shaping

Add a getFallbackFont(N) to each Lua font object to instantiate
(if not yet done) and return the Nth fallback font for the font.

Fallback fonts list: add NotoSansArabicUI-Regular.ttf

Add RenderText:getGlyphByIndex() to get a glyph bitmap by glyph
index, which is what we'll get from Harfbuzz shaping.
(RenderText:getGlyph() works with unicode charcode).
5 years ago
NiLuJe 8d281647ae
Unify battery meters look'n feel (#5537)
* Unify battery meters look'n feel

Switch to proper (vertical) battery icons (one per 10% steps).

Fix #5535

* Bump fonts (https://github.com/koreader/koreader-fonts/pull/7)

Because we need the new symbols from nerdfonts ;).
5 years ago
Frans de Jonge 99495aaed4
[Android, fix] Revert slightly more of the Noto business (#5463)
Follow-up to #5458. Cf. https://github.com/koreader/koreader/issues/5381#issuecomment-539873843.
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 860759cd48 Support loading GUI fonts from any known folder 5 years ago
Qingping Hou 587758939e split UI agnostic code from font.lua into fontlist.lua 5 years ago
Qingping Hou 1605409c60 rename runtimectl to document/canvascontext 5 years ago
Qingping Hou 4d8da96177 fix test 5 years ago
Qingping Hou d749591984 decouple device from pdfdocument, font & bgr checking 5 years ago
poire-z f533acb7f9 InfoMessage: avoid overflowing screen height with long messages
When no height= provided, and the InfoMessage would overflow
screen height when some long message is provided, decrease the
font size until the widget fit.
5 years ago
poire-z 0e2a3b6263 Selection menu: allow viewing HTML 6 years ago
NiLuJe ecd7b5b413
Minor font sanity checking (#4039)
* Discard dotfiles when looking for fonts
    So as not to pickup, among other things:
      * macOS resource forks
      * *nix hidden files (which may be stale fuse ghosts on Kindle)
* Update Kindle font blacklist
    Up to FW 5.9.6
    Basically blacklist anything non-LGC, requiring lab126's FT build, or FC tweaks.
    One day we'll fix CRe instead, maybe.
6 years ago
NiLuJe ebf47771d8
Update Google Fonts (#3942)
* Minor cleanup

We don't ship Droid Sans Fallback anymore

* Tweak UI fallback font list for better coverage

* Bump base & fonts

To pickup related changes
6 years ago
Frans de Jonge e1aa57f27e Font: unify font styling 7 years ago
Qingping Hou f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 7 years ago
Qingping Hou 3c647ff244 minor: various luacheck fixes 8 years ago
Qingping Hou e410ce14df doc: types/functions for font and rendertext module 8 years ago
Qingping Hou d7879db90f font: add default font size 8 years ago
chrox 55ba1450d4 code refactoring: use hash table index instead of loop 9 years ago
frankyifei 86d6d46770 add isKindle check 9 years ago
frankyifei 1f14a9e80d try to exclude those broken system fonts
these fonts can not be used by freetype and will cause hang up
9 years ago
Qingping Hou cdd17906f6 refactor: ui/font:getFace 9 years ago
frankyifei 23c963ed15 replace Droidsansfallback with NotoSansCJK-Regular 9 years ago
chrox 8d7ebaff5d add external font dir option for Android 9 years ago
chrox 3ad0ea5777 refactoring: remove dead code in font module 9 years ago
NiLuJe 3fdd90cf3b Fix a few Droid font paths 9 years ago
chrox a40c172c47 fix mupdf rendering caused by FONTDIR env var
It turns out that one of our mupdf patch reads the FONTDIR env var
and uses it in a totally different way so we will use another env var
EXT_FONT_DIR to define external font directory for different platforms.
9 years ago
chrox 077517be0b add FONTDIR env variable
to support custom font directory for EPUB documents

Now Koreader could find fonts in the "fonts" directory in the USB root
directory of kindle, Kobo and PocketBook devices, thus no need to copy
fonts to "koreader/fonts" directory.
9 years ago
Hans-Werner Hilse 22697adf20 switch from scaleByDPI() to scaleBySize() 10 years ago
Hans-Werner Hilse 3066c86e38 Refactoring hardware abstraction
This is a major overhaul of the hardware abstraction layer.
A few notes:

General platform distinction happens in
  frontend/device.lua
which will delegate everything else to
  frontend/device/<platform_name>/device.lua
which should extend
  frontend/device/generic/device.lua

Screen handling is implemented in
  frontend/device/screen.lua
which includes the *functionality* to support device specifics.
Actually setting up the device specific functionality, however,
is done in the device specific setup code in the relevant
device.lua file.

The same goes for input handling.
10 years ago
chrox 7ce5c9c052 fix Droid Sans Fallback not registered to crengine 10 years ago
chrox 56fa8a45b7 remove rescaleByDPI since it's not reversible
alternatively we store the original size before scaling by screen DPI
and use that value when needed.
10 years ago
chrox dc911c659e adapt DroidSansFallback file name 10 years ago
chrox b7c7287bab remove more global variables 10 years ago
NiLuJe 5ebed6655b Use Noto instead of Droid, where appropriate. 10 years ago
chrox 92219a1f1e cleanup: expand tab to 4 spaces 10 years ago
chrox 0f61ddd01d revert main GUI font to better-looking DroidSans 11 years ago
HW 09cd5c4104 Make DEBUG a require()d local 11 years ago
HW ef111b99c6 Refactored to use strictly locals 11 years ago
chrox 3f3e434157 rescale font size when fallbacks to fallback fonts
and make FreeSerif font the default font instead of DroidSansFallback

This patch should fix #272.
11 years ago
chrox bbfa6428aa add glyph fallbacks
if glyph is not found in specified fontface, fallback fonts are checked
on by one until a glyph is found.
11 years ago
Qingping Hou 1fe2e5c377 use DroidSansFallback for all major fonts
we need DroidSansFallback for internalization :)
11 years ago
Qingping Hou 2495d2c862 include dbg instead for settings for DEBUG in font.lua 11 years ago