Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is an exciting demonstration, but I have one worry that's unaddressed: I'm assuming all the other nitpicky details of hinted font rendering etc is handled correctly by all the renderers compared? I mean, they all provide pixel-identical output?

Otherwise the point is mostly useless. A faster rendering implementation is almost useless if the output doesn't look as nice. I wouldn't care if the text I'm reading over 5 minutes takes 200ms vs 800ms to render.



Pathfinder's rendering is best-in-class, equaling or exceeding the quality of the other renderers. FreeType, stb_truetype, font-rs, and Pathfinder all use exact trapezoidal area calculations for antialiasing. Most GPU algorithms use lower-quality multisample antialiasing, but matching the system renderer in quality is one of the key goals of Pathfinder.

Regarding hinting, hinting is mostly a transformation applied to the vectors before rasterization, so it's (again, mostly) independent of the actual vector rasterizer. Note that many systems do no hinting at all. To make the benchmarks fair, hinting was disabled for the libraries that support it.


Having done some work that involved comparing a number of text rendering libraries in the past, I'm aware of the minute differences in rendering and hinting (even when the output should be the same). Could you briefly mention how hinting here would compare to ClearType?


Hinting and subpixel AA (ClearType) are separate features. Could you elaborate?


The parent might mean ClearType in the sense of the Windows ClearType renderer, which is pretty strongly hinted in general.


Yes, thank you. Is there any other ClearType? On Windows, CT is a combination of both heavy hinting and configurable subpixel aliasing.


I've been planning lately on writing my own little 2d rasterizer for fun. While I really like the trapezoidal signed-area method, when reading STB's write-up I noticed that it can overestimate coverage when a path self-intersects or when subpaths intersect. Does Pathfinder solve this?

Between that and clipping paths, I've been thinking of sticking with multisampling, as nice as the exactness of the trapezoidal algorithm can be.


Pathfinder doesn't do anything special in that case; it has the same limitations as stb_truetype. There's probably a way to fix these issues if they come up in practice.

I would recommend doing the trapezoidal area approach in spite of these limitations. Having 256 shades of gray instead of 8 or so makes a big difference for all paths, not just pathological ones. It often ends up faster than MSAA, too.


I think one can mix hinters and renderers from different libraries. If it's all about fast vector rendering I don't see why they couldn't just use freetype's hinter (maybe they do).


You can. For my programming font [0], I provide versions of it that bake in the output from Freetype's hint interpreter applied at different point sizes and display DPIs. This way platforms such as macOS that don't always apply hinting can show it as though they did.

[0] http://eastfarthing.com/luculent/


> I mean, they all provide pixel-identical output?

I wonder if this is even possible once you move it to the GPU. Reading about some of the fingerprinting methods in browsers lately, many rely on different GPU's doing different things with the same input.


> I wonder if this is even possible once you move it to the GPU.

Different GPUs should produce pixel-identical output. If not, it's a bug either in Pathfinder or the driver.


In theory yes, in practice that almost never happens.

The number of teams I've seen pursue golden-image tests on GPU pipelines and fail has been 100%(4/4).


What's the source of the image differences?

I probably shouldn't find this disturbing, but I do.


It's a host of things, generally I've seen:

  - Poorly defined APIs/types that allow vendors to diverge.
  - Legit driver bugs.
  - Vendors preferring optimizations to following the spec(including skipping memzero requirements).
  - Hardware that doesn't behave how it should(fp32 falling back to fp16 silently for instance).
Overall you don't really win any points in the market for correctness, instead performance and efficiency are highly valued.


Can you provide some rendered screenshots with a few fonts and sizes? (Ideally including a side-by-side comparison with Freetype?)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: