如何使用高级 OpenType 功能编写程序?
如何使用 OpenType 表编写一个简单的程序来动态呈现文本?
请回答:
- assembly 、 C 、 C++ 、 C# 、 java 或 Python (以及一点 WPF:-)
或介绍它们的库。
欢迎对常见操作系统的文本渲染系统或设计兼容unicode 5.02协议的文本引擎提出意见和解答。
How could I write a simple program using OpenType tables in order to dynamically render text?
please answer in :
- assembly , C , C++ , C# , java or Python (and a little WPF:-)
or introduce libraries of them.
comments and answers about text rendering system of common Operating Systems, or designing text engines compatible with unicode 5.02 protocol are welcomed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
FreeType 仅提供基本渲染功能,不支持高级 OpenType 功能。许多年前,FreeType 1.x 包含一个提供 OpenType 功能的模块,但这成为了自己的项目:HarfBuzz。如果您需要在任何地方(每个操作系统/平台)都能工作的东西,它应该是最好的解决方案。优秀的 pango 库为 HarfBuzz 等提供了高级接口。
Windows 提供了一个 OpenType 引擎,称为 Uniscribe。 OS X 也是如此,它有 ATSUI。
我希望这应该能让你开始。
FreeType only offers basic rendering capabilities and does not support advanced OpenType features. Lots of years ago, FreeType 1.x contained a module that provided OpenType functionality, but this became its own project: HarfBuzz. If you need something that works everywhere (every OS/platform), it should be the best solution. The excellent pango library provides a high-level interface for HarfBuzz, among other things.
Windows provides an OpenType engine, called Uniscribe. The same goes for OS X, which has ATSUI.
That should get you started, I hope.
我不知道这是否能满足您的需求,但我使用了 FreeType 过去渲染 TrueType 文本的库。它非常灵活并且可以轻松地在各种平台(Linux、Windows、OSX 等)之间移植。此外,许可(BSD 风格)使得在商业应用程序中使用它不是问题。
I don't know if this will satisfy your needs or not, but I've used the FreeType library in the past to render TrueType text. It is quite flexible and easily ported between various platforms (Linux, Windows, OSX, etc.). Also, the licensing (BSD-style) is such that using it in commercial applications is not a problem.
纯 C#,https://github.com/LayoutFarm/Typography
支持.NET >=20
访问一般字形数据,
并访问高级排版数据。
(例如GDEF,GSUB,GPOS)等。
下图显示了一些屏幕快照,
snap1:
比较 lib 的渲染字形 'B'
(左):来自没有提示的 lib 的字形
(中):具有清晰类型的 Windows GDI(来自记事本) )
(右):带有 True Hinting 的库中的字形
快照2:
我正在开发自动提示和网格拟合。
测试一下,并随意评论、分叉、讨论。
快照 3:子像素渲染
Pure C#, https://github.com/LayoutFarm/Typography
support .NET >=20
access general glyph data,
and access advanced typography data.
(such as GDEF,GSUB,GPOS) etc.
The below image shows some screen snapshot,
snap1 :
compare then lib's rendering glyph 'B'
(left) : glyph from the lib without Hinting
(middle) : Windows's GDI with clear type (from notepad)
(right): glyph from the lib with True Hinting
snap 2:
I'm developing auto-hint, and grid fitting.
test it out, and feel free to comment, fork, discuss.
snap 3: subpixel rendering