mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #408 from chrox/master
add writing direction option when reflowing
This commit is contained in:
@@ -62,12 +62,12 @@ function KoptInterface:createContext(doc, pageno, bbox)
|
||||
kc:setTrim(doc.configurable.trim_page)
|
||||
kc:setWrap(doc.configurable.text_wrap)
|
||||
kc:setIndent(doc.configurable.detect_indent)
|
||||
kc:setRotate(doc.configurable.screen_rotation)
|
||||
kc:setColumns(doc.configurable.max_columns)
|
||||
kc:setDeviceDim(screen_size.w, screen_size.h)
|
||||
kc:setDeviceDPI(self.screen_dpi)
|
||||
kc:setStraighten(doc.configurable.auto_straighten)
|
||||
kc:setJustification(doc.configurable.justification)
|
||||
kc:setWritingDirection(doc.configurable.writing_direction)
|
||||
kc:setZoom(doc.configurable.font_size)
|
||||
kc:setMargin(doc.configurable.page_margin)
|
||||
kc:setQuality(doc.configurable.quality)
|
||||
|
||||
@@ -72,30 +72,6 @@ local KoptOptions = {
|
||||
values = {1.0, 1.2, 1.4},
|
||||
default_value = DKOPTREADER_CONFIG_LINE_SPACING,
|
||||
},
|
||||
{
|
||||
name = "max_columns",
|
||||
name_text = S.COLUMNS,
|
||||
item_icons = {
|
||||
"resources/icons/appbar.column.one.png",
|
||||
"resources/icons/appbar.column.two.png",
|
||||
"resources/icons/appbar.column.three.png",
|
||||
},
|
||||
values = {1,2,3},
|
||||
default_value = DKOPTREADER_CONFIG_MAX_COLUMNS,
|
||||
},
|
||||
{
|
||||
name = "justification",
|
||||
name_text = S.TEXT_ALIGN,
|
||||
item_icons = {
|
||||
"resources/icons/appbar.align.auto.png",
|
||||
"resources/icons/appbar.align.left.png",
|
||||
"resources/icons/appbar.align.center.png",
|
||||
"resources/icons/appbar.align.right.png",
|
||||
"resources/icons/appbar.align.justify.png",
|
||||
},
|
||||
values = {-1,0,1,2,3},
|
||||
default_value = DKOPTREADER_CONFIG_JUSTIFICATION,
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -172,13 +148,6 @@ local KoptOptions = {
|
||||
event = "DocLangUpdate",
|
||||
args = DKOPTREADER_CONFIG_DOC_LANGS_CODE,
|
||||
},
|
||||
{
|
||||
name="screen_rotation",
|
||||
name_text = S.VERTICAL_TEXT,
|
||||
toggle = {S.ON, S.OFF},
|
||||
values = {90, 0},
|
||||
default_value = 0,
|
||||
},
|
||||
{
|
||||
name = "word_spacing",
|
||||
name_text = S.WORD_GAP,
|
||||
@@ -186,6 +155,44 @@ local KoptOptions = {
|
||||
values = DKOPTREADER_CONFIG_WORD_SAPCINGS,
|
||||
default_value = DKOPTREADER_CONFIG_DEFAULT_WORD_SAPCING,
|
||||
},
|
||||
{
|
||||
name = "writing_direction",
|
||||
name_text = S.WRITING_DIR,
|
||||
toggle = {S.LTR, S.RTL, S.TBRTL},
|
||||
values = {0, 1, 2},
|
||||
default_value = 0,
|
||||
},
|
||||
{
|
||||
name = "quality",
|
||||
name_text = S.RENDER_QUALITY,
|
||||
toggle = {S.LOW, S.DEFAULT, S.HIGH},
|
||||
values={0.5, 1.0, 1.5},
|
||||
default_value = DKOPTREADER_CONFIG_RENDER_QUALITY,
|
||||
},
|
||||
{
|
||||
name = "max_columns",
|
||||
name_text = S.COLUMNS,
|
||||
item_icons = {
|
||||
"resources/icons/appbar.column.one.png",
|
||||
"resources/icons/appbar.column.two.png",
|
||||
"resources/icons/appbar.column.three.png",
|
||||
},
|
||||
values = {1,2,3},
|
||||
default_value = DKOPTREADER_CONFIG_MAX_COLUMNS,
|
||||
},
|
||||
{
|
||||
name = "justification",
|
||||
name_text = S.TEXT_ALIGN,
|
||||
item_icons = {
|
||||
"resources/icons/appbar.align.auto.png",
|
||||
"resources/icons/appbar.align.left.png",
|
||||
"resources/icons/appbar.align.center.png",
|
||||
"resources/icons/appbar.align.right.png",
|
||||
"resources/icons/appbar.align.justify.png",
|
||||
},
|
||||
values = {-1,0,1,2,3},
|
||||
default_value = DKOPTREADER_CONFIG_JUSTIFICATION,
|
||||
},
|
||||
{
|
||||
name = "defect_size",
|
||||
name_text = S.DEFECT_SIZE,
|
||||
@@ -193,13 +200,7 @@ local KoptOptions = {
|
||||
values = {1.0, 3.0, 5.0},
|
||||
default_value = DKOPTREADER_CONFIG_DEFECT_SIZE,
|
||||
event = "DefectSizeUpdate",
|
||||
},
|
||||
{
|
||||
name = "quality",
|
||||
name_text = S.RENDER_QUALITY,
|
||||
toggle = {S.LOW, S.DEFAULT, S.HIGH},
|
||||
values={0.5, 1.0, 1.5},
|
||||
default_value = DKOPTREADER_CONFIG_RENDER_QUALITY,
|
||||
show = false,
|
||||
},
|
||||
{
|
||||
name = "auto_straighten",
|
||||
|
||||
@@ -24,6 +24,7 @@ S.FONT_WEIGHT = _("Font weight")
|
||||
S.GAMMA = _("Gamma")
|
||||
S.VIEW_MODE = _("View mode")
|
||||
S.EMBEDDED_STYLE = _("Embedded style")
|
||||
S.WRITING_DIR = _("Writing Direction")
|
||||
|
||||
S.ON = _("on")
|
||||
S.OFF = _("off")
|
||||
@@ -50,5 +51,9 @@ S.LANDSCAPE = _("landscape")
|
||||
S.TOGGLE_BOLD = _("toggle bold")
|
||||
S.VIEW_SCROLL = _("scroll")
|
||||
S.VIEW_PAGE = _("page")
|
||||
S.LTR = _("LTR")
|
||||
S.RTL = _("RTL")
|
||||
S.TBRTL = _("TBRTL")
|
||||
S.TBLTR = _("TBLTR")
|
||||
|
||||
return S
|
||||
|
||||
Submodule koreader-base updated: 9490545710...756cd1ed83
Reference in New Issue
Block a user