Text Rendering Hates You

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • imageworsener

    A utility for processing PNG, JPEG, BMP, and WebP images. Features include resize/resample, dither, grayscale, apply background color, subpixel rendering.

  • There can be various causes for those symptoms:

    1. Even if the rendering gets the subpixel order right, the subpixels are rarely equidistant on a display. They tend to be closer to each other within a logical pixel.

    2. Some subpixel-AA algorithms are naive, and trade color accuracy to luminance accuracy, causing more color fringes.

    3. Incorrect gamma handling.

    4. If aiming for more luminance accuracy, incorrectly taking into account the relative luminance of the subpixels (what you observed with the brighter green subpixels).

    Imageworsener[1] has an option to downscale with subpixel antialiasing, it's gamma correct by default, and it has an option for adjusting the subpixel offsets within a pixel (instead of the naive default of 1/3). It might be a good way to try out correct subpixel-AA, but it only works on images. I guess you can render text on high resolution and downscale that with imageworsener, but you won't get any hinting that way, but maybe that's desired.

    Very few software does AA correctly, let alone subpixel-AA.

    [1] https://entropymine.com/imageworsener/

  • harfbuzz

    HarfBuzz text shaping engine

  • Have you looked into harfbuzz? afaik it's designed to solve that problem, for all languages.

    https://harfbuzz.github.io/

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • nuklear

    A single-header ANSI C immediate mode cross-platform GUI library (by Immediate-Mode-UI)

  • Everyone is in the mood to write about text rendering today for some reason, love it. Great to see so many points paralleled like this article talking [1] about sub-pixel offsets being a challange and Nuklear's Wiki article talking [2] about snapping glyphs to an interger offset.

    [1] https://gankra.github.io/blah/text-hates-you/#subpixel-offse...

    [2] https://github.com/Immediate-Mode-UI/Nuklear/wiki/Complete-f...

  • ghostedit

    Usability focused WYSIWYG editor

  • Ah, that was a dark time for WYSIWYG editing on the web. I actually made my own back in that era [0] (well a little later, but when TinyMCE and CKEditor were still the goto solutions), and getting it to work cross-browser when IE6 was still a thing and had no dev tools was an absolute nightmare.

    [0]: https://github.com/nicoburns/ghostedit

  • Guide-to-Swift-Strings-Sample-Code

    Xcode Playground Sample Code for the Flight School Guide to Swift Strings

  • I agree. It is an excellent article. Text systems are weird.

    There's an entire book about strings, in Swift: https://flight.school/books/strings/

  • msdfgen

    Multi-channel signed distance field generator

  • Not sure if your game has any spatial 3D consideration but this project uses real time Multi-channel signed distance field generation :

    [1] https://github.com/Chlumsky/msdfgen

  • colr-gradients-spec

  • They just extended the COLR spec to COLRv1 which essentially is a whole new canvas API in fonts: https://github.com/googlefonts/colr-gradients-spec/blob/main...

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts