2025年点阵字体, 矢量字体

点阵字体, 矢量字体点阵字体 http zh wikipedia org wiki E7 82 B9 E9 98 B5 E5 AD 97 E4 BD 93 点阵字体 也叫位图字体 其中每个字形都以一组二维像素信息表示 这种文字显示方式于较早前的电脑系统 例如未有图形接口时的 DOS 操作系统 被普遍采用 由于位图的缘故

大家好,我是讯享网,很高兴认识大家。

点阵字体

http://zh.wikipedia.org/wiki/%E7%82%B9%E9%98%B5%E5%AD%97%E4%BD%93

点阵字体也叫位图字体,其中每个字形都以一组二维像素信息表示。这种文字显示方式于较早前的电脑系统(例如未有图形接口时的 DOS 操作系统)被普遍采用。
由于位图的缘故,点阵字体很难进行缩放,特定的点阵字体只能清晰地显示在相应的字号下,否则文字只被强行放大而有损字形,产生成马赛克式的锯齿边缘。
但对于字号 8-14px 的尺寸较小的汉字字体(即现今操作系统大多采用的默认字号)现今亦仍然被使用于荧幕显示上,能够提供更高的显示效果;
不过现今该种点阵字体主要只作为“辅助”的部分,当用户设置的字体尺寸并没有拥有位图像时,字体便会以矢量图象方式显示;
而当打印时,印有字体无论大小亦会使用矢量字体打印。常见的纯点阵字体有 bdf,pcf,fnt,hbf 等格式。

矢量字体

http://zh.wikipedia.org/wiki/%E7%9F%A2%E9%87%8F%E5%AD%97%E4%BD%93

矢量字体 是与 点阵字体 相对应的一种字体。

矢量字体的每个字形都是通过数学方程来描述的,一个字形上分区出若干个关键点,相邻关键点之间由一条光滑曲线连接,这条曲线可以由有限个参数来唯一确定。
矢量字的好处是字体可以无级缩放而不会产生变形。目前主流的矢量字体格式有3种:

Type1TrueTypeOpenType,这三种格式都是平台无关的。

Type1全称PostScript Type1,是1985年由Adobe公司提出的一套矢量字体标准,由于这个标准是基于PostScript Description Language(PDL),
而PDL又是高端打印机首选的打印描述语言,所以Type1迅速流行起来。但是Type1是非开放字体,Adobe对使用Type1的公司征收高额的使用费。

TrueType是1991年由Apple公司与Microsoft公司联合提出另一套矢量字标准。

Type1使用三次贝塞尔曲线来描述字形,TrueType则使用二次贝塞尔曲线来描述字形。
所以Type1的字体比TrueType字体更加精确美观。一个误解是,Type1字体比TrueType字体占用空间多。
这是因为同样描述一个圆形,二次贝塞尔曲线只需要8个关键点和7段二次曲线;而三次贝塞尔曲线则需要12个关键点和11段三次曲线。
然而实际情况是一般来说 Type1比TrueType要小10%左右。这是因为对于稍微复杂的字形,为了保持平滑,TrueType必须使用更多的关键点。
由于现代大部分打印机都是使用PDL作为打印描述语言,所以True1字体打印的时候不会产生形变,速度快;
而TrueType则需要翻译成PDL,由于曲线方程的变化,还会产生一定的形变,不如Type1美观。

这么说来,Type1应该比TrueType更具有优势,为什么如今的计算机上TrueType反而比Type1使用更广泛呢?

第一个原因是:Type1由于字体方程的复杂,所以在屏幕上渲染的时候花费的时间多,解决方案是大部分Type1字体嵌入了点阵字体,这样渲染快,
但是边缘不光滑,比较难看。很多ps文档和ps转换的pdf文档都是这样,在计算机上浏览的时候字体很难看,但是打印出来很美观。
TrueType则渲染比较快,可以平滑的显示在屏幕上,看上去很美观。

第二个原因是Type1的高额使用费,使得Type1没有被所有的操作系统所支持。
Windows家族只有OS/2和Windows 2000及之后的版本从操作系统级别开始支持Type1。
由于这个问题,Adobe只好在其所有的产品中嵌入Adobe Type Manager(ATM)作为渲染引擎。

OpenType则是Type1与TrueType之争的最终产物。
1995年,Adobe公司和Microsoft公司开始联手开发一种兼容Type1和TrueType,并且真正支持Unicode的字体,后来在发布的时候,正式命名为OpenType。
OpenType可以嵌入Type1和TrueType,这样就兼有了二者的特点,无论是在屏幕上察看还是打印,质量都非常优秀。
可以说OpenType是一个三赢的结局,无论是Adobe,Microsoft还是最终用户,都从OpenType中得到了好处。
Windows家族从Windows 2000开始,正式支持OpenType。
打开系统的字体目录(一般是C:\Windows\Fonts\或C:\Winnt\Fonts),可以看到:
一个红色A的图标的是点阵字体,
两个蓝色重叠的T的图标是TrueType字体,
两个绿色重叠的T的图标是TrueType字体集,
一个绿色O的图标就是OpenType字体。

