文件浏览器及数码相框 -2.3.2-freetype_arm-1
交叉编译:
tar xjf freetype-2.4.10.tar.bz2
./configure --host=arm-linux
make
make DESTDIR=$PWD/tmp install
find -name stdio.h
平时使用#include<stdio.h>路径 ./arm-linux/include/stdio.h
编译出来的头文件应该放入:
/work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux/include
编译出来的库文件应该放入:
/work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux/lib
把tmp/usr/local/lib/* 复制到 /work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux/lib
sudo cp * /work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux/lib -d -rf
cp *so* /work/nfs_root/fs_mini_mdev_new/lib –d
cd /work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux/lib
把tmp/usr/local/include/* 复制到 /work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux/include
cp * /work/tools/gcc-3.4.5-glibc-2.3.6/arm-linux/include -rf
cp *so* /work/nfs_root/fs_mini_mdev/lib –d
错误
/arm-linux/include/ft2build.h:56:38: freetype/config/ftheader.h
freetype/config/ftheader.h
freetype2/freetype/config/ftheader.h
将freetype2/freetype移动到当前目录
mv freetype2/freetype .
编译
arm-linux-gcc -finput-charset=GBK -fexec-charset=GBK -o example1 example1.c -lfreetype -lm
在开发板上运行
用函数转化文件编码方式
iconv -f GBK -t UTF-8 show_font.c
查看错误
编译
arm-linux-gcc -finput-charset=GBK -fexec-charset=GBK -o show_font show_font.c -lfreetype -lm
wchar_t * chinese_str = L"陈"; FT_Library library;
FT_Face face;
FT_Vector pen; /* untransformed origin */
FT_GlyphSlot slot; int error; if(argc != )
{
printf("Usage : %s <font_file>\n",argv[]);
return -;
}
freetype初始化
/* ÏÔʾʸÁ¿ÎÄ×Ö */ error = FT_Init_FreeType( &library ); /* initialize library */
/* error handling omitted */ error = FT_New_Face( library, argv[], , &face ); /* create face object */
/* error handling omitted */ slot = face->glyph; FT_Set_Pixel_Sizes(face, , ); /*È·¶¨×ø±ê
*lcd_x = var.xres / 2 + 32 + 32
*lcd_y = var.yres / 2
*µÑ¿¨¶û×ø±ê
*x = lcd_x = var.xres / 2 + 32 + 32
*y = var.yres - var.yres / 2
*/ pen.x = ( var.xres / + + ) * ;
pen.y = ( var.yres - var.yres / - ) * ; /* set transformation */
FT_Set_Transform( face, , &pen ); /* load glyph image into the slot (erase previous one) */ error = FT_Load_Char( face, chinese_str[], FT_LOAD_RENDER );
if ( error )
{
printf("FT_Load_Char error\n");
return -;
}
/* now, draw to our target surface (convert position) */
draw_bitmap( &slot->bitmap,
slot->bitmap_left,
var.yres - slot->bitmap_top );
描画图
void draw_bitmap( FT_Bitmap* bitmap,
FT_Int x,
FT_Int y)
{
FT_Int i, j, p, q;
FT_Int x_max = x + bitmap->width;
FT_Int y_max = y + bitmap->rows; printf("x = %d, y = %d\n", x, y); for ( i = x, p = ; i < x_max; i++, p++ )
{
for ( j = y, q = ; j < y_max; j++, q++ )
{
if ( i < || j < ||
i >= var.xres || j >= var.yres )
continue; // image[j][i] |= bitmap->buffer[q * bitmap->width + p]; lcd_put_pixel(i, j, bitmap->buffer[q * bitmap->width + p]);
}
}
}
旋转angle角度
第三个参数为角度
添加头文件 #include <stdlib.h>
angle = ( 1.0 * strtoul(argv[], NULL, ) / ) * 3.14159 * ; /* use 25 degrees */ /* set up matrix */
matrix.xx = (FT_Fixed)( cos( angle ) * 0x10000L );
matrix.xy = (FT_Fixed)(-sin( angle ) * 0x10000L );
matrix.yx = (FT_Fixed)( sin( angle ) * 0x10000L );
matrix.yy = (FT_Fixed)( cos( angle ) * 0x10000L );
文件浏览器及数码相框 -2.3.2-freetype_arm-1的更多相关文章
- 文件浏览器及数码相框 -2.3.1freetype_pc
例子 #include <stdio.h> #include <string.h> #include <math.h> #include <ft2build. ...
- 文件浏览器及数码相框 -2.3.2-freetype_arm-2
显示多行文字 两行文字左边对齐 简单使用两个循环显示两行字体 根据上一行字体的宽度来进行下一行左边的计算 #include <sys/mman.h> #include <sys/ty ...
- 下载apk文件浏览器会直接打开并显示乱码的问题
今天同事反映他的apk文件在自己的老项目中下载有问题:下载apk文件浏览器会直接打开并显示乱码,在别的项目中就没有问题. 后分析response的content-type发现,老项目的类型是text/ ...
- Win 10 文件浏览器无法打开
今天遇到个很奇怪的问题,文件浏览器File Explorer无法正常显示,点击打开后任务栏上已经显示打开了,但是屏幕上却看不到任何窗口,开始以为机子中了恶意的木马,然后就疯狂的查毒,然而并没有解决问题 ...
- Mac下DIY文件浏览器
2015-07-14 15:07:53 Mac下的finder不能浏览Linux文件目录, 一些优秀的资源管理器是收费的..... 于是想到了既然Mac的本质是类Unix, 而在windows下查看L ...
- 比nerdtree更好的文件浏览器:vimfiler
通过:VimFilerExplorer来打开一个文件浏览器 h:收起 t:展开 -:close 回车:进入或展开 空格:收起
- 【转】显示Ubuntu文件浏览器的地址栏--不错
原文网址:http://www.blogbus.com/anythingok-logs/144447448.html Ubuntu默认使用nautilus作为其可视化的文件浏览器,其默认值不显示地址栏 ...
- 【Java】 实现一个简单文件浏览器(1)
学习Java的Swing的时候写的一个超简单文件浏览器 效果如图: 项目结构: 这里面主要用了两个控件,JTree和JTable 下面先说下左侧的文件树如何实现: 首先是FileTree类,继承于JT ...
- SharePoint 2013 解惑 无法打开文件浏览器
你有时候会看到这东西谈出来,当你想像管理文件一样,管理SharePoint上资源的时候 意思是说,不能打开文件浏览器,请加入你的站点到信任站点,这个有两个问题,一个是IE设置,一个是WebClient ...
随机推荐
- mysql 内连接 左连接 右连接 外连接
mysql> desc student;+-------+-------------+------+-----+---------+-------+| Field | Type | Null | ...
- C++——代码重用
一.包含对象成员的类 接口和实现:使用公有继承时,类可以继承接口,可能还有实现(基类的纯虚函数提供接口,但不提供实现).获得接口是is-a关系的组成部分.而使用组合,类可以获得实现,但不能获得接口.不 ...
- 淘宝封装的一款ui 非常不错
好用的淘宝ui http://m.sui.taobao.org/demos/ 手机端访问地址
- error C2783: 无法为“T”推导 模板 参数
原则:“模板参数推导机制无法推导函数的返回值类型” 版本一: // 缺少<T> 参数 int n 对比第三个版本( 缺少<T> 参数 T n) ! 编译错误提示: 错误 1 e ...
- Spring MVC 之输入验证(六)
Spring MVC 验证主要还是用的是hibernate的验证.so需要添加以下的jar包: 1. hibernate-validator-5.2.2.Final.jar 2.hibernate-v ...
- Selenium解决页面元素不在视野范围内的问题
当需要使用滚动条才能使页面元素显示在视野范围内时,必须用代码处理下,才能对其进行操作. 处理其实也很简单,就是调用JS函数. driver.executeScript("arguments[ ...
- 在腾讯云上创建您的SQL Cluster(1)
版权声明:本文由李斯达原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/247 来源:腾云阁 https://www.qclo ...
- 使用Objective-C的文档生成工具
前言 做项目的人多了,就需要文档了.今天开始尝试写一些项目文档.但是就源代码来说,文档最好和源码在一起,这样更新起来更加方便和顺手.象Java语言本身就自带javadoc命令,可以从源码中抽取文档.今 ...
- (30)odoo中的快捷标签
* 快捷标签 提供快捷标签是为了简化代码的编码,把复杂的工作封装化 * 找到封装化的源码: openerp/tools/convert.py xml_import self._ ...
- C++中颜色的设置
1.改变整个控制台的颜色用 system("color 0A"); 其中color后面的0是背景色代号,A是前景色代号.各颜色代码如下: 0=黑色 1=蓝色 2=绿色 3=湖蓝色 ...