#601 Reduce the EMF output

closed-accepted
nobody
None
5
2012-09-12
2012-08-30
Shigeharu TAKENO
No

Current EMF terminal puts some unnecessary commands for
set_font and set_dasytype. Attached patch enable to reduce
the output size by ignoring such commands.

Discussion

1 2 > >> (Page 1 of 2)
  • a patch for emf.trm

     
    Attachments
  • Ethan Merritt
    Ethan Merritt
    2012-08-30

    • status: open --> open-accepted
     
  • Ethan Merritt
    Ethan Merritt
    2012-08-30

    Thank you very much for reporting the problem and for providing a patch.

    As to EMF_set_font, I have applied a slightly different fix guided by your patch.

    As to EMF_dashtype, it seems that the dash assignment code has been broken in EMF for a long time. I applied a simple fix for the broken code, but after this fix your patch no longer matches the code. Can you confirm that the dashed lines now work correctly, for example in dashcolor.dem? I do not know if a revised version of your patch is still needed to prevent unnecessary linetyps requests in the output file.

     
  • a patch for new emf.trm

     
    Attachments
  • snapshot of 1st emf file of dashcolor.dem

     
    Attachments
  • snapshot of 2nd emf file of dashcolor.dem

     
    Attachments
  • I made a patch emf-reduce-3.diff for new emf.trm. I attached snapshot data
    of emf output for dashcolor.dem. Original gnuplot puts the emf file which have:

    CreatePen
    DeleteObject <- Pen
    CreatePen
    ...

    and

    CreateFontIndirect
    DeleteObject <-- Font
    CreateFontIndirect
    ...

    The patch reduce such codes. Indeed, the emf file sizes of dashcolor.dem are:
    1st page: 37948 byte (2158 EMR records) -> 35932 byte (2051 EMR records)
    2nd page: 99616 Byte (5928 EMR records) -> 82552 byte (4951 EMR records)

     
  • Ethan Merritt
    Ethan Merritt
    2012-09-04

    Thanks. The patch looks good. But there is one part I do not understand. Can you explain what is the purpose of these instructions?

    EMF_SelectObject(EMF_STOCK_OBJECT_BLACK_PEN);
    EMF_SelectObject(EMF_STOCK_OBJECT_WHITE_BRUSH);

    These commands appear in more than one place.
    Since gnuplot always defines and uses its own PEN and BRUSH objects, I don't understand the reason for temporarily selecting the STOCK_OBJECT ones?

     
  • Ethan Merritt
    Ethan Merritt
    2012-09-12

    • status: open-accepted --> closed-accepted
     
1 2 > >> (Page 1 of 2)