Rebol Draw: how to center text inside a box?
-
16-09-2019 - |
Question
I want to center "Your Banner Text" but don't know how to calculate the text width
view layout [
box white 728x90 effect [
draw [
text 100x20 "Your Banner Text"
]
]
]
Solution
Here's a way of doing it by putting text straight into the box instead of using the DRAW dialect:
view layout [
box white 728x90 font [align: 'center] "Your banner text"
]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow