zoukankan      html  css  js  c++  java
  • 在开发板上实现矢量字体显示

    对于开发板实现显示矢量字体,同样PC机一样,我需要字体文件,这里选择simsun.ttc(新宋体)。

    1)初始化库

       FT_Init_FreeType( &library ); /* initialize library */

    2)create face object

       FT_New_Face( library, argv[1], 0, &face );

    3)设置字体大小

      FT_Set_Pixel_Sizes(face, 24, 0);

    4)设置坐标

      pen.x = 0 * 64;

      pen.y = (var.yres - 24) * 64;

    5)逐个显示

      for (i = 0; i < wcslen(wstr1); i++)

      {
        /* set transformation */
        FT_Set_Transform( face, 0, &pen);

        /* load glyph image into the slot (erase previous one) */
         FT_Load_Char( face, wstr1[i], FT_LOAD_RENDER );

        draw_bitmap( &slot->bitmap,slot->bitmap_left,var.yres - slot->bitmap_top);

        /* increment pen position */
        pen.x += slot->advance.x;

      }

    根据以上架构,即可实现在开发板上显示单行文字的功能。

    ————————————————————————————————————————————————————————————————————————————— 无他,唯手熟尔。。。
  • 相关阅读:
    jboss hello world
    jboss 7 启动问题
    jboss [how to access the admin console]
    tomee 消息持久化
    Python、C和Java对比
    编程语言产生时间表
    从关系型数据库到非关系型数据库
    约束和异常处理
    类与类之间的关系
    类的成员
  • 原文地址:https://www.cnblogs.com/ZXNblog/p/4014769.html
Copyright © 2011-2022 走看看