1The GDTextUtil package contains text utilities for use with the GD 2drawing package. 3 4This package provides three modules that make it possible to work with 5internal GD fonts as well as TrueType fonts, without having to worry 6about different interface functions to call. Apart from an abstract 7interface to all font types and strings for GD, this library also 8provides some utility in aligning and wrapping your string. 9 10GD::Text: 11 Provides information about a font, irrespective of whether the font 12 is a TTF or builtin font. 13 14GD::Text::Align 15 Align a string around a coordinate, left, right, center, top, bottom 16 or center. 17 18GD::Text::Wrap 19 Wrap a long string between a right and left margin, starting at a 20 certain y coordinate. Layout the text flush left, flush right, 21 center, or justified. 22 23Requirements: 24 25 perl 5.005_03 or higher. It may (and probably will) work on older 26 versions, but it has not been tested, and I won't spend a lot of 27 time trying to support it. 28 29 GD 1.20 or up, if possible built with TTF (freetype) support. 30 GD 2.* has not been tested yet. 31 32 Please note that the freetype version 2 libraries should be at 33 the latest level. Especially version 2.0.3 has an annoying bug 34 that rotates text twice. Later versions of freetype (2.1.2 35 currently) don't render as nicely anymore as earlier ones. 36 Hopefully that will be fixed, because it is _ugly_ right now. 37 38 If you want 'make test' to do something useful, you will need 39 to have Test::More installed. If you don't, all tests will be 40 skipped. 41 42Installation: 43 44 perl Makefile.PL 45 make 46 make test 47 make demo 48 make install 49 50Demo(s) can be found in the demo directory. 51 52 DO NOT PANIC when the tests fail. The various Freetype libraries 53 often have a slightly different implementation of their rendering 54 algorithms, resulting in slightly different bounding boxes for 55 strings, and slightly different looking images. If your tests 56 fail, try a 'make demo', and visually compare demo/GDWrap.png 57 (freshly generated image) and demo/GDWrap.ref.png (reference 58 image). If they look reasonably similar, you can call the tests 59 successful. Even if they don't look entirely similar, it may 60 simply be because your font files are different from the ones I 61 used to create GDWrap.ref.png. Please see the sources. 62 63 Currently, some of the TTF tests in t/* are disabled, specifically 64 because every version of the freetype library seems to render 65 differently enough for sizing to be wrong all the time. I don't 66 think I'll ever re-enable them anymore. 67 68Bug Reports: 69 70 When you report a bug, please include as much information as 71 possible (unless you also supply a patch :)). 72 The minimum set of information I need to be able to correctly 73 assess a bug is: 74 75 GD::Text version 76 Perl version and OS 77 GD version 78 79 If the bug relates to TrueType font rendering, I'll also need to 80 know which version freetype library you linked in. 81 82 If at all possible, submit a small program that demonstrates the 83 problem, together with the output _you_ get on your system 84 (remember that it all works fine on mine). 85 86 If you're using Redhat, and have their freetype 2.0.3 library RPM 87 installed, do not report bugs until you have upgraded to a later 88 version. 89 90 CYGWIN 91 92 If you try to install the GD::Text modules on cygwin, you may see 93 error messages like the following: 94 95 C:\cygwin\bin\cygperl.exe: *** unable to remap 96 C:\cygwin\usr\X11R6\bin\libfreetype.dll to same address as 97 parent(0x720000) != 0x74000064 [main] cygperl 4296 sync_with_child: 98 child 4364(0xFC) died before initialization with status code 0x1 99 100 It has been brought to my attention (by Michael West) that in this 101 case it is necessary to "rebase" the used libraries (Don't ask me, 102 I don't know what that means). There is some more info on the 103 cygwin mailing list: 104 105 http://sources.redhat.com/ml/cygwin/2003-02/msg01484.html 106 http://sources.redhat.com/ml/cygwin/2003-02/msg01789.html 107 http://sources.redhat.com/ml/cygwin/2003-02/msg01833.html 108 109Todo: 110 111 - Make the interface more flexible 112 - Alignment for the wrap boxes as a whole 113 - More demo code 114 115COPYRIGHT 116 117 Copyright (c) 1999 Martien Verbruggen 118 mgjv@comdyn.com.au 119 120 This package is free software; you can redistribute it and/or 121 modify it under the same terms as Perl itself. 122 123Enclosed fonts: 124 125 Dustismo Sans and Dustismo Roman 126 http://www.cheapskatefonts.com/ 127 see Dustismo,LICENSE for original (GPL) license 128 129 Cetus by Greg Meronek is no longer enclosed, since its copyright 130 status has become unclear (the status is simply not known). 131 http://fontastic.i-n.net/fontastic/greg.htm 132 133