[AGAIN]Printing text as text using printer.?

Do we have any thing for printing text as text.? LowLevelGraphicsPostScriptRenderer does allow us to print image very easily, but what do we need to do for text.? Printting text as image would be bad idea so is there anything that can help.?

LowLevelGraphicsPostScriptRenderer?

Sorry mis-typed in hurry.. yah ofcourse its LowLevelGraphicsPostScriptRenderer. 

It handles paths - the best way to do text would be to convert it to a path and print that, I guess.

1 Like

Sorry to bother you but i tried doing it using path i still didn't get it. Can you please give me a little hint about what to use.?

Thanks for your reply.

Try GlyphArrangement::createPath()

1 Like

Thank jules for your reply. i got it working. Here is how i hot that may be this will useful to others in future.

 


        MemoryOutputStream out;
        Graphics g (myImage);
        LowLevelGraphicsPostScriptRenderer low(out, "hi", 600, 842);
        juce::Path textPath;
        juce::GlyphArrangement glyphs;
        glyphs.addFittedText(juce::Font(12), "Hitesh", 5, 50, 600, 842, juce::Justification::left, 2);
        glyphs.createPath(textPath);
        g.setColour (juce::Colours::white);
        juce::PathStrokeType strokeType(2.5f);
        g.strokePath(textPath, strokeType);
        g.setColour (juce::Colours::black);
        low.fillPath(textPath, juce::AffineTransform());
2 Likes

oh yes, it is! just around 2 days ago i asked myself similiar questions. this is a great post to summarize the solution