0

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.

sorush-r
  • 9,347
  • 14
  • 77
  • 160

3 Answers3

2

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.

dietr
  • 1,188
  • 10
  • 22
1

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.

Gordon
  • 86
  • 4
1

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

enter image description here


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

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

triangulate1


snap 3: subpixel rendering

subpixel_rendering

WinterDev
  • 221
  • 2
  • 3
  • Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline. – pableiros Oct 21 '16 at 15:24