https://kotlinlang.org logo
#compose
Title
# compose
s

Sergey Y.

02/23/2021, 1:50 PM
Hi, I am working on some functionality in our application that requires the render of single-stroke fonts for cutting. Unfortunately android cannot display such fonts correctly, so we use the
Freetype Harfbazz
library to render individual glyphs as a sequence of vector paths. Now I'm looking for an option how this can be integrated into the pipeline of the standard android input system, and with the Compose(I'm considering CoreTextField). In the case of working with a regular
EditText
, it seems to me that I will need to rewrite everything from scratch(cursor, line break, context menu, text selection, etc.). But since the Compose has platform(android, desktop) implementations of text input, that means it uses abstractions around working with text. Which means it is should be possible to change implementation. I found an abstraction like Paragraph and its platform implementation for Android AndroidParagraph, which under the hood uses the TextLayout wrapper for StaticLayout class. And a MultiParagraph class that uses the above Paragraph. I would like to replace the implementation for the
AndroidParagraph
with my own but it seems that I do not see how this could be done. I would be apprecited any help. Thanks.
j

jim

02/23/2021, 1:54 PM
cc @Siyamed
🤗 1
s

Siyamed

02/24/2021, 2:35 AM
Looks like a Paragraph / module / factory would be required if you'd like to replace those. Can you please create a ticket about it?
What is single stroke font?
Actually why so you use single strike font in TextField? I wondered about the use case which sounds interesting
2 Views