|
|
It could be rotated text, how do I rotate it?
Em quarta-feira, 11 de agosto de 2021 às 15:44:33 UTC+1, Ian MacArthur escreveu:
Hi, I'm trying to put vertical text in a button, I'm using the \n newline, but the vertical spacing is too big, is it possible to put less spacing?Thanks
OK, so I interpret your question like this: You have a tall, thin button and are setting this label as "T\nh\ni\ns" to try and get (ASCII art alert!)
----- | T | | h | | i | | s | -----
Is that correct? If so, there might be no trivial answer... Note that to keep things simple, fltk just uses the line height to set the vertical spacing, so it is not readily changed (it is tied to the font size, in effect.) In the past, I have derived my own button and then used fl_text_extents() to measure the minimum bounds around each glyph and position it suitably, but that's a fair bit of work. (Contrast with fl_measure() which will use a vertical bound based on the line spacing, which is in essence what you are seeing at present.) An alternative, if you derive your own button, might be to just rotate the entire label 90 degrees (without the embedded "\n" in the labels) and see how that looks. The "rotated_text" demo illustrates that approach - though I do not know if that would be any use to you or not.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/8d0968e3-1d57-4da6-ac26-085d4fb90fe3n%40googlegroups.com.
[ Direct Link to Message ] | |
|
| |