Present html content as dynamic “pages”

前端 未结 3 1706

I\'m building an e-Book reader for android. The content of an ebook is often divided into html files (epub) with one or may chapters in them.

I\'m planning to build an e

3条回答
  •  梦如初夏
    2021-02-08 08:01

    Note : This answer does not use the webview as your display surface.

    You can use the Canvas to draw each page. The canvas gives you it's height & width using which you can draw each line on the canvas using drawText based on the width & height available.

    Basically you can calculate how many letters can fit in a line , take that many words , taking care you don't split any words and keep drawing the text.

    If you break up the tasks to use different workers for each paragraph you can also probably make it fast.

提交回复
热议问题