由於在PHP程式中用了jpgraph,需要TTF支援。需要安裝freetype1.x。
編譯freetype1.3.1的時候不能編譯通過.其錯誤如下.
ftdump.c:172:1: pasting "." and "glyph_object" does not give a valid preprocessing token
ftdump.c:182:1: pasting "." and "first_instance" does not give a valid preprocessing token
ftdump.c:191:1: pasting "." and "second_instance" does not give a valid preprocessing token
ftdump.c:201:1: pasting "." and "face_object" does not give a valid preprocessing token
ftdump.c:202:1: pasting "." and "glyph_object" does not give a valid preprocessing token
ftdump.c:203:1: pasting "." and "second_instance" does not give a valid preprocessing token
ftdump.c:863:1: pasting "." and "initial_overhead" does not give a valid preprocessing token
ftdump.c:882:1: pasting "." and "face_object" does not give a valid preprocessing token
make[1]: *** [ftdump.o] Error 1
make[1]: Leaving directory `/software/freetype-1.3.1/test'
make: *** [tttest] Error 2
在freetype網站上看了文檔 http://freetype.sourceforge.net/freetype1/docs/faq/freetype1.txt,應該是測試程式在Linux平台不能編譯吧。
修改Makefile.in:
1. 去掉all: ttlib tttest ttpo中的tttest
2. 刪除
install:
cd $(FTLIBDIR); $(MAKE) -f $(MAKEFILE) uninstall
cd $(FTTESTDIR); $(MAKE) -f $(MAKEFILE) uninstall
cd $(FTPODIR); $(MAKE) uninstall
中的 cd $(FTTESTDIR); $(MAKE) -f $(MAKEFILE) uninstall
# ./configure --prefix=/Data/apps/freetype1
# make
# make install
最後提醒一下,如果以前在PHP中編譯了GD,一定要加入--with-freetype重新編譯GD,否則在PHP上是不能獲得Freetype支援的