Freetype初探 - 了解TrueType Outlines 和 PostScript Outlines

C/C++第三方开源库的介绍和相关讨论
回复
头像
C艹艹
崭露头角
崭露头角
帖子: 26
注册时间: 2016年09月23日 11:32
联系:

Freetype初探 - 了解TrueType Outlines 和 PostScript Outlines

帖子 C艹艹 »

Outline 即 轮廓

先参考wikipedia的两个关键词
https://en.wikipedia.org/wiki/PostScript_fonts
Technology
By using PostScript (PS) language, the glyphs are described with cubic Bézier curves
(as opposed to the quadratic curves of TrueType)

https://en.wikipedia.org/wiki/TrueType
Technical notes
The outlines of the characters (or glyphs) in TrueType fonts are made of straight line
segments and quadratic Bézier curves.
PostScript字体使用3次贝塞尔曲线和直线线段描绘字体轮廓,单条3次贝塞尔曲线有2个控制点,2个定点;
Truetype 字体使用2次贝塞尔曲线和直线线段描绘字体轮廓,二次曲线的优势是处理起来比三次曲线更快一些,
缺点是遇到繁杂的曲线的时候需要提供比三次曲线更多的坐标数据

Wikipedia图例:
220px-Circle_and_quadratic_bezier.svg.png
(11.02 KiB) 已下载 743 次
A quadratic Bézier curve segment is defined by two end points and one control point. This circle is eight contiguous segments. The squares are end points and the circles are control points.
一个二次曲线片段由1个控制点和2个定点构成,该圆形由8个连续的曲线段构成(每一段曲线与曲线之间首尾相连)。
图中黑色方框表示定点,绿色圆圈表示控制点。
(可以看到每个定点恰好位于两个控制点的中间点。cx = (x1+x2)/2, cy = (y1+y2)/2,这个后面实际应用时再讨论)


打开字体文件可以查看其属于哪一种轮廓描述类型,
系统自带的字体Consolas
Consolas.png
(9.15 KiB) 已下载 760 次
网络下载的图标字体
Iconografica.png
(13.3 KiB) 已下载 760 次
回复

在线用户

正浏览此版面之用户: 没有注册用户 和 2 访客