readium / swift-toolkit

A toolkit for ebooks, audiobooks and comics written in Swift
https://readium.org/mobile/
BSD 3-Clause "New" or "Revised" License
222 stars 96 forks source link

Pagination after increasing the font size #426

Closed vedat73 closed 1 month ago

vedat73 commented 1 month ago

Describe the bug

Hello. In the demo app when we open a book, it shows currentPage / total page at the bottom in the reading page. As we slide the screen it goes to next page and currentPage value increases which is obvious. However when we increase the font size to 150%, currentPage does not increase as we slide the screen. I know the reason is original page is parsed into multiple screen after increasing font size. So we may need to slide 2 or 3 times to increase currentPage value by 1. The question is how can I get the device screen-size-based totalPage and currentPage value after changing font size or any other feature that can affect page number.

How to reproduce?

  1. Open demo app
  2. Open a book
  3. Open preferences screen
  4. Increase font size to 150%
  5. Slide screen to next page while watching the current page indicator at the bottom of the screen

Readium version

2.7.1

OS version

iOS 17.2

Testing device

iPhone 15 Pro

Environment

macOS: 14.4.1
platform: arm64
Xcode 15.2

Additional context

No response

mickael-menu commented 1 month ago

This is not possible, see https://github.com/readium/swift-toolkit/discussions/196.

When you have questions, please search the existing Discussions before posting. Issues should be reserved for bug reports only.

vedat73 commented 1 month ago

thanks for reply, I already knew about #196 but wanted to know whether or not any improvement was made. It seems that same concept goes on.

mickael-menu commented 1 month ago

There's no plan to change this as it requires to pre-render all the resources in the publication every time something changes (font size, device orientation, etc.).

However, we might provide the number of screen pages in the current resource in a future API.

vedat73 commented 1 month ago

There's no plan to change this as it requires to pre-render all the resources in the publication every time something changes (font size, device orientation, etc.).

However, we might provide the number of screen pages in the current resource in a future API.

That would be awesome, thanks