How to draw an outline around a text

I did what you suggested and the result is good enough for me. I knew I could count on you :wink:
Something like that:

juce::Path textPath;
juce::GlyphArrangement glyphs;
glyphs.addFittedText( font, getName(), x, y, w, h, juce::Justification::centred, 2);
glyphs.createPath(textPath);

g.setColour (juce::Colours::white);
juce::PathStrokeType strokeType(2.5f);
g.strokePath(textPath, strokeType);
g.setColour (juce::Colours::black);
g.fillPath(textPath);

I mean, it doesn’t look as good a I expected, but it’s ok. I’ll have a look at your XOR suggestion when I have some time :slight_smile:

2 Likes