Re: [AD] xf2pcx update

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> I've had a modified version of xf2pcx lying around since I added the
> euro character sometime last year, and right now I felt like making a
> patch out of it (although xf2pcx isn't that useful anymore, given the
> various font addons which exist for allegro, and support things like AA
> rendering which xf2pcx doesn't). So, just ignore this if something more
> important like 4.0.3 release is going on..

Well, releasing the 4.0.3 is not that time-consuming...

> The modified version allows to use a 16-byte range instead of the fixed
> characters 0x20-0xff like before (I just replaced XDrawText with
> XrawText16 and so on), and the output PCX always uses a fixed grid now,
> like with ttf2pcx, which makes it easier to post-process the pcx, and
> also simplifies the code.

Great!

> Included as well are some code changes, like using Allegro functions
> directly where duplicates were used before for some reason, and the code
> was reformatted with allegro/indent.pro.

Yep, I've already seen this save_pcx() function elsewhere :-)

You're going to find me really picky...

+ *      Utility to convert X11 fonts to a pcx file, ready for use in the
+ *      grabber.

... to a PCX file, ...

+ *      By Michael Bukin, 1998
  *
- * Probably you will need to tell compiler where to find include
- * files and libraries, e.g.:
+ *      Minor changes in 2002 by Peter Wang
  *
- * gcc -Wall -O2 -g -I/usr/X11R6/include -o xf2pcx xf2pcx.c -L/usr/X11R6/lib 
-lX11 -lm
+ *      Minor changes in 2003 by Elias Pschernig

Missing colons at the end of the credits.

+static void usage(char *_argv0)

+int main(int _argc, char *_argv[])

Why the underscores?

+   return EXIT_SUCCESS;

Eh! either return 0; or exit(EXIT_SUCCESS); but not a mix of both.

> The patch is attached. I included it in the make process, but I have
> some doubt about the use of 'getopt' in the original xf2pcx - there's a
> configure check for unistd.h, so maybe I should remove getopt and use
> the same option parsing like in the non-x11 tools?

unistd.h is the POSIX header file defining close() so I don't think there are 
many Unices that don't have it. And getopt(3) is POSIX.2 so it's fine too.

Ok with the aforementioned changes.

-- 
Eric Botcazou




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/