JUCE Gradient and Text Filling

Hello, rebuilding a Juce 7 project in 8 gives an issue with gradient filling:

The code is:

juce::Colour tt = juce::Colour::fromString("0x00deff").withAlpha(0.75f);
        juce::ColourGradient cg = juce::ColourGradient::horizontal(juce::Colours::white.withAlpha(0.85f).brighter(), 0.0, tt, nameBounds.getWidth());
        g.setGradientFill(cg);
        g.drawText("EXAMPLE TEXT", nameBounds.withSizeKeepingCentre(width*0.2f, height*0.3f), Justification::centred);

in juce 7 i was getting the text with a nice gradient color. Here instead I’m getting the Fill of the entire current bounds.

Any workaround?

Thanks

Please can you let us know the following:

  • On which OS (mac/windows/linux) and version do you see this problem?
  • Do you see this issue with all fonts, or just specific fonts?
  • Exactly which version of JUCE are you testing? If you haven’t tried 8.0.3, is the issue still present there?

I fixed this via JUCE 8 gradient text - #2 by onereddog

Juce 8.0.3 / Sequoia / Xcode 16.

I’m using this font SF UI Display Regular : Download For Free, View Sample Text, Rating And More On Fontsgeek.Com

Thanks, I can reproduce the issue and there’s a fix on the way.

Amazing Thank you!

The fix for this issue is now available on the develop branch:

1 Like

After this fix, the fonts do render, but they look thinner.
Please advise

Could you share an example?

  • Do you mean with a gradient fill or with any fill?
  • What font are you using?
  • What font settings are you using (style/size)?
  • How does the same font/style/size render in other apps or the web?
  • What platform / OS are you testing on?
    • Have you tested on others?
    • If so is the result the same?