ABOUT
=====
libwmf's homepage is
http://wvware.sourceforge.net/libwmf.html

and my (MV) email for bugs and whatnot is

martin.vermeer@hut.fi

libwmf is a library for unix like machines that can convert wmf
files into other formats, currently it supports a gd binding
to convert to png, and an X one to draw direct to an X window
or pixmap. As a new feature, also the Xfig and encapsulated PostScript
formats are supported.

WHAT YOU GET
============
xwmf draws wmf files on screen (X)
use + to zoom in and
use - to zoom out
wmftopng converts wmf files to png, can use (and I recommend) truetype fonts
wmftofig converts wmf files to fig, (new program, in active development still, 
but very cool)
wmftoeps converts wmf files to eps, (very new, very incomplete)


REQUIREMENTS (how text strings in wmf files are handled)
============

1)
First you *must* have the xpm libraries installed, this is
the default for linux distributions and many others, if you
don't have such a system you can get xpm from 
ftp://ftp.x.org/contrib/libraries

2)
To compile this code in its entirity you should have the freetype
library (http://www.freetype.org), and you should have a range
of truetype fonts, typically the ones supplied with windows.

NOTE 1: Currently an elaborate set of substitution/fallback rules 
is in effect. You should be safe having times.ttf and/or
arial.ttf and some symbol font like symbol.ttf (better: 
eucsym.ttf) on your disc. 

freetype is only required for the gd binding to libwmf, i.e. the
wmftopng program, the X bindings, (xwmf) doesn't require the 
truetype library, but I very much recommend that you install
xfsft, or have a X server able to use ttf fonts. 

Without the freetype library wmftopng will compile, but will
not be able to display text strings in the output png. If
you do have freetype, you still *are* *required* to specify
the directory that they are in to wmftopng as the third argument
to it, the fonts should be the standard ttf fonts supplied with
windows, or the font that the text will be rendered in will
not be the original font (see above, or source gdwmfapi.c).

3)
Without a truetype font server and the standard windows fonts
then the X binding might render text is a different font than
would appear under windows natively, this is a runtime issue for
the xwmf program.

4)
In this release libwmf cannot resize bitmaps embedded in wmf files
on its own, and attempt to offload them to the netpbm utilities,
so you should have these installed, it wont break anything not to
have them installed, and this requirement will be removed in a later
release. (Note MV: Frdric working on this).

INSTALLATION
============

it should just be a simple matter of 
./configure
make
make install

on some machines you might have to have gnu make installed,
if the make fails try gmake instead.

For full functionality you have to have X, freetype and the xpm
libraries installed.

If the xpm libraries are not in the standard locations you can use
./configure --with-xpm=dir
to point to the xpm dir location e.g.

If the freetype libraries are not in the standard locations you can use

./configure --with-ttf=dir

to point to the freetype dir location e.g.

./configure --with-ttf=/usr

for Red Hat with freetype and devel version 1.3.1-5, which sets up 
/usr as the root directory (<ttfroot>)under which 
to find both the headers (in /usr/include/freetype/) and the library 
(in /usr/lib). Configure currently searches <ttfroot>/include and
<ttfroot>include/freetype and <ttfdir> itself for headers, and
<ttfroot>/lib and <ttfroot> itself for the library.

In this example, freetype.h is in /usr/include/freetype/ and 
libttf.a in /usr/lib/.

In each case the dir can either be the dir *above* the include/,
include/freetype/ and lib/ dirs where the component can be found. 
Or the actual dir within *both* the lib and include files exist.

For other distro's, find the common <ttfroot> containing both
header and library files, and give that as a commmand line option to
./configure. Let me know (MV) if you find a distro where such a common
root does not exist.


MORE INFORMATION
================

Once everything is installed, if you have an app that you wish to
compile against libwmf, here is the sample options for the gd
binding, to generate png's from wmf.
gcc wmftopng.c -lwmf -ldib -lgdwmf -lxgd -lttf -L/usr/X11R6/lib -lX11 -lXpm -lpng -lz -lm

the breakdown is
-lwmf    -ldib     -lgdwmf     -lxgd     -lttf 		-lpng -lz -lm
^^^^     ^^^^      ^^^^^^      ^^^^^     ^^^^^ 		^^^^^^^^^^^^^
the      bmp       the gd      the       truetype   png library
lib      handling  binding     gd        library    requirements
itself   code      to libwmf   lib

-L/usr/X11R6/lib -lX11 -lXpm
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Xpm library, needed as libdib
converts dib's to xpm files.
(libdib, is for device 
indepentant bitmaps, i.e bmp
files without their full headers)

the include files that are installed that you need are
wmfapi.h for all bindings
[ + gdwmfapi.h for gd binding ] OR
[ + Xwmfapii.h for X binding ]

for the X binding to draw direct to a pixmap/window

gcc xwmf.c -lwmf -ldib -lXwmf -L/usr/X11R6/lib -lX11 -lXpm -lm

all the same except use libXwmf which is the binding for X.

documentation will be included in a later version as to how to
write your own binding for the wmf library, especially wanted
ones are wmf->fig and wmf->eps. (under construction).

some other info as to the current situation.

this baby currently attempts to convert 16 bit windows metafiles,
known as .wmf to something useful.

In its present state it draws the metafile to an X window, and
can output a png file.

Its early code, but works so far on... 

at least the collection of clipart from msword and msworks
for win 3.1

the wordtests dir is a set of wmf files outputted from sample runs
of libwv. The png binding doesn't currently do text, but it
will once i've merged code from a tcl binding to gd that understands
the truetype format. [Has this been done? MV]

It *doesnt* do emf files, i.e 32bit metafile yet, and is surely quite
buggy at the moment.

There are a few examples of clipart files in the clipart dir, some 
pointers to other freely available clipart would be appreciated.
the out.wmf file contains examples of all the currently supported
wmf functions.

This is a sister project to libwv, 
http://www.wvWare.com
to allow that converter to decode wmf files that are embedded
in word docs.

the intention is to use it as a library that you can plug
in modules for other file formats. 

CHANGELOG is the file with the changes and up to date news.
read it for updates.

C.
MV
