readium / mobile Goto Github PK
View Code? Open in Web Editor NEWš± Readium Mobile is a toolkit for ebooks, audiobooks and comics written in Swift & Kotlin.
Home Page: https://readium.org/mobile
License: BSD 3-Clause "New" or "Revised" License
š± Readium Mobile is a toolkit for ebooks, audiobooks and comics written in Swift & Kotlin.
Home Page: https://readium.org/mobile
License: BSD 3-Clause "New" or "Revised" License
how can i add readium to my react native project?
The mobile toolkits are currently lacking documentation. Let's use this issue to track the work to be done.
Some of the pages will be in the shared mobile
repo while platform-dependent ones will be in swift-toolkit
or kotlin-toolkit
.
The integration guides will be in each platform repo and will be the gateway to more abstract concepts/APIs.
Publication
models and extensionsPublication
services
Locator
Fetcher
MediaType
PublicationParser
Who can help me? I'm helpless
According to the Readium Audiobook Profile, a RWPM must contain the duration
property in the Link objects to conform.
However, the mobile toolkits Publication.conformsTo()
API is only checking the media type in the reading order, not the availability of duration
, so it's not checking full conformance. The reason for this is that we don't have the info for Zipped Audiobooks.
As a workaround, we could add an Audio/MediaPublicationService
which will compute the duration
from:
duration
Link object properties for streamed manifestsThen, the conformsTo()
API could use this info to check that the duration is available for all the resources of the reading order.
There are various popular standards for comic book metadata, especially in the case of CBZs, that are not yet parsed and used to provide comic metadata. These include the ComicRack ComicInfo.xml
, ComicBookInfo in the ZIP comment, the Advanced Comic Book Format, as a .acbf
file and more.
Useful links:
Originally posted by @chocolatkey in readium/go-toolkit#97.
I can see Note (annotation) option is available in menu when selected the text in Android, but when I am trying for the same option in iOS I can't see the Note option. Please let me know if it is available for iOS or if I am missing anything to unable the Note option for iOS
Changing the font size with Readium CSS is limited because if the publication has absolute font sizes then enabling advanced options is necessary: basically disabling publisher's defaults.
A possible workaround would be to use native solutions when available since Readium CSS is platform-agnostic.
text-size-adjust
is promising and seems to be available on both iOS and Android: https://caniuse.com/?search=text-size-adjust
Related issue: readium/readium-css#34
Dear,
You are doing great job!, I appreciate your effort. I have one question though:
Do you have custom dictionary support. I mean lets say I have a custom dictionary in stardict format, can I call it to lookup for words I want to while I read book in epub mode??
I have dictionary in my native language ("punjabi").
I can also help you if you like to build this feature, although I am new to app development...
Thank you in advance
Sajan
Let's say that I want to add a feature where double-tapping an image in a book displays it in a native UI fullscreen. Or even better, pinching on the image turns it into a native image that I can stretch, rotate and snaps to fullscreen, like in the Photos app.
(I have done this with another app, many years ago.)
I'm wondering what the best way would be to go about implementing at least the double-tap, and ideally in a way that can be integrated into Readium, if it's something that should be in Navigator or the App or some part of the codebase.
Purely from an implementation perspective, here are some notes:
<img>
tags and only do the timer in that case; there's no reason to give all tap events a delay.I'm tempted to do a bunch of this work in JS and then wire up a new delegate method on the Swift side, but I don't think such a thing would be merged. The double-click handler could probably be implemented on the Swift side, but what about pinch-to-zoom-out? I don't think that's going across the default tap bridge. Also, should it be customizable what elements this works for? Etc.
Anyway, I will probably hack something together for now but I wanted to discuss what the optimal route is on this. Some of it might be Swift delegate code, and some might be injected JS. I know R2 is intended to be flexible enough not be forked, and I'm not sure how much of this should be supported natively and/or what the strategy would be for enabling this kind of functionality for app devs.
Original issue can be found on the ReadiumCSSā issue tracker
This is not urgent but the issue belongs to apps and it will be more visible to developers in the appsā issue tracker.
Users want to have control to meet their disability, preferences, tasteā¦
Providing a Google fonts install in the reading app is a good thing but what will be better is to provide the list of fonts already aiviable in the system as most of the users would have already installed there their needed fonts.
It needs a work specific for each platform and implementation but will be the best way to provide users an install extra font features.
Most operating systems have a way to install custom fonts at a OS level so why do each app will reinvent the wheel and provide their on way to install font for their own use instead of just letting the user pick in the system installed fonts.
As an example, even iOS which was really close have add a way to install fonts through Apple configurator app and the process is even simpler through http://sub.pentacom.jp/custom-ios-fonts/ or an app like Anyfont. Even font vendors like Myfonts eased the process with an install function directly on the order page.
Before this, each app which want to give this option have done an install in app with the major drawback that the font was only aiviable in the app. Now with system install, all app could browse and pick a font from the system as other OS.
This is an example but most platform have this possibility. Its works to done for each one but this seems the way to go as users willing to install a custom fonts in their reading apps must probably have ever installed it on the system for use in other apps.
Tables have always been quite an issue and their rendering can become quite terrible in CSS multicol (cells being cut off, vertical padding not being properly handled, etc.).
Thereās no easy way out there, and itās probably up to authors to find solutions but we can at least try reaching interop with some popular apps that will open the table in a dedicated web view (on top of the current one, with a close button) if the user double-clicks or double-taps one.
A few notes as to why this should be reasonable:
overflow-x
(on the web view itself), something we canāt easily do in the paged and scrolled views (we would have to add an extra wrapper around the table
since overflow
wonāt work for table
itselfā¦);table
(excepted inline style=""
) will not apply in the dedicated web view;Please feel free to add your thoughts, obviously.
The ability to stream LCP protected publications is increasingly becoming important with the rise of LCP protected audiobooks.
In the audiobook space, streaming is often the default option due to the very large size of most audiobooks and the need to start playback as quickly as possible. For a number of years now, this meant serving unprotected audiobooks alongside LCP protected packages, but the cost of storing audiobooks twice is an issue and the use of unencrypted streaming can be problematic with some publishers.
ZIP support remains an issue in the Swift toolkit, with libraries that always compromise their feature set in a way that makes it difficult for the toolkit to achieve its goals. We'll need to explore how to work around this issue first, which will inform us on our ability to go all the way through.
Now that Thorium (and therefore Readium Desktop) has support for embedded annotations on its roadmap, this should also be on the mobile roadmap to ensure cross-compatibility.
The first step will remain the definition of a shared format, but the core idea is already scoped:
Given the importance of Locators in Readium projects, we can expect these APIs to be built on top of them.
Here are a few points regarding the Readium CSS integration which should be double-checked or fixed in the mobile toolkits.
ReadiumCSS-default.css
needs to be injected if the book doesn't have any style.allowtransparency
to make sure that background color settings work properly.Since we still limit line-length in the spread model, you might want to limit the web view/iframe size so that you donāt end up with wide gaps on large screens (or add padding to :root, and take it into account when scrolling).
There's a well known bug on InDesign (addition of an extra
ar-SA
dc:language
) which causes problems in the reading progression of apps like iBooks (they rely on the lastdc:language
because they can't rely on the spine attribute in EPUB2)
xml:lang
.
<dc:language>
, the page-progression-direction
must be taken into account.dir=
attribute with CJK languagesI know scroll mode is still super rough around the edges in the app and work on scroll is planned for October but Iād like to point out this issue in advance (so that I donāt forget about it).
The rendition: flow
values dedicated to scroll are scrolled-continuous
and scrolled-doc
. And it will obviously impact both @camill-a and I (again itās not urgent at all, just recording my thoughts).
My understanding is that we currently have something like scrolled-doc
: swipe left/right to navigate between documents and scroll to read them. Reminds me of the first digital magazines on tablets a little bit (and I know a lot of users were kinda confused with this navigation pattern, which is why this pattern dropped in popularity/usage over time).
It looks like Readium 1 and iBooksā scroll modes, for instance, are more like scrolled-continuous
but I may be wrong there ā especially as the expected behavior is not very clear, cf. note in the spec. Well, I guess that at least it can be defined as web views on top/bottom of one another (except for vertical writing).
I donāt know if you want to support both but if this is the case, I can already tell weāll have to create a flag for each one so that we can make adjustments in Readium CSS: if continuous, weād better add top/bottom margins so that the reader knows itās a new html file for instance, and we may also have to sanitize viewport height values depending on the implementation.
Since work on the test app and Readium CSS overlap there, I assume weād better deal with this issue in the R2-testapp first then put the recommendations in the readium-css repo. Does this feel OK to you?
LCP relies on URI templates for LSD operations, and soon Publication Services will need them as well.
Unfortunately, the implementation is subpar in both Swift and Kotlin toolkits.
The URI Template specification being quite complex, it might be worth adding an external dependency for this, instead of implementing it ourselves. We need to make sure the dependency is at least being tested using the official test suite.
Alternatively, we could support only a subset of the specification, which would be much more manageable. But it depends on the usage made of Link objects.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ššš
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ā¤ļø Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.