You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Greg Brown (JIRA)" <ji...@apache.org> on 2010/09/18 15:15:33 UTC

[jira] Commented: (PIVOT-511) Print doesn't work on Labels

    [ https://issues.apache.org/jira/browse/PIVOT-511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12911016#action_12911016 ] 

Greg Brown commented on PIVOT-511:
----------------------------------

This appears to be due to our use of font rendering hints provided by the platform to draw text. On Windows, these hints seem to be appropriate for the screen but not for the printer.

The fix will require us to check for a PrintGraphics in our paint() methods that draw text and use a default font render context rather than the platform font render context in those cases. Instead of this:

    FontRenderContext fontRenderContext = Platform.getFontRenderContext();

we'll do this:

    FontRenderContext fontRenderContext;
    if (graphics instanceof java.awt.PrintGraphics) {
        fontRenderContext = new FontRenderContext(null, false, false);
    } else {
        fontRenderContext = Platform.getFontRenderContext();
    }

I have prototyped this in LabelSkin and it resolves the problem.



> Print doesn't work on Labels
> ----------------------------
>
>                 Key: PIVOT-511
>                 URL: https://issues.apache.org/jira/browse/PIVOT-511
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk, wtk-terra
>            Reporter: Sandro Martini
>            Assignee: Sandro Martini
>             Fix For: 2.0
>
>         Attachments: Kitchen Sink _ Apache Pivot 1.4.pdf, Kitchen Sink _ Apache Pivot 1.5.pdf, Stock Tracker _ Apache Pivot 1.4.pdf, Stock Tracker _ Apache Pivot 1.5.pdf
>
>
> From a Browser, Printing a page, for some reason I have all Labels not in output (see attached pdf, but the same happens with a print to paper).
> With 1.4 it was not so good but labels were present, while in current 1.5 pre-release it seems that all is present but not labels.
> This should be a great fix to have in the final 1.5
> This happens on Win XP and Windows 7, both from latest Firefox and IE 8, and on all Pivot Applets.
> Sandro

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.