Houssam Elbadissi ❄️
banner
skaldebane.dev
Houssam Elbadissi ❄️
@skaldebane.dev
indie kotlin dev 💜
compose by day, ktor by night 🦉
learning 日本語 🎌
21y/o muslim from morocco 🇲🇦
building thingies at skaldebane.dev 💙
free palestine 🇵🇸🕊
Basically something akin to the current traffic interception hacks, but purpose-made to solve this problem, and generic enough such that any app (including client-side) can take advantage of it... is something like that feasible?
November 14, 2025 at 1:24 PM
Same here, option 1 is specifically what makes the atmosphere compelling... but the bsky-specific hacks aren't great either.

I'm not very familiar with the way atproto works, maybe it's a dumb idea, but couldn't there possibly be a middle-ground?
November 14, 2025 at 1:24 PM
Linux: hi
October 12, 2025 at 8:36 PM
correction: remote functions (unstable (v2))
October 12, 2025 at 7:20 PM
google: nah here's your ai overview
October 2, 2025 at 4:19 PM
coincidentally, I also learnt about 'now' pages yesterday while browsing @aaronfrancis.com's website 😅

love the concept though!
September 27, 2025 at 8:49 PM
and now that it's 2.9, it only feels right that the next version is 3.0 lol

it's right on time as i wanna do fundamental changes in user flow. stuff like automatically scanning font families from storage, a synced font library, etc... but i'm getting way ahead of myself for a small side project 😅
September 27, 2025 at 4:09 PM
currently doing a full rewrite of Font Viewer, yet it'll be... v2.9.
there will be new big features; it's gonna be better for me to work on; it'll soon be published on more platforms... but at the end of the day, users will still be mostly seeing these as small, incremental (& overdue) improvements
September 27, 2025 at 4:09 PM
It also doesn't seem to support Bluesky quote posts? It just includes them as links, as it did in my this post from my last thread: bsky.app/profile/ska...
September 27, 2025 at 12:40 PM
🤖12
September 27, 2025 at 7:37 AM
That's all for now! I hope you found this little deep dive interesting!

I'm hoping to post more technical content like this in the future, and I'll be sharing more of what I find interesting along the way.
September 27, 2025 at 1:51 AM
2. I initially considered using File.deleteOnExit for this, but its wonderful documentation makes it clear that it doesn't really work on Android, encouraging some alternatives like using the Unix trick of deleting a file after all readers have opened it :D
September 27, 2025 at 1:51 AM
Footnotes:
1. The keen-eyed of you might've noticed that I used the ByteArray-based API, with a random Uuid as its identity, instead of the simpler File-based API. This is to work around a Compose Multiplatform font caching issue affecting font variations: youtrack.jetbrains.com/issue/CMP-8983
Font caching doesn't take `variationSettings` into account : CMP-8983
Bug Description Hi there! I'm working on a font preview application, where I make use of "variationSettings" in the "Font" factory function to allow the user to change the values of various axes. This works fine on Android, but when used on desktop, the font stays stuck on the very first variation axes' values it was created with (in the whole app) and doesn't reflect further changes in "variationSettings". The way this bug behaves makes me suspicious that the font cache doesn't take "variationSettings" as a key, so it keeps using an (invalid) cached version even when I change its value, unless I change other parameters (e.g. change "weight" or "style"). Affected Platforms - Desktop (tested on Linux) - May also affect other non-Android platforms, but I've only tested desktop Linux. Versions - Compose Multiplatform: 1.9.0 - Kotlin: 2.2.10 - OS: Linux Fedora 42, GNOME, amd64 - JDK: JetBrains Runtime 21 Reproduction Steps Create a "Font" (e.g. out of a "File"), and only change "variationS
youtrack.jetbrains.com
September 27, 2025 at 1:51 AM
These are just some of the lower-level aspects, and there's still more work here, particularly around variable fonts.

As they're only supported on SDK 26 (Android 8) and later, I may include a WebView fallback, disable VF features, or something else for older versions.
September 27, 2025 at 1:51 AM
For Uris, I've had to get the raw file descriptor from `ParcelFileDescriptor`, passing it to the Rust side, where I can then create a Rust `File` out of it using the `File::from_raw_fd` unsafe API.

More on that in my last post: bsky.app/profile/ska...
Houssam Elbadissi ❄️ (@skaldebane.dev)
First time needing to use an `unsafe` API in Rust! This one concerns IO-safety, not memory-safety, and I use it to pass a file descriptor to an Android Uri from the Kotlin side and read it as a File from the Rust side.
bsky.app
September 27, 2025 at 1:51 AM
That's before we even get to the Rust side of things.
I use a bit of Rust code to read the metadata out of these font files, using Gobley (UniFFI) to interop with it and bundle it as a shared library.

For Files, it's as easy as passing the path to the Rust side.
September 27, 2025 at 1:51 AM
Unfortunately, there doesn't seem to be any way to create a Font object directly out of a ByteArray like on desktop.

The only solution I've found thus far is to open an input stream from the Uri, write it to a temporary File, create a Font out of it, then immediately delete it.²
September 27, 2025 at 1:51 AM