Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Text overflow in BlockComposer

Help
Anonymous
2012-03-23
2013-01-26

  • Anonymous
    2012-03-23

    I am writing some text using the block composer. Aligned right, but some of the text overflows.
    Using the freebooterscript.ttf font - http://www.fontsquirrel.com/fonts/Freebooter-Script

    How can I make sure the text is 100% bound within the box?

    See the image here.
    http://tinypic.com/view.php?pic=f4eg40&s=5

        Rectangle2D frame = new Rectangle2D.Double(182,140, 340, 50);
        BlockComposer blockComposer = new BlockComposer(composer);
        blockComposer.begin(frame,XAlignmentEnum.Right,YAlignmentEnum.Top);
       
        composer.setFont(scriptFont,24);
        blockComposer.showText("ABCDefff");
        blockComposer.end();
       
        composer.drawRectangle(frame.getBounds());
        composer.stroke();

     
  • I have to verify what went wrong in font metrics extraction.

    thank you for your report.
    Stefano