Has anyone faced an issue with a Font like this so...
# compose
y
Has anyone faced an issue with a Font like this so picture 1 represents a text with a font, for some reason, some characters go back to the line even though the text is set on (no idea why it overFlows)
Copy code
softWrap = false,
overflow = TextOverflow.Visible,
since it was someHow an overFlow I even tried this
Copy code
onTextLayout = { textLayoutResult ->
    while (textLayoutResult.hasVisualOverflow) {
        println("has overFlow")
        annotatedStringDFontSize -= 1f
    }
},
but nothing it just keeps on printing overFlow, I even tried to only set the first word but somehow its still got an overFlow if I apply maxLines = 1, then the characters will be invisible as shown in picture 2. if I use another font the default font for example it works fine without even including maxLines = 1 as shown in picture 3. Has anyone faced an issue like this?
b
is "has overflow" printed?
I even tried to only set the first word but somehow its still got an overFlow
how can it overflow with a single word?
My arabic is pretty poor but what I don't understand about the text is. I can see the kaaf in picture 1 that has gone onto a second line (twice), correct? But in picture 2 there is no kaaf at all? And then I can see it on the same line in picture 3
so it seems like a problem with the font itself rather than compose? Considering the font in picture 3 manages to join the kaaf correctly, but in picture 2 the kaaf is missing?
Maybe explore the font file that is used in picture 1
y
https://kotlinlang.slack.com/archives/CJLTWPH7S/p1716391195580139?thread_ts=1716378190.156309&cid=CJLTWPH7S the kaf gets removed because i add maxlines = 1, for picture 3 i use a different dfont
the problem is clearly from the font but this is the font I want to use and there is nothing out there like it
👍 1
b
can you share the font? I wonder if you open it in a font editing tool you can notice any issues with Kaf
b
If you use this website https://fontdrop.info/#/?darkmode=true and go to the "OT" tab (OpenType) it looks like Kaf in the final position does not join in your font? But in your picture 3 it is joined. I could be totally wrong here, a little out my depth tbh 🙂 but you can use this tool to explore your font (and then explore other fonts you know work as a comparison)
I could be completely wrong as well of course and this is a compose issue 😄 😅
y
thank you so much but picture 3 is a total different font
b
yes that's what I mean, in picture 3 it is using the joined Kaf (correctly) in the final position, but looking in the file for your font (picture 1) it is not joined
1
fontdrop also has a free text field, perhaps you could do some experimentation
👍 1
y
so the issue turned out to be more than a font thing because I think the font is innocent I have normal text when I use this text with the font it works great like shown in the picture bellow but then I have tajweed text, it comes in a form of htlm I then convert it to annotating string and it comes out lie shown in the previous picture the issue is related to how i am converting the thing is that i don't see any issues while converting it maybe if i give you the code of how i am converting could you help ?
b
can’t promise anything, but I can always look 😅