Skip to content

Commit

Permalink
fix spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
mergen3107 committed Oct 22, 2024
1 parent ee17b44 commit a2f0fd3
Show file tree
Hide file tree
Showing 119 changed files with 295 additions and 295 deletions.
2 changes: 1 addition & 1 deletion doc/Building_targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ These instructions are intended for a Linux OS. MacOS and Windows users are sugg

## Prerequisites

This instructions asume that you [have a development environment ready to run](Building.md) KOReader. If not then please install common prerequisites first.
This instructions assume that you [have a development environment ready to run](Building.md) KOReader. If not then please install common prerequisites first.

### A toolchain for your target.

Expand Down
2 changes: 1 addition & 1 deletion doc/Collaborating_with_Git.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ integrate changes from this issue (or diff, patch, git cherry-pick sha-commit)
```
dpavlin$ git add -p unireader.lua
```
interactivly select just changes which are not whitespace
interactively select just changes which are not whitespace

```
dpavlin$ git commit --author NuPogodi -m 'TOC position on current place in the tree #235'
Expand Down
2 changes: 1 addition & 1 deletion doc/DataStore.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ print(total_time) --> 50
conn:close() -- Do not forget to close stmt after you are done
```

For more information on supported SQL quries, check out [SQLite3's official
For more information on supported SQL queries, check out [SQLite3's official
documentation][sq3-doc].


Expand Down
6 changes: 3 additions & 3 deletions doc/Porting.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ At 16bpp, we assume the pixel format is RGB565.
For obvious performance reasons, we prefer 8bpp, and we will attempt to enforce that on devices which are not natively running at that depth (i.e., [on Kobos](https://github.com/koreader/koreader/blob/d1cd5e7ad4283611c57007b2c2d3dd5f7dab7057/platform/kobo/koreader.sh#L138-L186)).
As explained below, the same considerations should be kept in mind regarding the effective 16c palette of eInk screens.
When we're in control of the data, we attempt to always use "perfect" in-palette colors (c.f., the [COLOR constants](https://github.com/koreader/koreader-base/blob/a1fc4e43b7cce7a76b13224e145f9bada343d8ea/ffi/blitbuffer.lua#L1881-L1889) in the BlitBuffer module).
Otherwise, when there'd be signficiant gain in doing so (i.e., when displaying mainly image content), we attempt to make use of [dithering](https://github.com/koreader/koreader-base/blob/a1fc4e43b7cce7a76b13224e145f9bada343d8ea/ffi/blitbuffer.lua#L227-L271), ideally [offloaded to the hardware](https://github.com/koreader/koreader-base/blob/a1fc4e43b7cce7a76b13224e145f9bada343d8ea/ffi/framebuffer_mxcfb.lua#L412-L423) when supported.
Otherwise, when there'd be significant gain in doing so (i.e., when displaying mainly image content), we attempt to make use of [dithering](https://github.com/koreader/koreader-base/blob/a1fc4e43b7cce7a76b13224e145f9bada343d8ea/ffi/blitbuffer.lua#L227-L271), ideally [offloaded to the hardware](https://github.com/koreader/koreader-base/blob/a1fc4e43b7cce7a76b13224e145f9bada343d8ea/ffi/framebuffer_mxcfb.lua#L412-L423) when supported.

The actual framebuffer content is then refreshed (i.e., displayed) via device-specific ioctls, making the best effort in using device-specific capabilities, whether that be [optimized waveform modes](https://github.com/koreader/koreader-base/blob/a1fc4e43b7cce7a76b13224e145f9bada343d8ea/ffi/framebuffer_mxcfb.lua#L643-L655), hardware dithering or [hardware inversion](https://github.com/koreader/koreader-base/blob/a1fc4e43b7cce7a76b13224e145f9bada343d8ea/ffi/framebuffer_mxcfb.lua#L253-L256).

Expand Down Expand Up @@ -50,7 +50,7 @@ Following are the framebuffers that `framebuffer_einkfb.lua` currently supports:
For 4bpp framebuffers, it means every pixel is represented with 4 bits, so we have 2 pixels in 1 byte.
That also effectively limits the palette to 16 colors.
The inverted part means that every pixel's color value is flipped (`^ 0xFF`).
For example, two pixels `0x00` and `0xF0` will be flipped to `0xFF` and `0x0F`, before being packed to accomodate the framebuffer's pixel format (here, [into a single byte](https://github.com/NiLuJe/FBInk/blob/4f0230b17c480cdc75dd5497fddf33937781c812/fbink.c#L106-L133)).
For example, two pixels `0x00` and `0xF0` will be flipped to `0xFF` and `0x0F`, before being packed to accommodate the framebuffer's pixel format (here, [into a single byte](https://github.com/NiLuJe/FBInk/blob/4f0230b17c480cdc75dd5497fddf33937781c812/fbink.c#L106-L133)).

For 8bpp framebuffers, it means each pixel is instead stored in 1 byte, making addressing much simpler.
The effective color palette of the display is still limited to 16 shades of gray: it will do a decimating quantization pass on its own on refresh.
Expand Down Expand Up @@ -83,7 +83,7 @@ Next, you might need to define `Input:eventAdjustHook()` function in `Input:init
We use this hook function to translate events into a format that KOReader understands.
You can look at the KindleTouch initialization code for a real-world example.

For some Kobo devices (Mini, Touch, Glo and Aura HD) the function `Input:eventAdjustHook()` was skipped and the functions `Input:init()` and `Input:handleTypeBTouchEv()` were changed to accomodate for the single touch protocol.
For some Kobo devices (Mini, Touch, Glo and Aura HD) the function `Input:eventAdjustHook()` was skipped and the functions `Input:init()` and `Input:handleTypeBTouchEv()` were changed to accommodate for the single touch protocol.
For the Kobo Aura (and others with the same kernel quirks) with multitouch support, an extra function `Input:handlePhoenixTouchEv()` was added.

Linux supports two kinds of Multi-touch protocols:
Expand Down
2 changes: 1 addition & 1 deletion frontend/apps/filemanager/filemanagermenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ To:
FFIUtil.purgeDir(cachedir)
end
lfs.mkdir(cachedir)
-- Also remove from the Cache objet references to the cache files we've just deleted
-- Also remove from the Cache object references to the cache files we've just deleted
local Cache = require("cache")
Cache.cached = {}
UIManager:askForRestart(_("Caches cleared. Please restart KOReader."))
Expand Down
2 changes: 1 addition & 1 deletion frontend/apps/filemanager/filemanagersetdefaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function SetDefaultsWidget:init()
end
end

-- Prepare our menu entires
-- Prepare our menu entries
self.menu_entries = {}

local set_dialog
Expand Down
2 changes: 1 addition & 1 deletion frontend/apps/reader/modules/readercropping.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function ReaderCropping:onPageCrop(mode)
self.crop_dialog = VerticalGroup:new{
align = "left",
self.bbox_widget,
(Device:isTouchDevice() and button_container) or nil, -- button bar only availble for touch devices
(Device:isTouchDevice() and button_container) or nil, -- button bar only available for touch devices
}
UIManager:show(self.crop_dialog)
return true
Expand Down
6 changes: 3 additions & 3 deletions frontend/apps/reader/modules/readerdictionary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function ReaderDictionary:init()
os.getenv("STARDICT_DATA_DIR") or
DataStorage:getDataDir() .. "/data/dict"

-- Show the "Seaching..." InfoMessage after this delay
-- Show the "Searching..." InfoMessage after this delay
self.lookup_msg_delay = 0.5
-- Allow quick interruption or dismiss of search result window
-- with tap if done before this delay. After this delay, the
Expand Down Expand Up @@ -649,7 +649,7 @@ local function tidyMarkup(results)
if ok then
result.definition = fixed_definition
else
logger.warn("Dict's user provided funcion failed:", fixed_definition)
logger.warn("Dict's user provided function failed:", fixed_definition)
end
end
else
Expand Down Expand Up @@ -813,7 +813,7 @@ function ReaderDictionary:rawSdcv(words, dict_names, fuzzy_search, lookup_progre
-- and a really bad selected text, can take up to 10 seconds.
-- It is nice to be able to cancel it when noticing wrong text was
-- selected.
-- Because sdcv starts outputing its output only at the end when it has
-- Because sdcv starts outputting its output only at the end when it has
-- done its work, we can use Trapper:dismissablePopen() to cancel it as
-- long as we are waiting for output.
-- When fuzzy search is enabled, we have a lookup_progress_msg that can
Expand Down
4 changes: 2 additions & 2 deletions frontend/apps/reader/modules/readerfont.lua
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ function ReaderFont:updateFontFamilyFonts()
-- font (we have here in self.font_face) because of its increased bias (or the
-- monospace font we also added with bias).
-- So, we don't need to insert self.font_face in the list for unset family fonts,
-- which would otherwise need us to call updateFontFamilyFonts() everytime we
-- which would otherwise need us to call updateFontFamilyFonts() every time we
-- change the main font face.
local g_font_family_fonts = G_reader_settings:readSetting("cre_font_family_fonts", {})
local family_fonts = {}
Expand Down Expand Up @@ -745,7 +745,7 @@ If that font happens to be part of this list already, it will be used first.]]),
self.ui:handleEvent(Event:new("UpdatePos"))
end,
help_text = _([[
Adjust the size of each fallback font so they all get the same x-height, and lowercase characters picked in them look similarly sized as those from the defaut font.
Adjust the size of each fallback font so they all get the same x-height, and lowercase characters picked in them look similarly sized as those from the default font.
This may help with Greek words among Latin text (as Latin fonts often do not have all the Greek characters), but may make Chinese or Indic characters smaller when picked from fallback fonts.]]),
separator = true,
})
Expand Down
8 changes: 4 additions & 4 deletions frontend/apps/reader/modules/readerhandmade.lua
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Hidden flows are shown with gray or hatched background in Book map and Page brow
self:updateDocFlows()
self.ui:handleEvent(Event:new("UpdateToc"))
self.ui:handleEvent(Event:new("InitScrollPageStates"))
-- The footer may be visible, so have it update its dependant items
-- The footer may be visible, so have it update its dependent items
self.view.footer:onUpdateFooter(self.view.footer_visible)
self.ui.annotation:setNeedsUpdateFlag()
if touchmenu_instance then
Expand All @@ -282,7 +282,7 @@ Hidden flows are shown with gray or hatched background in Book map and Page brow
self:updateDocFlows()
self.ui:handleEvent(Event:new("UpdateToc"))
self.ui:handleEvent(Event:new("InitScrollPageStates"))
-- The footer may be visible, so have it update its dependant items
-- The footer may be visible, so have it update its dependent items
self.view.footer:onUpdateFooter(self.view.footer_visible)
self.ui.annotation:setNeedsUpdateFlag()
if touchmenu_instance then
Expand Down Expand Up @@ -326,7 +326,7 @@ function ReaderHandMade:onReaderReady()
-- and it may fillToc(). So, it may happen that the expensive validateAndFixToc()
-- is called twice (first with the original ToC, then with ours).
-- - ReaderRolling will have its onReaderReady() called after ours, and if we
-- have set up hidden flows, we'll have overriden some documents methods so
-- have set up hidden flows, we'll have overridden some documents methods so
-- its cacheFlows() is a no-op.
self:updateHandmagePages()
-- Don't have each of these send their own events: we'll send them once afterwards
Expand Down Expand Up @@ -358,7 +358,7 @@ function ReaderHandMade:setupToc(no_event)
-- If enabled, plug one method into the document object,
-- so it is used instead of the method from its class.
self.document.getToc = function(this)
-- ReaderToc may add fieds to ToC items: return a copy,
-- ReaderToc may add fields to ToC items: return a copy,
-- so the one we will save doesn't get polluted.
return util.tableDeepCopy(self.toc)
end
Expand Down
2 changes: 1 addition & 1 deletion frontend/apps/reader/modules/readerkoptlistener.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function ReaderKoptListener:onReadSettings(config)
self:setZoomMode(normal_zoom_mode)
self.ui:handleEvent(Event:new("GammaUpdate", self.document.configurable.contrast, true)) -- no notification
-- since K2pdfopt v2.21 negative value of word spacing is also used, for config
-- compatability we should manually change previous -1 to a more reasonable -0.2
-- compatibility we should manually change previous -1 to a more reasonable -0.2
if self.document.configurable.word_spacing == -1 then
self.document.configurable.word_spacing = -0.2
end
Expand Down
6 changes: 3 additions & 3 deletions frontend/apps/reader/modules/readerlink.lua
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ function ReaderLink:onTap(_, ges)
--
-- 30px on a reference 167 dpi screen makes 0.45cm, which
-- seems fine (on a 300dpi device, this will be scaled
-- to 54px (which makes 1/20th of screen witdh on a GloHD)
-- to 54px (which makes 1/20th of screen width on a GloHD)
-- Trust Screen.dpi (which may not be the real device
-- screen DPI if the user has set another one).
max_distance = Screen:scaleByDPI(30)
Expand Down Expand Up @@ -1292,7 +1292,7 @@ function ReaderLink:onGoToLatestBookmark(ges)
if latest_bookmark then
if self.ui.paging then
-- self:onGotoLink() needs something with a page attribute.
-- we need to substract 1 to bookmark page, as links start from 0
-- we need to subtract 1 to bookmark page, as links start from 0
-- and onGotoLink will add 1 - we need a fake_link (with a single
-- page attribute) so we don't touch the bookmark itself
local fake_link = {}
Expand Down Expand Up @@ -1355,7 +1355,7 @@ function ReaderLink:showAsFootnotePopup(link, neglect_current_location)
flags = flags + 0x0002
end
-- Checks for private CSS properties "-cr-hint: footnote/noteref/..." are
-- always done (they can be applied to specific elements or classe names
-- always done (they can be applied to specific elements or class names
-- with Styles tweaks.)

-- Trust role= and epub:type= attribute values if defined, for source(*) and target
Expand Down
4 changes: 2 additions & 2 deletions frontend/apps/reader/modules/readerpagemap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ function ReaderPageMap:onShowPageList()
pl_menu,
}

-- buid up menu widget method as closure
-- build up menu widget method as closure
local pagemap = self
function pl_menu:onMenuChoice(item)
pagemap.ui.link:addCurrentLocationToStack()
Expand All @@ -274,7 +274,7 @@ end

function ReaderPageMap:getCurrentPageLabel(clean_label)
-- Note: in scroll mode with PDF, when multiple pages are shown on
-- the screen, the advertized page number is the greatest page number
-- the screen, the advertised page number is the greatest page number
-- among the pages shown (so, the page number of the partial page
-- shown at bottom of screen).
-- For consistency, getPageMapCurrentPageLabel() returns the last page
Expand Down
2 changes: 1 addition & 1 deletion frontend/apps/reader/modules/readerpaging.lua
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ function ReaderPaging:onInitScrollPageStates(orig_mode)
blank_area:setSizeTo(self.view.visible_area)
while blank_area.h > 0 do
local offset = Geom:new()
-- caculate position in current page
-- calculate position in current page
if self.current_page == self.orig_page then
local page_area = self.view:getPageArea(
self.view.state.page,
Expand Down
12 changes: 6 additions & 6 deletions frontend/apps/reader/modules/readerrolling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function ReaderRolling:init()
-- We loaded from a valid cache file: remember its hash. It may allow not
-- having to do any background rerendering if the user somehow reverted
-- some setting changes before any background rerendering had completed
-- (ie. with autorotation, transitionning from portrait to landscape for
-- (ie. with autorotation, transitioning from portrait to landscape for
-- a few seconds, to then end up back in portrait).
self.valid_cache_rendering_hash = self.ui.document:getDocumentRenderingHash(false)
end
Expand Down Expand Up @@ -841,7 +841,7 @@ function ReaderRolling:onGotoXPointer(xp, marker_xp)
-- rectangle to unmark it; but it might not always be just white
-- margin: when we're in dual page mode and crengine has drawn a
-- vertical pages separator - or if we have had crengine draw
-- some backgroud texture with credocument:setBackgroundImage().
-- some background texture with credocument:setBackgroundImage().
if self.mark_orig_content_bb then
-- be sure we don't leak memory if a previous one is still
-- hanging around
Expand Down Expand Up @@ -1148,7 +1148,7 @@ function ReaderRolling:_gotoPos(new_pos, do_dim_area)
self.ui:handleEvent(Event:new("PageChangeAnimation", new_pos > self.current_pos))
end
self.ui.document:gotoPos(new_pos)
-- The current page we get in scroll mode may be a bit innacurate,
-- The current page we get in scroll mode may be a bit inaccurate,
-- but we give it anyway to onPosUpdate so footer and statistics can
-- keep up with page.
self.current_page = self.ui.document:getCurrentPage()
Expand Down Expand Up @@ -1241,7 +1241,7 @@ function ReaderRolling:onSetStatusLine(status_line)
self.cre_top_bar_enabled = status_line == 0
-- (We used to toggle the footer when toggling the top status bar,
-- but people seem to like having them both, and it feels more
-- practicable to have the independant.)
-- practicable to have the independent.)
self:onUpdatePos()
end

Expand Down Expand Up @@ -1681,7 +1681,7 @@ function ReaderRolling:handlePartialRerendering()
end

function ReaderRolling:_waitOrKillCurrentRerenderingSubprocess(wait, kill)
-- No need for an asynchronous collector: we'll explicitely call this and wait
-- No need for an asynchronous collector: we'll explicitly call this and wait
-- before going on, even when reloading, to avoid having multiple possibly huge
-- subprocesses at the same time.
-- Returns true if the process is no longer running.
Expand Down Expand Up @@ -1913,7 +1913,7 @@ function ReaderRolling:_rerenderInBackground()
-- (which happens when CSS properties "display:" and "white-space:" have changed for some nodes, which
-- is rather rare with our style tweaks) here, and do the reload and rerendering in this same background
-- subprocess, and doing this would hide this whole thing from the user, making the UX seamless.
-- But this would need a lot more memory, as we would then have 2 independant DOM in memory.
-- But this would need a lot more memory, as we would then have 2 independent DOM in memory.
-- Ie. with a big book and KOReader taking 120 MB, the subprocess would additionally use:
-- - 60 MB when doing a simple rerendering
-- - 130 MB when doing a full load+render
Expand Down
4 changes: 2 additions & 2 deletions frontend/apps/reader/modules/readerscrolling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ local C_ = _.pgettext
local T = require("ffi/util").template
local Screen = Device.screen

-- This module exposes Scrolling settings, and additionnally
-- This module exposes Scrolling settings, and additionally
-- handles inertial scrolling on non-eInk devices.

local SCROLL_METHOD_CLASSIC = "classic"
Expand Down Expand Up @@ -55,7 +55,7 @@ function ReaderScrolling:init()
-- The different scrolling methods are handled directly by readerpaging/readerrolling
self.scroll_method = G_reader_settings:readSetting("scroll_method")

-- Keep inertial scrolling available on the emulator (which advertizes itself as eInk)
-- Keep inertial scrolling available on the emulator (which advertises itself as eInk)
if not Device:hasEinkScreen() or Device:isEmulator() then
self._inertial_scroll_supported = true
end
Expand Down
Loading

0 comments on commit a2f0fd3

Please sign in to comment.