freetype 学习笔记

可去官网下载到压缩包

参考打开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.




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值