FLTK logo

RE: [fltk.general] Re: Fl_Button label line spacing

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

RE: Re: Fl_Button label line spacing "'Philip Rose' via fltk.general" Aug 11, 2021  
 

Hi Daniel,

 

Read Ian’s reply to you. He has pointed out a particular demo (rotated_text) to look at. It’ll be in the fltk package somewhere.

 

Phil.

 

Sent from Mail for Windows

 

From: Daniel Santos
Sent: 11 August 2021 16:15
To: fltk.general
Subject: [fltk.general] Re: Fl_Button label line spacing

 

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:

On Wednesday, 11 August 2021 at 13:55:17 UTC+1 supe...@gmail.com wrote:

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.

 

--
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/6113ed5f.1c69fb81.33994.8397SMTPIN_ADDED_BROKEN%40gmr-mx.google.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.