# Adjusting global size for custom typeface in L&F

**URL:** <https://forum.juce.com/t/adjusting-global-size-for-custom-typeface-in-l-f/6424>\
**Category:** General JUCE discussion\
**Created:** [February 15, 2011, 9:20am UTC](https://forum.juce.com/t/adjusting-global-size-for-custom-typeface-in-l-f/6424 "2011-02-15T09:20:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![valhalladsp](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/valhalladsp/32/71_2.png) [@valhalladsp](https://forum.juce.com/u/valhalladsp)\
**Post date:** [February 15, 2011, 9:20am UTC](https://forum.juce.com/t/adjusting-global-size-for-custom-typeface-in-l-f/6424/1 "2011-02-15T09:20:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 15, 2011, 8:43pm UTC](https://forum.juce.com/t/adjusting-global-size-for-custom-typeface-in-l-f/6424/2 "2011-02-15T20:43:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![valhalladsp](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/valhalladsp/32/71_2.png) [@valhalladsp](https://forum.juce.com/u/valhalladsp)\
**Post date:** [February 15, 2011, 11:59pm UTC](https://forum.juce.com/t/adjusting-global-size-for-custom-typeface-in-l-f/6424/3 "2011-02-15T23:59:08Z")

</div>

> [@jules](#):
>
> 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.

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

Sean

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [February 16, 2011, 9:09am UTC](https://forum.juce.com/t/adjusting-global-size-for-custom-typeface-in-l-f/6424/4 "2011-02-16T09:09:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![valhalladsp](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/valhalladsp/32/71_2.png) [@valhalladsp](https://forum.juce.com/u/valhalladsp)\
**Post date:** [August 2, 2011, 7:44pm UTC](https://forum.juce.com/t/adjusting-global-size-for-custom-typeface-in-l-f/6424/5 "2011-08-02T19:44:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [August 2, 2011, 8:07pm UTC](https://forum.juce.com/t/adjusting-global-size-for-custom-typeface-in-l-f/6424/6 "2011-08-02T20:07:33Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![valhalladsp](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/valhalladsp/32/71_2.png) [@valhalladsp](https://forum.juce.com/u/valhalladsp)\
**Post date:** [August 2, 2011, 9:28pm UTC](https://forum.juce.com/t/adjusting-global-size-for-custom-typeface-in-l-f/6424/7 "2011-08-02T21:28:21Z")

</div>

> [@jules](#):
>
> 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?

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

Sean Costello
