2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
Commit Graph

38 Commits

Author SHA1 Message Date
Qingping Hou
634fed5487 use device instead of canvascontext in UI modules 2019-03-03 13:10:45 +01:00
Qingping Hou
1605409c60 rename runtimectl to document/canvascontext 2019-03-03 13:10:45 +01:00
Qingping Hou
02eca23649 decouple device from document modules 2019-03-03 13:10:45 +01:00
poire-z
620542b055
Text input related fixes & enhancements (#4124)
InputText: checks whether provided content can be given
back unaltered, which may not be the case after it is
splitted to UTF8 chars if the text is binary content.
Prevent editing text if that is the case.
Adds InputText and InputDialog :isEditable() and :isEdited()
methods.
Also accounts for the scrollbar width when measuring text
to prevent it from being displayed when not needed.
Also ensure a minimal size of the scrollbar thumb so it is
rendered when huge text with many lines is displayed.

Virtual keyboard: Hold on Backspace: delete from cursor
to start of line instead of clearing all text content.
2018-08-01 18:33:52 +02:00
Frans de Jonge
d931869ae3 [doc] RenderText:getGlyph() and truncateTextByWidth() (#3140) 2017-08-28 21:25:33 +02:00
Robert
c78f6989b4 Fix: truncateTextByWidth() should respect kerning and bold (#3139) 2017-08-28 20:36:15 +02:00
poire-z
ebe0c08bfb dict/wiki: definitions' text justification
This can be disabled by adding ["dict_justify"] = false to settings.reader.lua
2017-01-12 19:50:12 -08:00
Qingping Hou
f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 2017-01-02 19:52:09 -08:00
robert00s
09f2db3729 Fix long filename text in history textbox (#2322)
Fix long filename text in history textbox
2016-11-08 10:05:34 -08:00
chrox
f3e0d44cc4 disable jit on some modules on android
to make koreader on Android  more stable

and with these opt params:
```
require("jit.opt").start("sizemcode=64","maxmcode=64", "hotloop=10000")
```

The strategy here is that we only use precious mcode memory (jitting)
on deep loops like the several blitting methods in blitbuffer.lua and
the pixel-copying methods in mupdf.lua. So that a small amount of mcode
memory (64KB) allocated when koreader is launched in the android.lua
is enough for the program and it won't need to jit other parts of lua
code and thus won't allocate mcode memory any more which by our
observation will be harder and harder as we run koreader.
2016-04-07 23:43:58 +08:00
Qingping Hou
6fccb610c4 doc: update rendertext 2016-03-06 22:45:40 -08:00
Qingping Hou
3bec9cea89 ui(kvpage) truncate title/key/value if it's too long 2016-02-15 17:56:13 -08:00
Qingping Hou
e410ce14df doc: types/functions for font and rendertext module 2016-02-15 16:14:15 -08:00
Qingping Hou
11ee8d6fcc refactor: use new KeyValuePage widget for displaying statistics 2016-02-14 21:54:17 -08:00
frankyifei
059de23037 implement GUI dialog for setting crengine fallback font 2015-09-03 00:51:38 +09:30
Qingping Hou
186673587e chore: fix some of the luacheck errors 2015-04-26 20:57:45 -04:00
Hans-Werner Hilse
a82bafc63c fix handling of invalid UTF8 sequences
external data (and in bad cases our own) can contain invalid byte
sequences in UTF8 strings. A prominent example are file names.
There was a 1-off bug in calculating the allowed length for multibyte
chars, and the iterator was a bit too greedy when stumbling upon
invalid sequences, returning a single "invalid" char for a sequence
up to the point where it became invalid in calculation. Now, we present
one invalid char for the first byte of that sequence and then check
for a valid char starting with the next byte.
2014-11-28 14:52:04 +00:00
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.
2014-11-02 21:19:04 +01:00
Hans-Werner Hilse
5982e24d57 unify color specification
colors were a mixture of 4bpp integers (0=white, 15=black) and
fractional blackness levels (0=white, 1.0=black) before. This is
now unified to use the color specification of the Blitbuffer API.
2014-10-24 13:48:42 +02:00
Hans-Werner Hilse
7b1777e095 adapt widgets and text rendering to new font rendering
no background for text rendering anymore
2014-10-04 15:54:03 +02:00
Hans-Werner Hilse
adbcdddb56 undo wrong use of addblitFrom()
rendertext.lua did use addblitFrom() for rendering text - i.e. blitting
the letters to a BlitBuffer. However, it used intensity=1.0, which is
the same as doing a (faster, more efficient) blitFrom(). So use that
instead.

What was probably intented here is a different kind of blitting - using
the bitbuffer of the glyph as a mask.
2014-09-28 21:11:03 +02:00
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.
2014-08-20 09:41:01 +08:00
chrox
92219a1f1e cleanup: expand tab to 4 spaces 2014-03-13 21:52:43 +08:00
chrox
24ed02bbee add bold property for text rendering 2014-01-22 17:26:14 +08:00
Paulo Matias
9072a30cb5 Avoid off-limits dictionary title and make font size adjustable 2014-01-10 01:12:51 -02:00
chrox
63d574c3b5 less verbose on fallback text rendering 2013-10-25 20:10:15 +08:00
chrox
4cfdce6105 fix several local calls of Math.round 2013-10-23 22:37:55 +08:00
HW
09cd5c4104 Make DEBUG a require()d local 2013-10-22 20:51:29 +02:00
HW
ef111b99c6 Refactored to use strictly locals 2013-10-18 22:38:07 +02:00
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.
2013-10-16 12:22:53 +08:00
HW
25faf7e1a4 fixed bugs in implementation of utf8Chars() 2013-09-03 16:54:06 +02:00
HW
61c232e0e9 add a UTF8 character iterator
this speeds up font rendering since LuaJIT doesn't have to use
the interpreter for string.gsub(), which was used before
2013-09-03 16:24:49 +02:00
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.
2013-06-16 15:33:50 +08:00
chrox
01f045e7f9 add standalone glyph cache
I found it will be especially helpful to cache glyph separately
so that glyph caches won't be washed out by a single page cache.
2013-03-25 16:26:57 +08:00
chrox
26e2435fc6 render text with background and foreground 'color' 2013-03-16 19:46:37 +08:00
Qingping Hou
e3b567b2b1 fix kerning for Utf8Text family methods from tigran123
refer to master pullrequest #386 and #383, related
commits are (all in master(kpv) tree):
cb25029ddd
c7b4cf71f8
379cba7b68
2012-10-09 16:08:34 -04:00
HW
60ccd7441e fixed menu info displaying, replaced debug() by DEBUG()
the replacement of debug() was necessary to be able to access the lua library "debug" (for backtraces etc.)
2012-05-28 18:59:16 +02:00
HW
9e531fc2db file reorganisation
all lua frontend files are now in the frontend/ directory.
all old code is cleaned up.
2012-05-19 01:10:57 +02:00