TD renderer — an attempt to simulate classic GDI

Applications using FreeType are absolutely everywhere, yet it is so frustrating how much worse they render than classic GDI. That exact-area anti-aliasing algorithm that produces results too smooth, failing to use horizontal hinting, failing to clip vertically, failing to disable anti-aliasing, failing to use correct gamma, you name it. FreeType is very commonly misused. Therefore TD renderer (C++) attempts to remedy those issues. TD renderer is the Type Design renderer. It relies on FreeType, but it uses its own rasterizer to properly clip the output vertically (as lines of text should never overlap) and uses 4×4 oversampling if allowed by the gasp table.

TD renderer is not affiliated with Microsoft. Arial and Consolas, which are made by Microsoft, are proprietary fonts that are not available on Type Design.

Examples (version 2.0), compared with classic GDI:


DMCA Sans Serif 9.0-20252 — the 4×4 oversampling is the intended way to render this font. (version 1.0 is pixel-for-pixel identical to 2.0)


Microsoft Arial — dropout control is glitchy because it requires a specific algorithm to precisely simulate Microsoft dropout control. It was even worse in TD renderer 1.0, whereas 2.0 follows the general standard but not the proper rounding. (version 1.0: tdrand1.0arial.png) TD renderer 5.0 is expected to be even more accurate.


Microsoft Consolas — The ClearType optimized fonts are coded to completely break when they detect standard grayscale rendering. In TD renderer up to 3.0, bilevel outlines are used, however, the hinting is broken, so this font is not expected to be rendered correctly, so do not rely on outlines being bilevel. The current development TD renderer has the GETINFO follow the actual render mode. (version 1.0: tdrand1.0consolas.png — one pixel difference in ‘g’ in 8ppem)


Riglos Mono 1.1 — Autohinter is of course disabled because there isn’t ttfautohint in Microsoft renderer. It does utilize the embed bitmaps (sizes 9 to 23) when possible (Microsoft renderer also appears to do horizontal clipping). I had to make sure to disable the autohinter before any release to achieve meaningful results. (version 1.0: tdrand1.0riglosmono.png — note the half pixel glitches)

3.0

The above examples are shown in version 2.0, but version 3.0 further improves the accuracy of the renderer. Includes additional heuristics for missing extrema to fix a few glitchy renders, as well as fixing glitchy dropout control point order dependency and glitchy top and right boundary checks in dropout control. TD renderer 3.0 also has features like the ability to use tdr_face as a type (like originally in FreeType) to facilitate in multifonttasking, and custom oversampling rates. The experimental FreeType rasterizer testing tool now supports the ability to use 4×4 oversampling, but it is recommended to use the TD renderer rasterizer instead, due to properly handling half pixel lines and dropout control processing order. TD renderer is intended to make the wonders of classic GDI rendering accessible to any open-source software by porting the renderer, allowing to build on such as by making a text editor that simulates Microsoft Notepad. The 3.0-mod version has practical bugfixes such as in handling of single point contours and switching fonts. Looking forward to criticism and if you find ways to improve the renderer accuracy, immediately go to the Contact section below.

5.0

TD renderer 5.0 is in development to make it more accurate, faster, and more practical to use. TD plaintext editor is planned to use TD renderer 5.0 to render text. TD renderer 5.0 might be cancelled if TD renderer 2 1.0 gets released, which would be completely freetypeless.

Downloads

2021-06-21 — tdrenderer-3.0-mod.zip

Older downloads:

2020-08-14 — tdrenderer-3.0.zip
2020-05-17 — tdrenderer-2.0.zip
2020-05-13 — tdrenderer-1.0.zip

Contact

Name: Piotr Grochowski
E-mail: piotrunio-2004@wp.pl
AnyDesk: 265 993 303
Widget is loading comments...