KaranveerB / typhon

e-book reader with Rikai-like Japanese dictionary lookup for Android
GNU General Public License v3.0
3 stars 0 forks source link

Furigana support #7

Closed languagemaniac closed 1 year ago

languagemaniac commented 1 year ago

Hi, I was wondering if you could add support for furigana. Currently when I load an epub that has furigana, it appears as normal text after the kanji. Like this: 見当けんとう.

Also, it would be nice if you could implement a way to adjust the font size.

Other than that, it works great.

Thank you for keeping Typhon updated.

KaranveerB commented 1 year ago

Credit where credit is due, a lot of the basis was already done from the furigana branch in the original project. Not sure if the original implementation was complete or wip though.

Can you test this and check if things work for you or if there is anything you think should be changed/added (probably default hiragana ratio should be increased)?

Highlighting when clicking on kanji with furigana is broken (and I don't really want to fix it atm), but if everything else is fine (including dictionary lookup), I'll probably make a release after a few other minor changes.

The zip contains 2 apks (both signed by me). The debug apk will install alongside the main apk, while the non-debug apk will be an update for the main app (you shouldn't lose settings or anything, but I'd recommend taking note of your font size and progress anyways). Code changes are in 8caa393.

typhon-1.7.0-rc1.zip

languagemaniac commented 1 year ago

Credit where credit is due, a lot of the basis was already done from the furigana branch in the original project. Not sure if the original implementation was complete or wip though.

Can you test this and check if things work for you or if there is anything you think should be changed/added (probably default hiragana ratio should be increased)?

Highlighting when clicking on kanji with furigana is broken (and I don't really want to fix it atm), but if everything else is fine (including dictionary lookup), I'll probably make a release after a few other minor changes.

The zip contains 2 apks (both signed by me). The debug apk will install alongside the main apk, while the non-debug apk will be an update for the main app (you shouldn't lose settings or anything, but I'd recommend taking note of your font size and progress anyways). Code changes are in 8caa393.

typhon-1.7.0-rc1.zip

Yeah that one works, furigana now appears correctly on top of the words. It's quite small, but readable. And although it doesn't highlight kanji that has furigana on it (like you mentioned) it does search the word in the dictionary, so it's ok now.

It would be nice if users could change the font size from within the app, maybe you could consider adding this feature in a future update but for now it's fine.

Thanks!

KaranveerB commented 1 year ago

Glad to know it works (especially the dictionary look up part). I'll probably make a proper release within the next 24hours-ish

Also, the font size is configurable. In the settings (top left hamburger menu > settings) under "Text display settings" you can set the regular "Text size", as well as the "Furigana text size ratio" which defines how relatively big the Furigana is to regular text. I'll probably up the default value for the full release though.

languagemaniac commented 1 year ago

Glad to know it works (especially the dictionary look up part). I'll probably make a proper release within the next 24hours-ish

Also, the font size is configurable. In the settings (top left hamburger menu > settings) under "Text display settings" you can set the regular "Text size", as well as the "Furigana text size ratio" which defines how relatively big the Furigana is to regular text. I'll probably up the default value for the full release though.

Oh I didn't see that, my bad. Thanks!

languagemaniac commented 1 year ago

Do you think you could make it so that it could be set to display the text vertically?

Normally i prefer to read from left to right but I thought it could be convenient reading it the traditional way on the phone since It's a vertical display. I wanted to give that a try but looks like it's not possible.

KaranveerB commented 1 year ago

Vertical text would be a separate feature and should be it's own issue. Seeing as the projects this one relies on (NightWhistler's PageTurner and HtmlSpanner) and Android TextView itself doesn't seem to support vertical text, it would probably be a fairly involved process and ultimately something I'm very unlikely to take on.

KaranveerB commented 1 year ago

Added in new release https://github.com/KaranveerB/typhon/releases/tag/v1.7.0

Feel free to create a new issue if there are any problems.

languagemaniac commented 1 year ago

Vertical text would be a separate feature and should be it's own issue. Seeing as the projects this one relies on (NightWhistler's PageTurner and HtmlSpanner) and Android TextView itself doesn't seem to support vertical text, it would probably be a fairly involved process and ultimately something I'm very unlikely to take on.

Understood, I didn't know it could be such a complex thing. Thanks for taking the time to explain it to me.