Adjusting global size for custom typeface in L&F


#1

Hi all:

My latest GUI is coming together, except that the slider values are in too small of a font. Do I need to override this in a slider-specific LookAndFeel class method, or is there a global font/typeface size that I can specify in my LookAndFeel? I’m using a custom typeface, if this matters.

Thanks,

Sean Costello


#2

There’s no custom size because the components all choose their own size, but you can set the default typefaces with the l+f class.


#3

I can’t find where the Slider textbox font size is set in the default L&F. Where should I look?

Sean


#4

It’s actually a Label component embedded in the slider.


#5

So, how does one change the font size dynamically in the Slider text editor? I tried updating the Font in Label* LookAndFeel::createSliderTextBox (Slider& slider), but this has erratic behavior, and I’m not sure how to call this in the resized() function. The label is declared privately in the Slider class, so my own slider class can’t change the font size directly.

Thanks in advance for your help,

Sean Costello


#6

It uses a Label in the slider, so can’t you just customise the slider’s L+F to make it draw the label the way you want it?


#7

My bad. It turns out I wasn’t calling the Slider setTextBoxStyle() function in my resizing code.

Sean Costello