06517eb74772b7c18a8ab8d703405646d9ec05d3mathoglibUEMF is a portable C99 implementation for reading/writing Enhanced Metafile (EMF),
06517eb74772b7c18a8ab8d703405646d9ec05d3mathogEnhanced Metafile Format Plus (PMF), and Windows Metafile (WMF) files. libUEMF
06517eb74772b7c18a8ab8d703405646d9ec05d3mathogavoids collisions with Microsoft defined functions and values, so portable programs
06517eb74772b7c18a8ab8d703405646d9ec05d3mathogwhich use it and have a Windows version, do not require any conditional logic to
06517eb74772b7c18a8ab8d703405646d9ec05d3mathogseparate the native GDI support from the WMF/EMF/PMF support proviced by libUEMF. To
06517eb74772b7c18a8ab8d703405646d9ec05d3mathogaccomplish this libUEMF does not implement GDI calls. Instead, for each WMR/EMR/PMR
06517eb74772b7c18a8ab8d703405646d9ec05d3mathogrecord type, and each object type incorporated into such a record, it provides
06517eb74772b7c18a8ab8d703405646d9ec05d3mathogcorresponding *_set, *_print, and *_swap functions. For PMF and WMF there are also
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog*_get functions, see below. For example, for the U_EMRBITBLT record there are
06517eb74772b7c18a8ab8d703405646d9ec05d3mathogcorresponding functions: U_EMRBITBLT_set, U_EMRBITBLT_print, and U_EMRBITBLT_swap. A
06517eb74772b7c18a8ab8d703405646d9ec05d3mathogfew additional functions are provided for assembling the EMF in memory, debugging, and
06517eb74772b7c18a8ab8d703405646d9ec05d3mathogconverting the EMF file to/from Little Endian representation. (EMF files' internal
06517eb74772b7c18a8ab8d703405646d9ec05d3mathogdata representation is always Little Endian.)
06517eb74772b7c18a8ab8d703405646d9ec05d3mathogThis code has been tested on 32 bit Ubuntu (LE), 32 bit Mingw, 64 bit Mageia, and 64
06517eb74772b7c18a8ab8d703405646d9ec05d3mathogbit Solaris (BE).
1df6105803c4c56c020a56301c7c9c4890fd4158mathoglibUEMF is released under the GPL 2 license, read the file 'COPYING' for more information
06517eb74772b7c18a8ab8d703405646d9ec05d3mathogVersion 0.2.1, released April 23, 2015.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogTo report bugs or provide feedback send email to David Mathog, mathog@caltech.edu.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog--------------------------------------------------------------------------------------------
1df6105803c4c56c020a56301c7c9c4890fd4158mathogEMF file Record structure information has been derived from Mingw, Wine, and libEMF
1df6105803c4c56c020a56301c7c9c4890fd4158mathogheader files, and from Microsoft's EMF Information pdf, release date March 28,2012,
1df6105803c4c56c020a56301c7c9c4890fd4158mathoglink from here:
1df6105803c4c56c020a56301c7c9c4890fd4158mathog http://msdn2.microsoft.com/en-us/library/cc230514.aspx
1df6105803c4c56c020a56301c7c9c4890fd4158mathogIf the direct link fails the document may be found
1df6105803c4c56c020a56301c7c9c4890fd4158mathogby searching the web for: "[MS-EMF]: Enhanced Metafile Format".
1df6105803c4c56c020a56301c7c9c4890fd4158mathogWMF file Record structure information is from some of the same sources, as well as:
1df6105803c4c56c020a56301c7c9c4890fd4158mathogIf the direct link fails the document may be found
1df6105803c4c56c020a56301c7c9c4890fd4158mathogby searching the web for: "[MS-WMF]: Windows Metafile Format"
1df6105803c4c56c020a56301c7c9c4890fd4158mathogEMF+ file Record structure is from many helpful responses from Microsoft documentation support
1df6105803c4c56c020a56301c7c9c4890fd4158mathog http://msdn.microsoft.com/en-us/library/cc230724.aspx
1df6105803c4c56c020a56301c7c9c4890fd4158mathogIf the direct link fails the document may be found
1df6105803c4c56c020a56301c7c9c4890fd4158mathogby searching the web for: "[MS-EMFPLUS]: Enhanced Metafile Format Plus Extensions"
1df6105803c4c56c020a56301c7c9c4890fd4158mathogREADME This file.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogCOPYING GPL V2 license file.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogDOXYFILE Doxygen configuration file, for generating documentation from the source files.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogtestbuild.sh Small bash script to build all programs. Modify as needed for target platform.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogtestit.sh Small bash script that generates all test files and compares
1df6105803c4c56c020a56301c7c9c4890fd4158mathog them with referencess supplied. This script should be edited
1df6105803c4c56c020a56301c7c9c4890fd4158mathog to match your test system before it is run!
1df6105803c4c56c020a56301c7c9c4890fd4158mathoguemf.c Contains the *_set functions needed to construct an EMF file.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Also contains auxilliary functions for debugging and constructing
1df6105803c4c56c020a56301c7c9c4890fd4158mathog EMF files in memory.
1df6105803c4c56c020a56301c7c9c4890fd4158mathoguemf.h Definitions and structures for EMF records and objects.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Prototypes for *_set and construction functions.
1df6105803c4c56c020a56301c7c9c4890fd4158mathoguemf_print.c Contains the *_print functions needed to print the contents of EMF records and objects.
1df6105803c4c56c020a56301c7c9c4890fd4158mathoguemf_print.h Prototypes for *_print functions.
1df6105803c4c56c020a56301c7c9c4890fd4158mathoguemf_endian.c Contains the *_swap functions needed to rearrange bytes between Big and Little Endian.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog U_emf_endian() is the only function here that user could should call.
1df6105803c4c56c020a56301c7c9c4890fd4158mathoguemf_endian.h Prototype for U_emf_endian() and definitions for Endian type of the local machine.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathoguemf_safe.c Contains the *_safe functions for EMF records, which verify that all
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog offsets and counts stay within the declared size of a record. Also checks that
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog core record sizes are sane. U_emf_record_safe() is the only _safe function which
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog user code should call directly, and then ONLY after a previous call to
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog U_emf_record_sizeok(), which is in the endian file.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathoguemf_safe.h Prototype for U_emf_record_safe().
1df6105803c4c56c020a56301c7c9c4890fd4158mathogupmf.c Contains the *_set and *_get functions needed to construct or read an EMF+ file.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Also contains auxilliary functions for debugging and constructing
1df6105803c4c56c020a56301c7c9c4890fd4158mathog EMF+ files in memory.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogupmf.h Definitions and structures for EMF+ records and objects.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Prototypes for *_set, *_get and construction functions.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogupmf_print.c Contains the *_print functions needed to print the contents of EMF+ records and objects.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogupmf_print.h Prototypes for *_print functions.
1df6105803c4c56c020a56301c7c9c4890fd4158mathoguwmf.c Contains the *_set and *_get functions needed to construct or read a WMF file.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Also contains auxilliary functions for debugging and constructing
1df6105803c4c56c020a56301c7c9c4890fd4158mathog WMF files in memory.
1df6105803c4c56c020a56301c7c9c4890fd4158mathoguwmf.h Definitions and structures for WMF records and objects.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Prototypes for *_set, *_get and construction functions.
1df6105803c4c56c020a56301c7c9c4890fd4158mathoguwmf_print.c Contains the *_print functions needed to print the contents of WMF records and objects.
1df6105803c4c56c020a56301c7c9c4890fd4158mathoguwmf_print.h Prototypes for *_print functions.
1df6105803c4c56c020a56301c7c9c4890fd4158mathoguwmf_endian.c Contains the *_swap functions needed to rearrange bytes between Big and Little Endian.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog U_wmf_endian() is the only function here that user could should call.
1df6105803c4c56c020a56301c7c9c4890fd4158mathoguwmf_endian.h Prototype for U_wmf_endian() and definitions for Endian type of the local machine.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogtestbed_emf.c Program used for testing emf functions in libUEMF. Run it like: testbed_emf flags.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Run with no argument to see what the bit flag values are.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog It creates a test file "test_libuemf.emf" which should be identical to
1df6105803c4c56c020a56301c7c9c4890fd4158mathog test_libuemf_ref.emf. (This file cannot be imported from EMF into PowerPoint
1df6105803c4c56c020a56301c7c9c4890fd4158mathog because it contains dotted lines. Use "testbed_emf 1" to generate a file without
1df6105803c4c56c020a56301c7c9c4890fd4158mathog any dotted lines. )
1df6105803c4c56c020a56301c7c9c4890fd4158mathogtestbed_pmf.c Program used for testing EMF+ functions in libUEMF. Similar to testbed_emf.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogtestbed_wmf.c Program used for testing wmf functions in libUEMF. Similar to testbed_emf.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Program used for testing emf functions in libUEMF. Generates one test file
1df6105803c4c56c020a56301c7c9c4890fd4158mathog in each MAPMODE, MM_TEXT through MM_ANISOTROPIC, optionally with offsets to the
1df6105803c4c56c020a56301c7c9c4890fd4158mathog bounds and with particular Viewport origin. (Bounds offset + Viewport Origin
1df6105803c4c56c020a56301c7c9c4890fd4158mathog sets the Window origin.)
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Program used for testing wmf functions in libUEMF. Similar to test_mapmodes_emf.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogreademf.c Utility that that reads an EMF file and emits its contents in text form.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Also processes EMF+ files.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Run it like: reademf target_file.emf
1df6105803c4c56c020a56301c7c9c4890fd4158mathogreadwmf.c Utility that that reads an WMF file and emits its contents in text form.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Run it like: reademf target_file.wmf
1df6105803c4c56c020a56301c7c9c4890fd4158mathogcutemf.c Utility for removing specific records from an EMF file.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Run it like: cutemf '2,10,12...13' src_file.emf dst_file.emf
1df6105803c4c56c020a56301c7c9c4890fd4158mathogpmfdual2single.c Utility for reducing dual-mode EMF+ file to single mode. Removes all
1df6105803c4c56c020a56301c7c9c4890fd4158mathog nonessential EMF records.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Run it like: pmfdual2single dual_mode.emf single_mode.emf
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Example output from: testbed_emf 0
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Example output from: testbed_pmf 0
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Example output from: testbed_emf 4
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Example output from: testbed_wmf 0
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Example output from: reademf test_libuemf_ref.emf
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Example output from: readwmf test_libuemf_ref.wmf
1df6105803c4c56c020a56301c7c9c4890fd4158mathogtest_mm_<modes>_ref.emf
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Example output from: test_mapmodes_emf -vX 2000 -vY 1000
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Example code from Inkscape demonstrate how to integrate libUEMF with another program.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog--------------------------------------------------------------------------------------------
1df6105803c4c56c020a56301c7c9c4890fd4158mathogHow to Build:
1df6105803c4c56c020a56301c7c9c4890fd4158mathogIn Linux/Unix like environments (omit -g flag for production versions):
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Build and install a shared library (example, details may vary) and then build and link
1df6105803c4c56c020a56301c7c9c4890fd4158mathog the example programs to the shared library:
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -fPIC -g -c uemf.c
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -fPIC -g -c uemf_print.c
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -fPIC -g -c uemf_endian.c
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -fPIC -g -c uemf_utf.c
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -fPIC -g -c uwmf.c
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -fPIC -g -c uwmf_print.c
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -fPIC -g -c uwmf_endian.c
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -fPIC -g -c upmf.c
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -fPIC -g -c upmf_print.c
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -shared -Wl,-soname,libuemf.so.0 \
1df6105803c4c56c020a56301c7c9c4890fd4158mathog -o libuemf.so.0.0.3 uemf.o uemf_utf.o uemf_print.o uemf_endian.o uwmf.o uwmf_print.o uwmf_endian.o upmf.o upmf_print.o -lc
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -g -o cutemf cutemf.c -luemf -lm
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -g -o pmfdual2single pmfdual2single.c -luemf -lm
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -g -o reademf reademf.c -luemf -lm
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -g -o readwmf readwmf.c -luemf -lm
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -g -o testbed_emf testbed_emf.c -luemf -lm
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -g -o testbed_emf testbed_wmf.c -luemf -lm
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -g -o test_mapmodes_emf test_mapmodes_emf.c -luemf -lm
1df6105803c4c56c020a56301c7c9c4890fd4158mathog For simple development work just build the example programs statically linked:
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -g -o cutemf cutemf.c uemf.c uemf_endian.c uemf_utf.c -lm
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -g -o pmfdual2single pmfdual2single.c uemf.c uemf_endian.c uemf_utf.c upmf.c -lm
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -g -o reademf reademf.c uemf.c uemf_endian.c uemf_utf.c uemf_print.c upmf.c upmf_print.c -lm
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -g -o readwmf readwmf.c uemf.c uemf_endian.c uemf_utf.c uemf_print.c uwmf.c uwmf_endian.c uwmf_print.c upmf.c upmf_print.c -lm
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -g -o testbed_emf testbed_emf.c uemf.c uemf_endian.c uemf_utf.c -lm
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -g -o testbed_pmf testbed_pmf.c uemf.c uemf_endian.c uemf_utf.c upmf.c upmf.h -lm
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -g -o testbed_wmf testbed_wmf.c uemf.c uemf_endian.c uemf_utf.c uwmf.c uwmf_endian.c -lm
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -g -o test_mapmodes_emf test_mapmodes_emf.c uemf.c uemf_endian.c uemf_utf.c -lm
1df6105803c4c56c020a56301c7c9c4890fd4158mathogExtra debugging on linux may be enabled in testbed for use under Valgrind. To build that way do instead:
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -std=c99 -pedantic -Wall -g -DU_VALGRIND -o testbed_emf testbed_emf.c uemf.c uemf_endian.c uemf_print.c uemf_utf.c -lm
1df6105803c4c56c020a56301c7c9c4890fd4158mathogSparc Solaris 8 and 9 are Big Endian, and to work around some minor incompatibilities with more recent systems,
1df6105803c4c56c020a56301c7c9c4890fd4158mathogassuming gcc is installed in /opt/csw and PATH is set correctly to use it:
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -DSOL8 -DWORDS_BIGENDIAN -std=c99 -pedantic -Wall -g -o cutemf cutemf.c uemf.c uemf_endian.c uemf_utf.c -lm -L/opt/csw/lib -liconv
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -DSOL8 -DWORDS_BIGENDIAN -std=c99 -pedantic -Wall -g -o pmfdual2single pmfdual2single.c uemf.c uemf_endian.c uemf_utf.c upmf.c -lm -L/opt/csw/lib -liconv
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -DSOL8 -DWORDS_BIGENDIAN -std=c99 -pedantic -Wall -g -o reademf reademf.c uemf.c uemf_endian.c uemf_utf.c uemf_print.c upmf.c upmf_print.c -lm -L/opt/csw/lib -liconv
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -DSOL8 -DWORDS_BIGENDIAN -std=c99 -pedantic -Wall -g -o readwmf readwmf.c uemf.c uemf_endian.c uemf_utf.c uemf_print.c uwmf.c uwmf_endian.c uwmf_print.c upmf.c upmf_print.c -lm -L/opt/csw/lib -liconv
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -DSOL8 -DWORDS_BIGENDIAN -std=c99 -pedantic -Wall -g -o testbed_emf testbed_emf.c uemf.c uemf_endian.c uemf_utf.c -lm -L/opt/csw/lib -liconv
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -DSOL8 -DWORDS_BIGENDIAN -std=c99 -pedantic -Wall -g -o testbed_pmf testbed_pmf.c uemf.c uemf_endian.c uemf_utf.c upmf.c upmf.h -lm -L/opt/csw/lib -liconv
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -DSOL8 -DWORDS_BIGENDIAN -std=c99 -pedantic -Wall -g -o testbed_wmf testbed_wmf.c uemf.c uemf_endian.c uemf_utf.c uwmf.c uwmf_endian.c -lm -L/opt/csw/lib -liconv
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -DSOL8 -DWORDS_BIGENDIAN -std=c99 -pedantic -Wall -g -o test_mapmodes_emf test_mapmodes_emf.c uemf.c uemf_endian.c uemf_utf.c -lm -L/opt/csw/lib -liconv
1df6105803c4c56c020a56301c7c9c4890fd4158mathog(Note: WORDS_BIGENDIAN would also be produced by autconf's configure, if that was used.)
1df6105803c4c56c020a56301c7c9c4890fd4158mathogDefine WIN32 when compiling for Windows. This uses _wfopen() instead of fopen(), with
1df6105803c4c56c020a56301c7c9c4890fd4158mathogfilename translation from UTF-8 to UTF-16LE. This will allow file opens to utilize unicode
1df6105803c4c56c020a56301c7c9c4890fd4158mathognames. If WIN32 is omitted on Windows file names must be all ASCII. To build on mingw use:
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -DWIN32 -std=c99 -pedantic -Wall -g -o cutemf cutemf.c uemf.c uemf_endian.c uemf_utf.c -lm -liconv
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -DWIN32 -std=c99 -pedantic -Wall -g -o pmfdual2single pmfdual2single.c uemf.c uemf_endian.c uemf_utf.c upmf.c -lm -liconv
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -DWIN32 -std=c99 -pedantic -Wall -g -o reademf reademf.c uemf.c uemf_endian.c uemf_utf.c uemf_print.c upmf.c upmf_print.c -lm -liconv
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -DWIN32 -std=c99 -pedantic -Wall -g -o readwmf readwmf.c uemf.c uemf_endian.c uemf_utf.c uemf_print.c uwmf.c uwmf_endian.c uwmf_print.c upmf.c upmf_print.c -lm -liconv
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -DWIN32 -std=c99 -pedantic -Wall -g -o testbed_emf testbed_emf.c uemf.c uemf_endian.c uemf_utf.c -lm -liconv
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -DWIN32 -std=c99 -pedantic -Wall -g -o testbed_pmf testbed_pmf.c uemf.c uemf_endian.c uemf_utf.c upmf.c upmf.h -lm -liconv
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -DWIN32 -std=c99 -pedantic -Wall -g -o testbed_wmf testbed_wmf.c uemf.c uemf_endian.c uemf_utf.c uwmf.c uwmf_endian.c -lm -liconv
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc -DWIN32 -std=c99 -pedantic -Wall -g -o test_mapmodes_emf test_mapmodes_emf.c uemf.c uemf_endian.c uemf_utf.c -lm -liconv
1df6105803c4c56c020a56301c7c9c4890fd4158mathogDependencies:
1df6105803c4c56c020a56301c7c9c4890fd4158mathog libiconv (if not built into your compiler)
1df6105803c4c56c020a56301c7c9c4890fd4158mathog libpng (in the Inkscape examples)
1df6105803c4c56c020a56301c7c9c4890fd4158mathog--------------------------------------------------------------------------------------------
1df6105803c4c56c020a56301c7c9c4890fd4158mathogAll modules must also compile without warning under the more restrictive:
1df6105803c4c56c020a56301c7c9c4890fd4158mathog ls -1 *.c \
1df6105803c4c56c020a56301c7c9c4890fd4158mathog | extract -fmt 'gcc -Werror=format-security -Wall -Wformat -Wformat-security -W -Wno-pointer-sign -O2 -c -o deleteme.o [1,]' \
1df6105803c4c56c020a56301c7c9c4890fd4158mathog | execinput
1df6105803c4c56c020a56301c7c9c4890fd4158mathog--------------------------------------------------------------------------------------------
1df6105803c4c56c020a56301c7c9c4890fd4158mathogUsing libUEMF:
1df6105803c4c56c020a56301c7c9c4890fd4158mathogTo write an EMF file the code first runs two initialization functions: emf_start() and htable_create().
1df6105803c4c56c020a56301c7c9c4890fd4158mathogThen a U_EMRHEADER record is created. This and all subsequent records are appended to the EMF file in
1df6105803c4c56c020a56301c7c9c4890fd4158mathogmemory with emf_append(). Whichever other EMR records are desired are also added. The last EMR record
1df6105803c4c56c020a56301c7c9c4890fd4158mathogadded must be the single instance of U_EMREOF. Then the code calls emf_finish(), emf_free(), and
1df6105803c4c56c020a56301c7c9c4890fd4158mathoghtable_free(). Conversion of byte order on Big Endian machines to Little Endian is carried out
1df6105803c4c56c020a56301c7c9c4890fd4158mathogautomatically in emf_finish(), if it is required.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogTo input an EMF file it is is opened and the data read into a buffer in memory with emf_readdata(). On a
1df6105803c4c56c020a56301c7c9c4890fd4158mathogBig Endian machine this will also swap machine dependent byte orders as needed. At that point end user code
1df6105803c4c56c020a56301c7c9c4890fd4158mathoggenerally has to do something with the data in each record. The simplest case is to just print it, as shown
1df6105803c4c56c020a56301c7c9c4890fd4158mathogin reademf.c. More typically it must map the operations into its own graphics model, as shown in the
1df6105803c4c56c020a56301c7c9c4890fd4158mathogemf32*.*.example files from Inkscape. Basically the processing program needs to enter a loop, processing
1df6105803c4c56c020a56301c7c9c4890fd4158mathogone record at a time, pulling the record size and type from the first two uint32_t values present in each
1df6105803c4c56c020a56301c7c9c4890fd4158mathogrecord. It then enters a switch statement with one case for each EMR record type. Each case: statement
1df6105803c4c56c020a56301c7c9c4890fd4158mathogwill generally define a pointer to that type of data object. Accessing the data from that pointer is
1df6105803c4c56c020a56301c7c9c4890fd4158mathogillustrated in the code for the corresponding *_print function.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogWhile libUEMF implements _print and _swap functions for all supported EMR records, end user code would
1df6105803c4c56c020a56301c7c9c4890fd4158mathognever call any of these directly. Instead it should either pass a single EMR record
1df6105803c4c56c020a56301c7c9c4890fd4158mathogto U_emf_onerec_print() (see reademf.c) or the entire completed EMF file in memory buffer to U_emf_endian()
1df6105803c4c56c020a56301c7c9c4890fd4158mathogWMF support is similar, except the functions are wmf_start(), wmf_readdata(), and so forth. It is a good
1df6105803c4c56c020a56301c7c9c4890fd4158mathogidea to separate end user WMF and EMF generating code into different modules, in order to avoid accidentally
1df6105803c4c56c020a56301c7c9c4890fd4158mathogwriting EMR records to a WMF file and vice versa. WHile EMF objects are aligned in memory and so may be
1df6105803c4c56c020a56301c7c9c4890fd4158mathogaccessed using the supplied structs, the ones for WMF files are not usually aligned and so must be accessed
1df6105803c4c56c020a56301c7c9c4890fd4158mathogusing the supplied *_get functions. (The difference may not be evident on an x86 platform, but on RISC directly
1df6105803c4c56c020a56301c7c9c4890fd4158mathogtrying to access objects in memory will result in access violations.)
1df6105803c4c56c020a56301c7c9c4890fd4158mathogThings to be aware of in EMF files:
1df6105803c4c56c020a56301c7c9c4890fd4158mathogThe usual idea when employing a graphics file type like EMF is to copy a description of the objects in a
1df6105803c4c56c020a56301c7c9c4890fd4158mathogdrawing from one program to another. Many of the record types in an EMF file can be thought of as objects,
1df6105803c4c56c020a56301c7c9c4890fd4158mathogthey are lines or shapes or bitmaps or text. However, Microsoft's GDI implements binary and ternary raster
1df6105803c4c56c020a56301c7c9c4890fd4158mathogoperations (see the descriptions in uemf.h) and most of these operations are not object like, instead they
1df6105803c4c56c020a56301c7c9c4890fd4158mathogcombine things on the drawing surface. (There is in each case a copy operation which is object like.)
1df6105803c4c56c020a56301c7c9c4890fd4158mathogConsequently, EMF files which use these other raster operations are not particularly easy to import as
1df6105803c4c56c020a56301c7c9c4890fd4158mathoggraphic objects. For instance, when PowerPoint rotates an image and saves it in an EMF the result is not
1df6105803c4c56c020a56301c7c9c4890fd4158mathoga single rotated image object. Instead there is an image containing the rotated image, which is followed by
1df6105803c4c56c020a56301c7c9c4890fd4158mathogmasking operations to make the regions outside of the image transparent. There appears to be no standard
1df6105803c4c56c020a56301c7c9c4890fd4158mathogfor when and where these subsequent operations will be applied. That is, there is no equivalent of
1df6105803c4c56c020a56301c7c9c4890fd4158mathog"begin path" and "end path" to delineate the start and end of such a compound operation. So a program
1df6105803c4c56c020a56301c7c9c4890fd4158mathogreading such a file has no easy way of figuring out which previous object is being modified by a subsequent
1df6105803c4c56c020a56301c7c9c4890fd4158mathograster operation. The testbed program provided in this package generates a region which applies all
1df6105803c4c56c020a56301c7c9c4890fd4158mathogbinary raster operations in vertical slices to two images. The expected result appears in Windows "Preview",
1df6105803c4c56c020a56301c7c9c4890fd4158mathogbut if that region is imported into PowerPoint and converted to objects within that program the result looks
1df6105803c4c56c020a56301c7c9c4890fd4158mathognothing like what Preview shows.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogSupport for U_EMREXTTEXTOUTW is much more common than for U_EMRSMALLTEXT. The latter is easier to use,
1df6105803c4c56c020a56301c7c9c4890fd4158mathogsince it does not require a Dx array for each text string, but the objects will not import into PowerPoint,
1df6105803c4c56c020a56301c7c9c4890fd4158mathogfor instance.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogThere are two types of dotted/dashed lines. The first uses a set of predefined flags to set the pattern
1df6105803c4c56c020a56301c7c9c4890fd4158mathogand the latter is end user user defined. Both are restricted to lines of width 1. These built in types are
1df6105803c4c56c020a56301c7c9c4890fd4158mathogproblematic as key applications cannot handle them properly. PowerPoint cannot convert either type to its
1df6105803c4c56c020a56301c7c9c4890fd4158mathoginternal object format. The first form loses the pattern and comes through as solid lines. The second type
1df6105803c4c56c020a56301c7c9c4890fd4158mathogis toxic - even a single dotted line of the second type will prevent the entire EMF from being converted.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogThe safest choice is to avoid these patterned line styles entirely. Convert all dots and dashes to separate
1df6105803c4c56c020a56301c7c9c4890fd4158mathogline draws before writing those into the EMF file. libUEMF has no problem reading these records, so code
1df6105803c4c56c020a56301c7c9c4890fd4158mathogshould accept them for input.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogAs with most graphics file formats there is no single object representation of a complex text string (varying
1df6105803c4c56c020a56301c7c9c4890fd4158mathogfont size, super/sub script, bold, italic,.etc.). Such text must be decomposed into multiple text strings,
1df6105803c4c56c020a56301c7c9c4890fd4158mathogeach with its own formatting. It is unlikely that a subsequent program reading these records from the EMF
1df6105803c4c56c020a56301c7c9c4890fd4158mathogwill be able to reassemble them back into a single complex text string.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogIf a font used in an EMF file is not present on both the sending and receiving systems text will not look the
1df6105803c4c56c020a56301c7c9c4890fd4158mathogsame on both. Font substitution is usually silent in most programs, so it may not be evident why the text looks
1df6105803c4c56c020a56301c7c9c4890fd4158mathoga little odd. However, if text is simple, that is, consists of just one line of text without size, color,
1df6105803c4c56c020a56301c7c9c4890fd4158mathogor other changes, then it will look approximately correct after font substitution.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogThings to be aware of in WMF files:
1df6105803c4c56c020a56301c7c9c4890fd4158mathogWMF graphics are quite limited when compared to EMF graphics. When reading a WMF file it is essential that
1df6105803c4c56c020a56301c7c9c4890fd4158mathogend user code always create a specified object, even if that object is just a placeholder with no real
1df6105803c4c56c020a56301c7c9c4890fd4158mathogfunction. If any "create" operation presented by the WMF file is not handled then the object indices used
1df6105803c4c56c020a56301c7c9c4890fd4158mathogfurther along in the WMF file will be off, with very bad results! WMF "regions" are not supported by libUEMF,
1df6105803c4c56c020a56301c7c9c4890fd4158mathoghowever, if an operation creates regions, this type of placeholder must still be created.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogIn theory WMF supports mapmodes other than Anisotropic. However, since many programs do not handle
1df6105803c4c56c020a56301c7c9c4890fd4158mathogthese other modes it is strongly suggested that any WMF files generated use Anisotropic. For this
1df6105803c4c56c020a56301c7c9c4890fd4158mathogreason there is no test_mapmodes_wmf program - windows XP preview did not show anything when WMF
1df6105803c4c56c020a56301c7c9c4890fd4158mathogfiles in the other modes were produced. With no positive control there was no way to verify that they
1df6105803c4c56c020a56301c7c9c4890fd4158mathogThings to be aware of in EMF+ files:
1df6105803c4c56c020a56301c7c9c4890fd4158mathogEMF+ files are usually stored in files with an ".emf" file extension. In this package EMF+ programs,
1df6105803c4c56c020a56301c7c9c4890fd4158mathogfunctions, and definitions use PMF or PMR to distinguish them from the EMF and WMF material. ("EMF+"
1df6105803c4c56c020a56301c7c9c4890fd4158mathogis not an allowed variable or function name in C.) Dual mode EMF+ files contain both EMF and
1df6105803c4c56c020a56301c7c9c4890fd4158mathogEMF+ records. HOWEVER, those generated by PowerPoint are defective in that they drop all text
1df6105803c4c56c020a56301c7c9c4890fd4158mathoginformation from the drawing in the EMF+ representation. There is no simple way to line up the
1df6105803c4c56c020a56301c7c9c4890fd4158mathogEMF and EMF+ records in their representations to determine which ones correspond to which drawing
1df6105803c4c56c020a56301c7c9c4890fd4158mathogobject. So it is generally not possible to see which elements are represented in both
1df6105803c4c56c020a56301c7c9c4890fd4158mathogrepresentations, or which are missing in one representation. The example file generated by this library
1df6105803c4c56c020a56301c7c9c4890fd4158mathoghas only EMF+ records plus the few EMF records needed to wrap them.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogText in EMF+ is placed not from the baseline, as in EMF, but from the upper left corner of the Em square.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogUse the utility function U_PMR_drawstring() to draw text onto a baseline. Font
1df6105803c4c56c020a56301c7c9c4890fd4158mathogsubstitutions result in badly placed text because even fonts that look similar on the screen may have
1df6105803c4c56c020a56301c7c9c4890fd4158mathogdifferent font metrics. Specifically, font substitutions look worse in EMF+ files than they do
1df6105803c4c56c020a56301c7c9c4890fd4158mathogin EMF files. There is no way to embed fonts, or their font information in the EMF+ file.
1df6105803c4c56c020a56301c7c9c4890fd4158mathogConsequently the text representation within an EMF+ file is not very portable between systems - it will
1df6105803c4c56c020a56301c7c9c4890fd4158mathogonly render correctly if the second system has all of the fonts used in the document. The testbed_pmf.c
1df6105803c4c56c020a56301c7c9c4890fd4158mathogprogram contains some metrics for common fonts which may be used with U_PMR_drawstring()
1df6105803c4c56c020a56301c7c9c4890fd4158mathogto accurately place text.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog--------------------------------------------------------------------------------------------
1df6105803c4c56c020a56301c7c9c4890fd4158mathog (Note, version numbers in files represent the libUEMF release where it was last modified, so not
1df6105803c4c56c020a56301c7c9c4890fd4158mathog all files will show the same version numbers in each release.)
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog0.2.1.2015_04_23
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Bug in safety check on EMREXTCREATEFONTINDIRECTW because it had alternative "standard" record sizes.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Changed warnings on unimplemented EMF record types encounterd in swap or safe from stdout to stderr.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Added memory checking for WMF polyline and polygon records, for the variable part and some others.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Note: U_WMRCREATEREGION_get does not check that the variable part stays within the record. Current
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog implementation seems to be broken since it does not show up in XP preview.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog0.2.0 2015_03_20
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Added UEMF _safe functions to better handle corrupt records, where variable sizes fields might
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog have been specified to read past the end of memory. These are records with offsets, arrays
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog with counts, and bitmaps. Also any record which specifies a size smaller than the minimum
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog for that record type.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Added similar code for EMF+.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog These changed the API so the minor version number was bumped by 1.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog0.1.18 2015_01_15
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Pierre-Francois Carpentier sent some EMF examples which used U_EMR_EXTSELECTCLIPRGN, which had
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog not previously been encountered and showed that the handling of regions was broken.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Added tests for U_EMRFILLRGN, U_EMRFRAMERGN, U_EMRFRAMERGN, U_EMREXTSELECTCLIPRGN to testbed_emf.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog0.1.18 2014_04_28
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Fixed typo in testbed_wmf.c. "include,include" in one place should have been
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog "exclude,exclude".
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog0.1.17 2014_04_25
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Added text clipping tests to testbed_emf.c, testbed_wmf.c, and testbed_pmf.c.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Added option to omit clipping tests in testbed's.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog0.1.16 2014_04_14
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Fixed bug in U_WMRRESTOREDC_set.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Added clipping tests to testbed_wmf.c.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog0.1.15 2014_04_04
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Changed record flags for U_EMRSELECTCLIPPATH record, it consumes a path but does not ALTER (which
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog forced a premature draw.)
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Added U_EMROFFSETCLIPRGN test to testbed_emf.c.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Changed location on dist drawing where clipping appears.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog0.1.14 2014_03_27
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Fixed bug, in U_PMF_RECTN_set() in upmf.c. Never tested.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Fixed a few potential bugs in upmf.c if a null pointer was passed for
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog certain function arguments. (Previously unhandled cases.)
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Fixed bug, operations setting variables that are never read along those
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog execution paths: upmf_print.c, uemf.c, uwmf.c, uemf_endian.cm upmf.c.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Fixed potential (but very unlikely) memory leaks in upmf.c and uemf_utf.c.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Added test of U_PMF_RECTN_set to testbed_pmf.c.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Changed U_wmr_names() and U_wmr_escnames() to const char* (from char*).
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Changed method for suppressing unused parameter warnings.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog0.1.13 2014-03-21
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Fixed bug, cutemf was messing up the object count (pens, brushes, etc.).
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Added cutemf can now take ranges of lines.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Added testbed_emf generates clipping records for rect and path (but not region).
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog0.1.12 2014-02-14
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Documentation change, U_WMRCREATEPATTERNBRUSH is obsolete.
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Changed wmf_finish() so that it accurately reflects the largest number of objects used,
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog previously it showed the number of appends, which was much larger.
5da08901f6f284dfb64e741ed2f6287d9cfc087amathog0.1.11 2014-01-29
5da08901f6f284dfb64e741ed2f6287d9cfc087amathog Fixed bug in uwmf.c (wrong minimum record size on U_WMRTEXTOUT)
5da08901f6f284dfb64e741ed2f6287d9cfc087amathog Fixed bug in uwmf.c (U_WMRCREATEPATTERNBRUSH not right)
06517eb74772b7c18a8ab8d703405646d9ec05d3mathog Fixed bug in uwmf_print.c (U_WMRTEXTOUT_print, x,y were reversed)
5da08901f6f284dfb64e741ed2f6287d9cfc087amathog Added error handling to uemf_utf.c for cases where src is a null pointer.
5da08901f6f284dfb64e741ed2f6287d9cfc087amathog Added a test of createpatternbrush to testlib_wmf
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.1.10 2014-01-14
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Slight changes in documentation for uemf.h.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Fixed typo in uemf_endian.c.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Fixed a tiny bug in uemf.c (if memory allocation failed a struct would have
1df6105803c4c56c020a56301c7c9c4890fd4158mathog been deleted before the struct itself.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.1.9 2013-12-02
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Added U_PMF_DASHEDLINEDATA_set3 (dot/dash pattern from bits in a uint32_t).
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Finally was able to make linear gradient gradientfill records work. Updated
1df6105803c4c56c020a56301c7c9c4890fd4158mathog testbed_emf.c to include that.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.1.8 2013-11-28
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Fixed a bug in U_PMF_REGIONNODEPATH_print(), returned size was 4 too small.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Changed formatting of U_PMF_REGIONNODECHILDNODES_print() output to improve readability
1df6105803c4c56c020a56301c7c9c4890fd4158mathog of nested region structures in reademf.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.1.7 2013-11-20
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Added EMF+ support.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Converted U_RGA and similar from defines to functions, because the method being used
1df6105803c4c56c020a56301c7c9c4890fd4158mathog in the define (from C99) was not exactly compatible with C++ compilation.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Fixed error in test_mapmodes_emf.c where truncation float to integer was used where round
1df6105803c4c56c020a56301c7c9c4890fd4158mathog have been, resulting in an off by 1 error on some platforms.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Eliminated PU_W* pointers.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Cleaned up Doxygen comments.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.1.6. 2013-04-18
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Added tests which vary background mode, background color, and text color.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Slight modification to testit.sh.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Updated example files.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.1.5. 2013-02-13
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Added missing parameter for WMF RESTOREDC_set/get.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Replaced all sizeof() in uwmf.c that referred to UWMF structures with their
1df6105803c4c56c020a56301c7c9c4890fd4158mathog U_SIZE_* equivalents.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Added DIB related WMF _get functions. (Which were missing). These are U_BITMAPCOREHEADER_get,
1df6105803c4c56c020a56301c7c9c4890fd4158mathog U_BITMAPINFOHEADER_get, wget_dib_params
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Added const where appropriate to wmf _get functions.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Added comprehensive cap,join,miter tests to testbeds.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Fixed bug in gradient4_swap().
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Fixed bug in emr_arc_points_common(), used vector where unit vectors were
1df6105803c4c56c020a56301c7c9c4890fd4158mathog needed, sometimes flipped direction for arcs/chords.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Fixed bug in U_WMFTEXTOUT_get().
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Changed all dst->Dst and src->Src as call variables in WMF code.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Denigrated htable_*() for emf, these become emf_htable_*(), to match naming convention
1df6105803c4c56c020a56301c7c9c4890fd4158mathog used for wmf_table_*().
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.1.4 2013-02-04
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Added code to handle DIB formats that use clrUsed=0 to mean "maximum number of color entries",
1df6105803c4c56c020a56301c7c9c4890fd4158mathog this showed up in several places, including uemf.c and uemf_print.c.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Added some labels to test drawings, slightly rearranged image section, added
1df6105803c4c56c020a56301c7c9c4890fd4158mathog PNG and JPG image tests and clrUsed=0 images.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Modified uemf_endian.c to suppress some compiler warnings.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Changed get_DIB_params to return the Compression enumeration.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Fixed a typo in uwmf_print.c.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.1.3 2013-01-29 Add modes to EMF test programs that changes worldtransform, so
1df6105803c4c56c020a56301c7c9c4890fd4158mathog that the resulting test files will exercise rotation transforms.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Added flags indication for testbed programs.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Added test for ROUNDRECT records. Swapped argument orders for those _get/_set operations.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.1.2 2013-01-25 Fixed bug revealed by newer gcc on Solaris, assignment of aligned 32 bit to unaligned
1df6105803c4c56c020a56301c7c9c4890fd4158mathog 16 bit segfaulted.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.1.1 2013-01-24 Fixed a few compiler warnings under g++, mostly having to do
1df6105803c4c56c020a56301c7c9c4890fd4158mathog with signed unsigned comparisons. Eliminated
1df6105803c4c56c020a56301c7c9c4890fd4158mathog an unused variable from wmf_finish and two stray lines from U_WMRHEADER_set.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Cleaned up doxygen comments.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.1.0 2013-01-09 Added WMF functions.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Simplified print functions. Changed output format of reademf slightly,
1df6105803c4c56c020a56301c7c9c4890fd4158mathog from U_EMRXXX to U_EMR_XXX - easier to read the new way.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.0.11 2012-12-04 Moved UTF and related functions out of uemf.c uemf.h and into uemf_utf.c uemf_utf.h.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.0.10 2012-11-28 Discovered that not enough space was being allocated for some UTF conversions. To be
1df6105803c4c56c020a56301c7c9c4890fd4158mathog safe need 4 bytes per glyph + 1 for UTF-8.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.0.9 2012-09-26 Some "uninitialized variable warnings" for certain versions of
1df6105803c4c56c020a56301c7c9c4890fd4158mathog gcc. These were, as far as I could tell, all spurious, but to quiet them
1df6105803c4c56c020a56301c7c9c4890fd4158mathog the variables in question were all initialized to 0.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Fixed header related print/swap functions - depending on what type of header there
1df6105803c4c56c020a56301c7c9c4890fd4158mathog could be an access violation.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Fixed U_Utf16leToUtf8, could leak memory if the conversion failed.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Fixed sections which were not testing for all types of EMF headers.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Added RGBA_to_RGBA() so that extractions of subsets of bitmaps (offset, different size)
1df6105803c4c56c020a56301c7c9c4890fd4158mathog can be handled.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Added cutemf. Utility to remove records from an EMF file.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Added test_mapmodes. Program to generate test files in each MAPMODE.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Added test_mm_(mode)_ref.emf files. These are reference for:
1df6105803c4c56c020a56301c7c9c4890fd4158mathog test_mapmodes -vX 2000 -vY 1000
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.0.8 2012-09-10 Fixed bug in htable_insert, failed to celear newly added table
1df6105803c4c56c020a56301c7c9c4890fd4158mathog slots. Fixed test for EMR_GRADIENTFILL triangle mode (rectangle still produces toxic EMF files.)
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Fixed bug in gradientfill_swap on Solaris.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.0.7 2012-08-30 Added/fixed tests for hatched, DIB, and mono strokes.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Corrected error in U_EMREXTCREATEPEN_set.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.0.6 2012-08-21 Added/fixed tests for hatched, DIB, and mono fills.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.0.5 2012-08-08 Minor changes to uemf.c to suppress compiler warnings. Fixed
1df6105803c4c56c020a56301c7c9c4890fd4158mathog one bug in SET_CB_FROM_PXBMI macro (which was not triggered in testbed
1df6105803c4c56c020a56301c7c9c4890fd4158mathog because all images were the same size).
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.0.4 2012-07-25 More tests in testbed.c. Found and fixed bugs in
1df6105803c4c56c020a56301c7c9c4890fd4158mathog U_POLYPOLYLINE and U_POLYPOLYGON related code.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.0.3 2012-07-24 Warnings related to printing size_t on 64 bit Linux. Correct
1df6105803c4c56c020a56301c7c9c4890fd4158mathog fix is to use "zd", but gcc -std=c99 does not support that on Solaris 9,
1df6105803c4c56c020a56301c7c9c4890fd4158mathog the only available big endian system. So use cast or the size_t to (int)
1df6105803c4c56c020a56301c7c9c4890fd4158mathog and stick with %d format specifier. This should be OK as the sizes involved
1df6105803c4c56c020a56301c7c9c4890fd4158mathog should not be all that large.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog Bug in core9 affecting U_EMRARC_swap(), and related, on Big Endian.
1df6105803c4c56c020a56301c7c9c4890fd4158mathog0.0.2 2012-07-12 first release