如果字体扩展名为FON表示点阵字库
如果扩展名为TTF/OTF则表示矢量字库
如果扩展名为TTC则表示矢量字库集

Raster, Vector, TrueType, and OpenType Fonts

http://msdn.microsoft.com/ZH-CN/library/windows/desktop/dd(v=vs.85).aspx

Applications can use four different kinds of font technologies to display and print text:

  • Raster
  • Vector
  • TrueType
  • Microsoft OpenType

The differences between these fonts reflect the way that the glyph for each character or
symbol is stored in the respective font-resource file:

  • In raster fonts, a glyph is a bitmap
    that the system uses to draw a single character or symbol in the font.
  • In vector fonts, a glyph is a collection of line endpoints that define the line segments
    that the system uses to draw a character or symbol in the font.
  • In TrueType and OpenType fonts, a glyph is a collection of line and curve commands as well as a collection of hints.

The system uses the line and curve commands to define the outline of the bitmap
for a character or symbol in the TrueType or Microsoft OpenType font.
The system uses the hints to adjust the length of the lines and shapes of the curves used to draw the character or symbol.
These hints and the respective adjustments are based on the amount of scaling used to reduce or increase the size of the bitmap.
An OpenType font is equivalent to a TrueType font except that an OpenType font
allows PostScript glyph definitions in addition to TrueType glyph definitions.

Because the bitmaps for each glyph in a raster font are designed for a specific resolution of device,
raster fonts are generally considered to be device dependent.

Vector fonts, on the other hand, are not device dependent,
because each glyph is stored as a collection of scalable lines.

However, vector fonts are generally drawn more slowly than raster or TrueType and OpenType fonts.

TrueType and OpenType fonts provide both relatively fast drawing speed and true device independence.
By using the hints associated with a glyph, a developer can scale the characters
from a TrueType or OpenType font up or down and still maintain their original shape.

As previously mentioned, the glyphs for a font are stored in a font-resource file.
A font-resource file is actually a DLL that contains only data, there is no code.

For raster and vector fonts, this data is divided into two parts:

A header describing the font's metrics and the glyph data.
A font-resource file for a raster or vector font is identified by the .fon file name extension.

For TrueType and OpenType fonts, there are two files for each font:

the first file contains a relatively short header and
the second contains the actual font data.

The first file is identified by an .fot extension and
the second is identified by a .ttf extension.

 

TrueType、PostScript 和 OpenType 字体之间的区别是什么? 

http://windows.microsoft.com/zh-cn/windows-vista/whats-the-difference-between-truetype-postscript-and-opentype-fonts 

TrueType 字体可调整到任意大小,并且在所有大小情况下,都是清晰可读的。可以将它们发送给 Windows 支持的任何打印机或其他输出设备。
OpenType 字体与 TrueType 字体相关,但包括更大的基本字符集扩展,包括小型大写、老样式数字及更复杂的形状,
“字形”“连字”。OpenType 字体在任意大小下仍清晰可读,并且可以发送到 Windows 支持的任何打印机或其他输出设备。
PostScript 字体线条平滑、细节突出,是一种高质量的字体。他们经常用于打印,尤其是经常用于如书籍或杂志等的专业质量的打印。


讯享网

哪种字体最适合我?

不一定。如果只想要一种打印效果好,并且在屏幕上易于阅读的字体,则可以考虑使用 TrueType 字体。
如果需要大型字符集用于语言覆盖和精细的版式,则可能想要使用 OpenType 字体。
如果需要打印专业质量的印刷出版物,如有光泽的杂志,或需要进行商业打印,则 PostScript 字体是一种很好的选择。

TrueType

http://zh.wikipedia.org/wiki/TrueType 

TrueType是由美国苹果公司和微软公司共同开发的一种电脑轮廓字体类型标准。这种类型字体文件的扩展名是.ttf,类型代码是tfil

早在80年代末,苹果公司为了对抗Adobe公司的Type 1PostScript字体,设计开发了TrueType,之后微软加入了开发,后来视窗系统的字体格式基本上都统一成TrueType,
而在苹果的麦金塔系统中却成了PostScript和TrueType对立的局面。TrueType后来也被Linux等系统使用,成为标准字体。
TrueType的主要强项在于它能给开发者提供关于字体显示、不同字体大小的像素级显示等的高级控制。

在新开发的OpenType类型字体中,可以选择PostScript还是TrueType作为记述方式。

OpenType

https://zh.wikipedia.org/wiki/OpenType

OpenType,是一种可缩放字型(scalable font)电脑字体类型,采用PostScript格式,是美国微软公司Adobe公司联合开发,用来替代TrueType字型的新字型。
这类字体的文件扩展名为.otf,类型代码是OTTO,现行标准为OpenType 1.4。

OpenType最初发表于1996年,并在2000年之后出现大量字体。它源于微软公司的TrueType Open字型,TrueType Open字型又源于TrueType字型。
OpenType font包括了Adobe CID-Keyed font技术。Adobe公司已经在2002年末将其字体库全部改用OpenType格式。
到2005年大概有一万多种OpenType字体,Adobe产品占了三分之一。

