This year, we focused on the following:
- Releasing the Readium Kotlin toolkit version 3.0
- Enhancing the TTS and audio navigator features
- Implementing ZIP streaming
- Adapting the new preferences API for the Readium Swift toolkit
Releasing the Readium Kotlin toolkit version 3.0
In 2023, a significant news was the release of Readium Kotlin toolkit’s major version 3.0-alpha.1. The previous breaking version, 2.0, was released three years ago. Since then, the toolkit has undergone numerous API improvements, it was necessary to clean up and retire the legacy APIs.
The main goals of version 3.0 were to simplify the Streamer and Fetcher APIs, retire deprecated legacy APIs, improve error reporting, and introduce new features.
Enhancing the TTS and audio navigator features
The existing audio navigator and TTS component have been improved in the following ways:
- Enhanced HTML resource content iterator to begin at the visible location.
- Added support for background playback, which was frequently requested by users.
- Included playback control in the notification centers.
- Integrated with the Jetpack media3 library on Android.
The TTS component, called PublicationSpeechSynthesizer
, has been redesigned to function as an actual Navigator on Android. This allows for easy integration into existing UX and view models in host applications. It also sets the stage for supporting Media Overlays.
Implementing ZIP streaming
:warning:This feature is currently only available in Kotlin but will be added to the Swift toolkit in 2024.
The 3.0 version of our toolkit introduces support for streaming ZIP packages. This exciting new feature allows users to stream LCP-protected publications directly from a LCP License Document, eliminating the need to download the entire publication first. It also enables streaming of large audiobook or comic book packages, as well as opening publications stored on the Android Shared Storage.
Adapting the new preferences API for the Readium Swift toolkit
Last year, we introduced a new Navigator Preferences API to the Kotlin toolkit. This API helps in two ways:
- It allows users to modify the rendering of the publication based on their preferences, such as adjusting the font size or zooming fit.
- It enables the design of a versatile user interface for changing these settings..
In 2023, we integrated the Preferences API into the Readium Swift toolkit.
This addition allowed us to hide intricate implementation details associated with each navigator, such as Readium CSS for EPUB, and offer a standardized public API. While working on the user settings, we also introduced new EPUB settings for iOS that were previously unavailable. These additions include:
- custom font families
- font-weight
- text color and background color (besides the default Readium CSS themes)
- text normalization for accessibility
- reading progression and language to adjust the layout
- paragraph indent and spacing
- ligatures and hyphenation
Other minor features and changes
Continuing our documentation efforts to support implementers
The Readium toolkit is complex and challenging for newcomers to understand. In 2023, we continued our efforts to enhance the onboarding process for implementers by providing user guides and documentation.
Keyboard support
The Readium mobile toolkits now support external keyboards, which enables applications to intercept keyboard shortcuts. Default mappings are provided to navigate through a publication using the arrow and space keys. This new feature is especially useful for newer devices like Chromebooks or macOS devices with Apple Silicon chips.
HREF normalization
In Readium v2.x, a Link
or Locator
’s href
could be either:
- a valid absolute URL for a streamed publication, e.g.
https://domain.com/isbn/dir/my%20chapter.html
, - a percent-decoded path for a local archive such as an EPUB, e.g.
/dir/my chapter.html
.- Note that it was relative to the root of the archive (
/
).
- Note that it was relative to the root of the archive (
To improve the interoperability with other Readium toolkits (in particular the Readium Web Toolkits, which only work in a streaming context) Readium v3 now generates and expects valid URLs for Locator
and Link
’s href
.
https://domain.com/isbn/dir/my%20chapter.html
is left unchanged, as it was already a valid URL./dir/my chapter.html
becomes the relative URL pathdir/my%20chapter.html
- We dropped the
/
prefix to avoid issues when resolving to a base URL. - Special characters are percent-encoded.
- We dropped the
Local HTTP server on Android
The Kotlin toolkit no longer includes a local HTTP server, enhancing the security of reading systems and protecting publications. Unfortunately, these changes cannot currently be implemented in iOS.