what is the correct api if we want to draw text wi...
# compose
m
what is the correct api if we want to draw text with a border ?
the letters with ‘stroke’ style, not adding a border to the overall text
c
I think this was just added to the latest 1.4.0-alpha
I did use it once already. trying to look it up.
m
nah thanks i got it! i saw that already:P was not sure was only supported in latest release
cool. yeah. it was added very recently
m
is there any way i can have Fill and Stroke at the same time?
I can do it with overlapped text, but it must be a way
z
You can also draw border with modifiers
c
@Halil Ozercan?
m
@Zaki Shaikh border in the text with modifiers? You sure
z
@myanmarking Yes
Copy code
Text(
        text = "Zaki",
        modifier = Modifier
            .padding(16.dp)
            .border(width = .5.dp, color =   Color.Black)
            .padding(16.dp)
    )
m
you sure that adds borders to the text letters and not the text container?
if so, that is genius
z
I presumed that you wanted to draw around it
m
yes, you didnt read the whole thread 😛 i want stroked text
not decorate the container
z
Yes 😀
m
ok, so that means you were wrong? im confused oO
z
Yes I am wrong
m
oh ok. thanks for the help anyway 😛
i want text with color and border. it doesnt seems to be a way with this new api. still checking
z
If I got something will share with I am too curious for bordered text
m
yes. you can have bordered text with this api. just not stroke+fill
z
Can you show prototype what you actually want
m
message has been deleted
managed to do it with two overlaped text. one with new stroke api. other with normal colored text
h
Yep, that's the only way to do it due to a limitation in Android. This was already discussed here https://kotlinlang.slack.com/archives/CJLTWPH7S/p1661873770079459?thread_ts=1661873770.079459&cid=CJLTWPH7S