Render String with Newlines


#1

I would like to render a string with newline characters in an application I am making. I tried using graphics class drawText function, but this ignores newlines, treating them as spaces instead. What class should I use to accomplish this?

Thanks!


#2

Can you please post the code that you tried? I think I had it working somewhere…


#3

void MyPluginAudioProcessorEditor::paint (Graphics& g){

g.drawText(“New\nLine”, 15, 10, 200, 160, true);

}

In PluginEditor.cpp of a JUCE audio plugin project.


#4

Graphics::drawFittedText()

Rail


#5

Graphics::drawFittedText()

That worked. Thanks!