可去官网下载到压缩包
参考打开freetype-2.4.10\docs\tutorial中的step1.html网页
在PC上显示:
book@book-desktop:/work/project/03.freetype$ tar xjf freetype-2.4.10.tar.bz2
book@book-desktop:/work/project/03.freetype$ mv freetype-2.4.10 freetype-2.4.10_pc
book@book-desktop:/work/project/03.freetype/freetype-2.4.10_pc$ ./configure
book@book-desktop:/work/project/03.freetype/freetype-2.4.10_pc$ make
book@book-desktop:/work/project/03.freetype/freetype-2.4.10_pc$ sudo make install
book@book-desktop:/work/project/03.freetype/01th_pc/01th_english$ gcc -o example1 example1.c -I /usr/local/include/freetype2 -lfreetype -lm //-I是指定头文件目录 -l指定freetype库 -lm 是指定数学库
book@book-desktop:/work/project/03.freetype/01th_pc/01th_english$ ./example1 ./simsun.ttc agc
对代码的其中一些解释:
FT_Vector pen;
/* start at (0,40) relative to the upper left corner */
pen.x = 0 * 64;
pen.y = ( target_height - 40 ) * 64;
FT_Set_Transform( face, &matrix, &pen );
之所以*64是因为,在step1.html网页有进行解释如下:
We now use a vector of type FT_Vector to store the pen position, with coordinates expressed as 1/64th of pixels, hence a multiplication. The position is expressed in cartesian space.