I'm rendering a lot of text from multiple fonts with special positioning, so I've added a system which generates images of the text using the multiple fonts and it works pretty well. i can render the images using drawImageAt. however, I noticed when I compared it to drawSingleLineText that a lot of clarity in the image is lost. Take a look at the following picture:
that is created with the following code:
void MainContentComponent::paint(Graphics &g) { g.fillAll(Colours::lightblue); { Image n(Image::ARGB, 300, 200, false ); Graphics j(n); j.setColour(Colours::black); j.setFont(textFont->font); j.setFont( 36 ); j.drawSingleLineText("ABCDEFG", 20, 50); g.setImageResamplingQuality(Graphics::ResamplingQuality::highResamplingQuality); g.drawImageAt(n, 0, 30 ); } g.setColour(Colours::black); g.setFont(textFont->font); g.setFont( 36 ); g.drawSingleLineText("ABCDEFG", 20, 50); }
Why is clarity lost when using DrawImageAt compared to drawSingleLineText? I tried it with "j.setImageResamplingQuality()" before I did any drawing in the section drawing onto Graphics j, but it made no difference. the text still looked like it was bold compared to the drawSingleLineText() version.