UCGUI字体类型介绍

UCGUI字体类型介绍

 

 

译者:UCGUI

邮箱:UCGUI@163.com

主页:http://www.ucgui.com

时间:2007-02-24

版本: v1.0.0.0

 

 

10.1 Font types

 

10.1 字体形式

 

 

The current µC/GUI version supports 5 types of fonts:

. Monospaced bitmap fonts

. Proportional bitmap fonts

. Antialiased fonts with 2 bpp built-in antialiasing information

. Antialiased fonts with 4 bpp built-in antialiasing information

. Extended proportional bitmap fonts

For more information on antialiased fonts, please refer to Chapter 22: "Antialiasing".

当前版本(4.04)的UCGUI支持如下五种形式的字体.

. 等宽位图字体.

. 变宽位图字体.

. 内置2位光滑效果字体

. 内置4位光滑效果字体.

. 扩展变宽位图字体.

有关光滑效果字体的知识, 参考第22章:”光滑处理”

10.2 Font formats

 

10.2 字体格式

 

µC/GUI supports 3 kinds of font formats which are explained in the following.

µC/GUI支持如下介绍的三种类型的字体格式:

10.2.1 ’C’ file format

 

10.2.1 .C文件格式

 

 

This is the most common way of using fonts. When using fonts in form of .C. files, we

recommend compiling all available fonts and linking them as library modules or putting

all of the font object files in a library which you can link with your application.

This way you can be sure that only the fonts which are needed by your application

are actually linked. The font converter (described in a separate manual) may be used

to create additional fonts.

这是最通用的字体使用格式, 使用.C文件格式的字体时,建议将所有要用的字体的.C文件编译打包成一个库文件, 然后在你的应用程序中与这些库链接, 这样做可以确保只有在你的应用中使用到的字体链接进来, 在另外单独的手册中描述的字体生成工具可以用于制作字体.C文件.

When to use

 

适合什么情况

 

This format should be used if the fonts are known at compile time and if there is

enough addressable memory available for the font data.

这种格式的字体可以使用在编译应用时就确定知道要使用字体的情况, 而且必须有足够的地址空间用于存放字体数据.

Requirements

 

要求

 

In order to be able to use a font .C. file in your application, the following requirements

must be met:

. The font file is in a form compatible with µC/GUI as "C" file, object file or library.

. The font file is linked with your application.

. The font declaration is contained in the application.

要在应用中使用.C文件格式的字体, 必须注意如下几点要求:

. .C字体文件必须符合UCGUI使用的要求.

. .C字体文件会与应用编译链接在一块.

. 字体的相关声明必须在应用中包含.

10.2.2 System Independent Font (SIF) format

 

10.2.2 系统独立字体(SIF)格式

 

System independent fonts are binary data blocks containing the font information.

The font converter can be used to create system independent fonts. This tool is not

part of the basic package. A short description follows later in this chapter. For details

about how to create system independent fonts please refer to the font converter documentation.

SIF字体是包含字体信息的二进制数据块, UCGUI专用的字体生成工具能够生成SIF格式字体, 这个工具不属于UCGUI的基础包. 在本章稍后会有简短的描述. 详细的有关SIF格式字体的描述内容参考单独的字体生成工具文档.

When to use

 

适合什么情况

 

 

This format should be used if the fonts are not known at compile time and if there is

enough addressable memory available for the font data.

这种格式字体可以在编译应用时还不知道具体使用什么字体的情况下, 而且必须有足够的地址空间用于存放字体数据.

Requirements

 

要求

 

 

In order to be able to use a SIF font file in your application, it is required that the

whole file reside in addressable memory (ROM or RAM).

在应用中使用SIF字体格式时, 必须将整个SIF字体文件安排到地址空间中(ROM或者RAM空间).

 

10.2.3 External Bitmap Font (XBF) format

 

10.2.3 外部位图字体格式

 

 

As well as SIF fonts XBF fonts are binary data blocks containing the font information

and the font converter can be used to create XBF files.

Contrary to other fonts, XBF fonts do not have to reside in memory when they are

used, whereas all other kinds of µC/GUI fonts need to reside completely in memory.

The XBF font file can remain on any external media when it is used. Data access is

done by a .GetData. callback function whereas all other fonts need to reside in

addressable memory (RAM or ROM). The advantage of XBF fonts is that it is possible

to use very large fonts on system with little memory.

XBF字体同SIF字体一样, 都是包含字体信息的二进制数据块, 也可以由UCGUI专用的字体生成工具生成.

相比其它字体, XBF字体使用时无须安排到内存空间中, 其它各种形式的UCGUI字体都必须完全安排到内存空间当中, XBF字体文件可以保存在外部存储介质当中, 字体数据访问都是通过.GetData的回调函数完成, 而不是从ROM或RAM内存空间中读取, XBF字体的优点就是可以使用很大的字体文件但是占用很小的内存空间.

When to use

 

适合什么情况

 

 

This format should be used if there is not enough addressable memory available for

the font data and if there is any kind of external media available for storing the fonts.

这种格式字体适合没有足够内存空间来存放字体数据的情况, 但是必须有外部的存储介质来保存字体数据.

Requirements

 

要求

 

In order to be able to use a XBF font in your application, a .GetData. callback function

is required which is responsible for getting font data.

在应用时使用XBF字体, 必须提供一个.GetData的回调函数用于获取字体数据.

转载于:https://www.cnblogs.com/xilentz/archive/2010/06/10/1755603.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值