开发者

how to write programs using advanced OpenType features?

开发者 https://www.devze.com 2022-12-24 12:34 出处:网络
How could I write a simple program using OpenType tables in order to dynamically render text? please answer in :

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 p开发者_Python百科rotocol are welcomed.


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.


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.


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'

  1. (left) : glyph from the lib without Hinting

  2. (middle) : Windows's GDI with clear type (from notepad)

  3. (right): glyph from the lib with True Hinting

how to write programs using advanced OpenType features?


snap 2: I'm developing auto-hint, and grid fitting.

test it out, and feel free to comment, fork, discuss.

how to write programs using advanced OpenType features?


snap 3: subpixel rendering

how to write programs using advanced OpenType features?

0

精彩评论

暂无评论...
验证码 换一张
取 消