#648 pattern fill for emf terminal

None
closed-accepted
nobody
None
5
2013-12-11
2013-11-28
No

This patch enable us to use pattern fill in emf terminal similarly to win terminal, and so on. I use bitmap patterns defined in src/win/wgraph.c.

1 Attachments

Discussion

  • Ethan Merritt

    Ethan Merritt - 2013-11-30

    Thank you for this patch.

    The basic code seems sound in testing, but I found a couple of things that need to be fixed before the patch can be applied for a code release.

    1) Any text strings written after drawing a pattern fill area are given the same color as the pattern fill. This can be fixed by making the program aware that the text color has been changed:
    if( ... ) {
    emf_textcolor = color;
    EMF_SetTextCol(emf_textcolor);
    EMF_CreateMonoBrush(EMF_HANDLE_BRUSH);

    2) The pattern fill itself is not interpreted correctly by programs I used for testing. LibreOffice shows only a solid white fill. MSword running under linux and the generic Windows viewer ENHMETA.EXE show the correct fill pattern lines but also show a dense set of horizontal lines that obscure the pattern. I cannot figure out why this happens, but I wonder if the correct EMF command is EMR_CREATEDIBPATTERNBRUSHPT rather than EMR_CREATEMONOBRUSH?

    I did not test using current Windows 7. It may work correctly there, but it would be nice to have it work for other programs (LibreOffice) and other Windows versions as well.

    Could you have a look at these issues and post a revised patch?

     
  • Shigeharu TAKENO

    | 1)

    | This can be fixed by making the program aware that the text
    | color has been changed:

    Thanks.

    | 2) The pattern fill itself is not interpreted correctly by
    | programs I used for testing. LibreOffice shows only a solid
    | white fill. MSword running under linux and the generic Windows
    | viewer ENHMETA.EXE show the correct fill pattern lines but also
    | show a dense set of horizontal lines that obscure the pattern.
    | I cannot figure out why this happens, but I wonder if the
    | correct EMF command is EMR_CREATEDIBPATTERNBRUSHPT rather than
    | EMR_CREATEMONOBRUSH?

    I couldn't put patterns by using EMR_CREATEDIBPATTERNBRUSHPT.
    My patch is based on the output of "Save as EMF" faculty on win
    terminal. The file makes hatch patterns using
    EMF_CREATEMONOBRUSH.

    I am sure that LibreOffice don't show the pattern included in
    the emf file made by emf terminal with my patch. But it
    also don't show the pattern in the emf file made by "Save as
    EMF" on win terminal. So, it may not only be the problem of
    EMF_CREATEMONOBRUSH but also of Libre/OpenOffice.

    I don't see the dense set of horizontal lines which you saw.
    What I see on WinXP is the following:

    http://takeno.iee.niit.ac.jp/~shige/unix/gnuplot/data/emf-patfill-463-1.gif
    http://takeno.iee.niit.ac.jp/~shige/unix/gnuplot/data/emf-patfill-new-1.gif
    (1st one is by gnuplot-4.6.3, 2nd one is by cvs version with my patch.)

    New patch emf-patfill-2.diff is modified for your suggestion 1)
    and for removing an useless line of my patch, but not for
    EMF_CREATEDIBPATTERNBRUSHPT.

     
  • Ethan Merritt

    Ethan Merritt - 2013-12-11
    • status: open --> closed-accepted
    • Group: -->
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks