Post

Wrote a quick blog post about the newest AndroidX library 'androidx.text:text-vertical' 📚✨ Learn about the cool functionality this provides and why this is important, particularly if you read Japanese newspapers 🇯🇵📰 Read more: www.spght.dev/articles/13-... #AndroidDev #AndroidX

spght.devWhats new in... 'AndroidX Text - 1.0.0-alpha01' | Ed Holloway-George | Android Developer | Android GDEA quick look at one of the latest additions to the AndroidX suite of libraries

5 reposts11 likes

So what you're saying is that there's market potential for a word-art library... Do you know how this was done on regular apps, until now? Simple split on every grapheme and insert newlines?

That would be very wonky to do using newlines, so apps that do this natively most likely handle the whole layout and drawing manually. IIRC, there was some View library for this... Even easier: use a WebView. this has been supported in the web for quite a while. Even editing is supported!

These are pretty neat! Unfortunately neither has been suitable for my needs. The first only takes a String, so support for styling is very limited. The second is View-based, but this is a Compose Multiplatform app, so I need something purely in Compose.

I've built a custom solution that relies on setting a higher line height (and aligning text to the bottom), and then drawing the furigana in the empty space on top. It's quite messy now and there's some rough edges, but I hope to open source it soon! Here's how this looks (from the app itself):

This is awesome! I've been thinking about this for a while; not only on the presentation side, but also editing vertical text, ideally supporting CMP. I hope this could be the backbone of that on Android. Browsers have supported this for a while on every version, so I'm optimistic about a backport.