FOP
  1. FOP
  2. FOP-2032

[PATCH] How to use native text with EPSDocumentGraphics2D

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: trunk
    • Fix Version/s: None
    • Component/s: renderer/ps
    • Labels:
      None
    • Environment:
      Operating System: Mac OS X 10.4
      Platform: PC
    • External issue ID:
      52966

      Description

      As reported recently in the users mailing list the code:

      OutputStream out = new FileOutputStream("mini-test.eps");
      EPSDocumentGraphics2D g2d = new EPSDocumentGraphics2D(false);
      g2d.setGraphicContext(new GraphicContext());
      g2d.setCustomTextHandler(new NativeTextHandler(g2d, null));
      g2d.setupDocument(out, 200, 100);
      g2d.setFont(new Font("Helvetica", Font.PLAIN, 12));
      g2d.drawString("Hi there", 50, 50);
      g2d.finish();
      out.close();

      generates invalid EPS files.

      1. fop.patch
        7 kB
        Luis Bernardo
      2. ExampleEPSSimple.java
        2 kB
        Luis Bernardo

        Activity

        Hide
        Luis Bernardo added a comment -

        fop-eps.xconf is used by one of the examples. it shows how to configure fonts. maybe the place was not the best but the file is needed to run the embedding.ExampleEPS example.

        Show
        Luis Bernardo added a comment - fop-eps.xconf is used by one of the examples. it shows how to configure fonts. maybe the place was not the best but the file is needed to run the embedding.ExampleEPS example.
        Hide
        Glenn Adams added a comment -

        patch landed at http://svn.apache.org/viewvc?view=revision&revision=1311103, with the exception of examples/fop-eps.xconf, which i excluded since it doesn't appear to be an appropriate place to put it (nor is it otherwise used by the example)

        thanks luis!

        Show
        Glenn Adams added a comment - patch landed at http://svn.apache.org/viewvc?view=revision&revision=1311103 , with the exception of examples/fop-eps.xconf, which i excluded since it doesn't appear to be an appropriate place to put it (nor is it otherwise used by the example) thanks luis!
        Hide
        Glenn Adams added a comment -

        increase priority due to presence of a patch

        Show
        Glenn Adams added a comment - increase priority due to presence of a patch
        Hide
        Glenn Adams added a comment -

        resetting P2 open bugs to P3 pending further review

        Show
        Glenn Adams added a comment - resetting P2 open bugs to P3 pending further review
        Hide
        Luis Bernardo added a comment -

        added patch tag

        Show
        Luis Bernardo added a comment - added patch tag
        Hide
        Luis Bernardo added a comment -

        Attachment fop.patch has been added with description: a proposed fix, and two examples and a conf file

        Show
        Luis Bernardo added a comment - Attachment fop.patch has been added with description: a proposed fix, and two examples and a conf file
        Hide
        Luis Bernardo added a comment -

        Attachment ExampleEPSSimple.java has been added with description: an example to test

        Show
        Luis Bernardo added a comment - Attachment ExampleEPSSimple.java has been added with description: an example to test

          People

          • Assignee:
            fop-dev
            Reporter:
            Luis Bernardo
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development