OpenType之前的主流是苹果公司和微软开发的TrueType类型,还有Adobe公司开发的Type 1("PostScript")字体类型。
微软在1994年独自开发了"TrueType Open"类型[1],之后1996年Adobe加入开发,增加了其在Type 1字体中使用的对字体轮廓的支持,OpenType这个名字于是便用来称呼合并之后的技术。

OpenType使用TrueType字体通用的"sfnt"架构,但其加入若干“智能字体”(smartfont)选项,可以加强字体的字形和语言支持能力。
OpenType字体中的字形(glyph)、轮廓数据可以在两种格式中任选其一:
一个是在'glyf'表中TrueType格式轮廓,另一个是在'CFF '表中的CFF(压缩字体格式,Compact Font Format)格式轮廓。
CFF轮廓数据是基于PostScript语言Type 2字体格式。表格名'CFF '长度为四个字符,并且以一个空格字符结尾。

OpenType的主要特征有:

  • 字体编码基于万国码(Unicode),可以支持任何文本,或者同时支持多种文本。
  • 一个OpenType字体可以带有超多65,536个字形。对于中文字库而言,最基本的字汇应该包含Big5的13,060个汉字或是GB2312-80标准的6763个常用字型,
    这些字应该能满足一般用户的使用,对于户籍管理、银行系统和出版社等用户而言需要2万多字甚至7万多字的支持。
  • 字体有高级字形特征,可以进行对复杂文本进行充分的字形处理,并能通过更简单的脚本施加更复杂的字形效果,比如用罗马字母脚本书写英文。
  • 字体文件可以拓展到跨平台,能够在Mac OS,Windows和一些Unix系统中进行设置。
  • 若不含异体字等拓展字形和拓展文字性能,OpenType CFF字体比Type 1要小

PostScript字体

http://baike.baidu.cn/view/121491.htm

按 PostScript 页面描述语言 (PDL) 规则定义的字体,并且只能在 PostScript 兼容的打印机上打印。
当按屏幕字体显示的文档被发送到 PostScript 打印机时,如果有 PostScript 版本的字体,则打印机将使用该字体打印。
如果该字体不存在,但计算机安装了该版本的字体,则该字体将被下载到打印机。
如果打印机或计算机上都没有安装 PostScript font 字体,则位映射字体(光栅字体)被转换为 PostScript 字体,而打印机就使用位映射字体打印文本。
按印刷工业中的质量标准,PostScript 字体在平滑性、细节和忠实性方面比位映射字体要好

光栅字体

Enumerating the Installed Fonts

http://msdn.microsoft.com/en-us/library/windows/desktop/dd(v=vs.85).aspx

In some instances, an application must be able to enumerate the available fonts and select the one most appropriate for a particular operation.
An application can enumerate the available fonts by calling the EnumFonts or EnumFontFamilies function.
These functions send information about the available fonts to a callback function that the application supplies.
The callback function receives information in LOGFONT and NEWTEXTMETRIC structures.
(The NEWTEXTMETRIC structure contains information about a TrueType font.
When the callback function receives information about a non-TrueType font, the information is contained in a TEXTMETRIC structure.)
By using this information, an application can limit the user's choices to only those fonts that are available.

The EnumFontFamilies function is similar to the EnumFonts function but includes some extra functionality. 
EnumFontFamilies allows an application to take advantage of styles available with TrueType fonts.
New and upgraded applications should use 
EnumFontFamilies instead of EnumFonts.

TrueType fonts are organized around a typeface name (for example, Courier New) and style names (for example, italic, bold, and extra-bold).
The EnumFontFamilies function enumerates all the styles associated with a specified family name, not simply the bold and italic attributes.
For example, when the system includes a TrueType font called Courier New Extra-BoldEnumFontFamilies lists it with the other Courier New fonts.
The capabilities of EnumFontFamilies are helpful for fonts with many or unusual styles and for fonts that cross international borders.

If an application does not supply a typeface name, the EnumFonts and EnumFontFamiliesfunctions supply information about one font in each available family.
To enumerate all the fonts in a device context, the application can specify NULL for the typeface name,
compile a list of the available typefaces, and then enumerate each font in each typeface.

EnumFonts function

The EnumFonts function enumerates the fonts available on a specified device.
For each font with the specified typeface name, the EnumFonts function retrieves information about
that font and passes it to the application defined callback function.
This callback function can process the font information as desired.
Enumeration continues until there are no more fonts or the callback function returns zero.

Note  This function is provided only for compatibility with 16-bit versions of Windows. Applications should use the EnumFontFamiliesEx function.

int EnumFonts( _In_ HDC hdc, _In_ LPCTSTR lpFaceName, _In_ FONTENUMPROC lpFontFunc, _In_ LPARAM lParam );

讯享网
小讯
上一篇 2025-02-19 21:21
下一篇 2025-03-04 07:08

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/125418.html