There was a nice talk at KotlinConf talking about ...
# compose-ios
m
There was a nice talk at KotlinConf talking about some cool Compose custom text rendering But unfortunately, it's only working on Android They used Android Canvas since it's a java class so the class and all the methods are open by default, and we can override, intercept and customize any canvas method, not sure if the same methods are available in skiko but we can't even override the canvas methods, is it possible to make skiko canvas methods open to match android? it will make it possible to do a lot of cool things they did in the talk.
Not sure what's the best channel to post this, but it's related to all skiko targets: iOS, Desktop and Web
i
In general yes, in practice - it's complicated. Basically the ask is to support overriding methods of the wrapper class around C++ class. Just this requires implementing custom virtual table + has some runtime cost. In skiko similar mechanism is already implemented in a few places manually, but I'm not sure that it worth it for that case TBH. Also, I'm not totally sure that it will be enough to support such case PS personally, I'm experimenting with generator for such things, but it's not ready for skiko case yet.
m
I see, it will unlock a lot of new possibilities, for example you can get glyph bounds and you can use it to calculate specific text tight bounds for example, and it enables modifying the text without breaking it since annotated string has some limitations and can break linked characters. I hope that we can have it for skiko it would be great, you should watch the talk guys maybe you will give it a higher priority xD.
i
On Android text layouting is entirely different and bases on primitives that implemented on JVM side. Skiko on other hand uses C++
SkParagraph
and many things are just not exposed to managed world at all. That's why I think that override canvas method is just the tip of the iceberg. I was on another talk and didn't watch this one, so I'm not quite sure what exact APIs will be required
m
I see thanks for the response. Let's hope that we can have this at some point. Even for Android I don't think that it was intended, but it ended up working fine and being useful