This is a shorter version of my patch to add iso-8859-2 encoding to ImageMagick. Longer version include ability to display *all* fonts (include X fonts) by default in iso-8859-2 encoding, but this one is cleaner and should apply cleanly to different version. Beware, this is a CLUDGE. It works for me, YMMV! --- ImageMagick-4.2.8/magick/utility.c Fri Jul 2 01:24:25 1999 +++ ImageMagick-4.2.8-iso88592/magick/utility.c Mon Jul 12 13:11:22 1999 @@ -360,6 +362,25 @@ unsigned short *unicode; +/* remap from unicode to other encodings + Based on file encoding.cpp from xfstt (C) Copyright 1998 Herbert Duerr + Modifications for ImageMagick by Dobrica Pavlinusic +*/ + int table[] = { + 0x0a0, 0x104, 0x2d8, 0x141, 0x0a4, 0x13d, 0x15a, 0xa7, + 0x0a8, 0x160, 0x15e, 0x164, 0x179, 0x0ad, 0x17d, 0x17b, + 0x0b0, 0x105, 0x2db, 0x142, 0x0b4, 0x13e, 0x15b, 0x2c7, + 0x0b8, 0x161, 0x15f, 0x165, 0x17a, 0x2dd, 0x17e, 0x17c, + 0x154, 0x0c1, 0x0c2, 0x102, 0x0c4, 0x139, 0x106, 0x0c7, + 0x10c, 0x0c9, 0x118, 0x0cb, 0x11a, 0x0cd, 0x0ce, 0x10e, + 0x110, 0x143, 0x147, 0x0d3, 0x0d4, 0x150, 0x0d6, 0x0d7, + 0x158, 0x16e, 0x0da, 0x170, 0x0dc, 0x0dd, 0x162, 0x0df, + 0x155, 0x0e1, 0x0e2, 0x103, 0x0e4, 0x13a, 0x107, 0x0e7, + 0x10d, 0x0e9, 0x119, 0x0eb, 0x11b, 0x0ed, 0x0ee, 0x10f, + 0x111, 0x144, 0x148, 0x0f3, 0x0f4, 0x151, 0x0f6, 0x0f7, + 0x159, 0x16f, 0x0fa, 0x171, 0x0fc, 0x0fd, 0x163, 0x2d9 + }; + *count=0; if ((text == (char *) NULL) || (*text == '\0')) return((unsigned short*) NULL); @@ -372,6 +393,8 @@ while (*p != '\0') { *q=(unsigned char) (*p); + if( *q == 0x80) *q = 0x20AC; /* euro currency symbol */ + if( *q >= 0xa0 && *q <= 0xff ) *q = table[ *q - 0xa0 ]; if (strncmp(p,"\\0x",3) == 0) { p+=3;