@ -71,7 +71,7 @@ KOReader is developed and supported by volunteers all around the world. There ar
- document lesser-known features on the [wiki][link-wiki]
- help others with your knowledge on the [forum][link-forum]
Right now we only support [liberapay](https://liberapay.com/KOReader) donations.
Right now we only support [liberapay](https://liberapay.com/KOReader) donations, but you can also create a [bounty][link-bountysource] to motivate others to work on a specific bug or feature request.
@ -17,10 +17,10 @@ Each target has its own architecture and you'll need to setup a proper cross-com
A compatible version of the Android NDK and SDK will be downloaded automatically by `./kodev release android` if no NDK or SDK is provided in environment variables. For that purpose you can use:
If you want to use your own installed tools please make sure that you have the **NDKr23c** and the SDK for Android 9 (**API level 28**) already installed.
If you want to use your own installed tools please make sure that you have the **NDKr15c** and the SDK for Android 9 (**API level 28**) already installed.
-- We default to a flag (G2) that slightly boosts saturation,
-- but it *is* a destructive process, so we want to allow disabling it.
-- @translators CFA is a technical term for the technology behind eInk's color panels. It stands for Color Film/Filter Array, leave the abbreviation alone ;).
@ -120,10 +119,6 @@ function ReaderHandMade:onToggleHandmadeFlows()
end
functionReaderHandMade:addToMainMenu(menu_items)
-- As it's currently impossible to create custom hidden flows on non-touch, and really impractical to create a custom toc, it's better hide these features completely for now.
ifnotDevice:isTouchDevice()then
return
end
menu_items.handmade_toc={
text=_("Custom table of contents")..""..self.custom_toc_symbol,
{"font-size: 1rem !important;",_("1rem will enforce your main font size.")},
{"font-weight: normal !important;",_("Remove bold. Use 'bold' to get bold.")},
{"hyphens: none !important;",_("Disables hyphenation inside the targeted elements.")},
{"text-indent: 1.2em !important;",_("1.2em is our default text indentation.")},
{"break-before: always !important;",_("Start a new page with this element. Use 'avoid' to avoid a new page.")},
{"color: black !important;",_("Force text to be black.")},
{"background: transparent !important;",_("Remove any background color.")},
{"max-width: 50vw !important;",_("Limit an element width to 50% of your screen width (use 'max-height: 50vh' for 50% of the screen height). Can be useful with <img> to limit their size.")},
}},
{_("Private CSS properties"),{
{"-cr-hint: footnote-inpage;",_("When set on a block element containing the target id of a href, this block element will be shown as an in-page footnote.")},
{"-cr-hint: non-linear;",_("Can be set on some specific DocFragments (e.g. DocFragment[id$=_16]) to ignore them in the linear pages flow.")},
{"-cr-hint: non-linear-combining;",_("Can be set on contiguous footnote blocks to ignore them in the linear pages flow.")},
{"-cr-hint: toc-level1;",_("When set on an element, its text can be used to build the alternative table of contents. toc-level2 to toc-level6 can be used for nested chapters.")},
{"-cr-hint: toc-ignore;",_("When set on an element, it will be ignored when building the alternative table of contents.")},
{"-cr-hint: footnote;",_("Can be set on target of links (<div id='..'>) to have their link trigger as footnote popup, in case KOReader wrongly detect this target is not a footnote.")},
{"-cr-hint: noteref;",_("Can be set on links (<a href='#..'>) to have them trigger as footnote popups, in case KOReader wrongly detect the links is not to a footnote.")},
{"::before {content: ' '}",_("Insert a visible space before an element.")},
{"::before {content: '\\A0 '}",_("Insert a visible non-breakable space before an element, so it sticks to what's before.")},
{"::before {content: '\\2060'}",_("U+2060 WORD JOINER may act as a glue (like an invisible non-breakable space) before an element, so it sticks to what's before.")},
{"::before {content: '\\200B'}",_("U+200B ZERO WIDTH SPACE may allow a linebreak before an element, in case the absence of any space prevents that.")},
{"::before {content: attr(title)}",_("Insert the value of the attribute 'title' at start of an element content.")},
{"::before {content: '▶ '}",_("Prepend a visible marker.")},
{"::before {content: '● '}",_("Prepend a visible marker.")},
{"::before {content: '█ '}",_("Prepend a visible marker.")},
}},
{"-cr-hint: footnote-inpage;",_("When set on a block element containing the target id of a href, this block element will be shown as an in-page footnote.")},
{"-cr-hint: non-linear-combining;",_("Can be set on some specific DocFragments (ie. DocFragment[id*=16]) to ignore them in the linear pages flow.")},
{"-cr-hint: toc-level1;",_("When set on an element, its text can be used to build the alternative table of contents.")},
{"display: run-in !important;",_("When set on a block element, this element content will be inlined with the next block element.")},
{"font-size: 1rem !important;",_("1rem will enforce your main font size.")},
{"hyphens: none !important;",_("Disables hyphenation inside the targeted elements.")},
{"text-indent: 1.2em !important;",_("1.2em is our default text indentation.")},
@ -17,6 +17,7 @@ local ReaderTypeset = WidgetContainer:extend{
-- @translators This is style in the sense meant by CSS (cascading style sheets), relating to the layout and presentation of the document. See <https://en.wikipedia.org/wiki/CSS> for more information.
-- if fb2_compatible==nil, we don't know (user css file)
returntrue
end,
separator=separator,
}
end
@ -206,18 +189,8 @@ function ReaderTypeset:genStyleSheetMenu()
localstyle_table={}
localobsoleted_table={}
table.insert(style_table,getStyleMenuItem(
_("None"),
"",
_("This sets an empty User-Agent stylesheet, and expects the document stylesheet to style everything (which publishers probably don't).\nThis is mostly only interesting for testing.")
))
table.insert(style_table,getStyleMenuItem(
_("Auto"),
nil,
_("This selects the default and preferred stylesheet for the document type."),
Itmaycausesomesmallissuesonsomebooks(miscenteredtitles,headingsorseparators,orunexpectedtextindentation),aspublishersdon't expect to have our added styles at play and need to reset them; try switching to html5.css when you notice such issues.]]),
-- Add the obsoleted ones to the Obsolete sub menu
@ -267,7 +216,7 @@ This stylesheet is to be used only with FB2 and FB3 documents, which are not cla
for__,cssinipairs(OBSOLETED_CSS)do
obsoleted_css[css_files[css]]=css
ifcss_files[css]then
table.insert(obsoleted_table,getStyleMenuItem(css,css_files[css], _("This stylesheet is obsolete: don't use it. It is kept solely to be able to open documents last read years ago and to migrate their highlights.")))
-- Must be a class member, both because Input is a singleton and that state is process-wide anyway.
opened_devices={},
}
functionInput:new(o)
@ -225,10 +223,6 @@ function Input:init()
},
}
-- Always send pen data to a slot far enough away from our main finger slot that it can never be matched with a finger buddy in GestureDetector (i.e., +/- 1),
-- with an extra bit of leeway, since we don't even actually support three finger gestures ;).
self.pen_slot=self.main_finger_slot+4
self.gesture_detector=GestureDetector:new{
screen=self.device.screen,
input=self,
@ -252,9 +246,8 @@ function Input:init()
end
-- set up fake event map
self.event_map[10000]="IntoSS"-- Requested to go into screen saver
self.event_map[10001]="OutOfSS"-- Requested to go out of screen saver
self.event_map[10002]="ExitingSS"-- Specific to Kindle, SS *actually* closed
self.event_map[10000]="IntoSS"-- go into screen saver
self.event_map[10001]="OutOfSS"-- go out of screen saver
self.event_map[10010]="UsbPlugIn"
self.event_map[10011]="UsbPlugOut"
self.event_map[10020]="Charging"
@ -300,97 +293,14 @@ function Input:disableRotationMap()
@ -1171,29 +1053,29 @@ function Input:initMtSlot(slot)
end
end
functionInput:getMtSlot(slot)
returnself.ev_slots[slot]
end
functionInput:getCurrentMtSlot()
returnself.ev_slots[self.cur_slot]
end
functionInput:setMtSlot(slot,key,val)
self.ev_slots[slot][key]=val
end
functionInput:setCurrentMtSlot(key,val)
self.ev_slots[self.cur_slot][key]=val
self:setMtSlot(self.cur_slot,key,val)
end
-- Same as above, but ensures the current slot actually has a live ref first
functionInput:setCurrentMtSlotChecked(key,val)
ifnotself.active_slots[self.cur_slot]then
if#self.MTSlots==0then
self:addSlot(self.cur_slot)
end
self.ev_slots[self.cur_slot][key]=val
self:setMtSlot(self.cur_slot,key,val)
end
functionInput:getMtSlot(slot)
returnself.ev_slots[slot]
end
functionInput:getCurrentMtSlot()
returnself:getMtSlot(self.cur_slot)
end
functionInput:getCurrentMtSlotData(key)
@ -1220,13 +1102,22 @@ function Input:addSlot(value)
self.cur_slot=value
end
functionInput:addSlotIfChanged(value)
ifself.cur_slot~=valuethen
-- We've already seen that slot in this frame, don't insert a duplicate reference!
ifself.active_slots[value]then
self.cur_slot=value
else
self:addSlot(value)
end
end
end
functionInput:setupSlotData(value)
ifnotself.active_slots[value]then
if#self.MTSlots==0then
self:addSlot(value)
else
-- We've already seen that slot in this frame, don't insert a duplicate reference!
-- NOTE: May already be set to the correct value if the driver repeats ABS_MT_SLOT (e.g., our android/PB translation layers; or ABS_MT_TRACKING_ID for snow_protocol).
set_mixed_sorting={category="string",event="SetMixedSorting",title=_("Folders and files mixed"),args={true,false},toggle={_("on"),_("off")},filemanager=true,separator=true},
registry:addProvider("cbz","application/x-cbz",self,100)-- Alternative mimetype for OPDS.
registry:addProvider("cfb","application/octet-stream",self,80)-- Compound File Binary, a Microsoft general-purpose file with a file-system-like structure.
title=_("Ignore tables related HTML presentational hints"),
description=_("Ignore HTML attributes that contribute to styles on the <table> element and its sub-elements (ie. align, valign, frame, rules, border, cellpadding, cellspacing…)."),
text=T(_("KOReader %1\n\nA document viewer for E Ink devices.\n\nLicensed under Affero GPL v3. All dependencies are free software.\n\nhttp://koreader.rocks"),BD.ltr(Version:getCurrentRevision())),
icon="koreader",
})
end
}
common_info.report_bug={
text_func=function()
locallabel=_("Report a bug")
ifG_reader_settings:isTrue("debug_verbose")then
label=label.."".._("(verbose logging is enabled)")
localcommon_msg=T(_("Please report bugs to \nhttps://github.com/koreader/koreader/issues\n\nVersion:\n%1\n\nDetected device:\n%2"),
Version:getCurrentRevision(),Device:info())
locallog_msg=T(_("Verbose logs will make our investigations easier. If possible, try to reproduce the issue while it's enabled, and attach %1 to your bug report."),log_path)
locallog_msg=T(_("Attach %1 to your bug report."),log_path)
text=T(_("KOReader %1\n\nA document viewer for E Ink devices.\n\nLicensed under Affero GPL v3. All dependencies are free software.\n\nhttp://koreader.rocks"),BD.ltr(Version:getCurrentRevision())),
Onlyfontsnamed"Noto Sans xyz"or"Noto Sans xyz UI"(regular,notboldnoritalic,notSerif)willbeavailableinthismenu.However,boldfontswillbeusediftheircorrespondingregularfontsexist.]]),"","<EFBFBD><EFBFBD>")
Onlyfontsnamed"Noto Sans xyz"or"Noto Sans xyz UI"(regular,notboldnoritalic,notSerif)willbeavailableinthismenu.However,boldfontswillbeusediftheircorrespondingregularfontsexist.]])