Go to file
Patrick Walton b48b256ab3 Actually reverse indices for early Z!
2x performance improvement. I feel silly.
2017-09-14 17:20:54 -07:00
demo Actually reverse indices for early Z! 2017-09-14 17:20:54 -07:00
font-renderer Implement path stroking using the FreeType stroker. 2017-09-08 16:50:27 -07:00
partitioner Split paths into monotonic segments before partitioning them in the demo 2017-09-12 09:35:57 -07:00
path-utils Split paths into monotonic segments before partitioning them in the demo 2017-09-12 09:35:57 -07:00
pathfinder-classic Move Pathfinder to `pathfinder-classic` in preparation for Pathfinder 2 2017-06-27 14:13:11 -07:00
resources Use some names from the Mozilla Monument in the 3D demo 2017-09-06 22:50:07 -07:00
shaders/gles2 Implement SSAA for the 3D demo. 2017-09-12 19:43:43 -07:00
.gitignore Partially refactor the path APIs to be streaming, like Lyon 2017-09-08 13:09:00 -07:00
LICENSE-APACHE Add a license file to `partitionfinder/`, and copy it into the root directory too so that GitHub 2017-08-07 10:22:10 -07:00
LICENSE-MIT Add a license file to `partitionfinder/`, and copy it into the root directory too so that GitHub 2017-08-07 10:22:10 -07:00
README.md Mention Linux packages in the README 2017-02-15 18:20:15 -08:00

README.md

Pathfinder

Pathfinder is a fast, practical GPU-based rasterizer for OpenType fonts using OpenGL 4.3. It features:

  • Very low setup time. Glyph outlines can go from the .otf file to the GPU in a form ready for rasterization in less than a microsecond. There is no expensive tessellation or preprocessing step.

  • High quality antialiasing. Unlike techniques that rely on multisample antialiasing, Pathfinder computes exact fractional trapezoidal area coverage on a per-pixel basis.

  • Fast rendering, even at small pixel sizes. On typical systems, Pathfinder should easily exceed the performance of the best CPU rasterizers.

  • Low memory consumption. The only memory overhead over the glyph and outline storage itself is that of a coverage buffer which typically consumes somewhere between 4MB-16MB and can be discarded under memory pressure. Outlines are stored on-GPU in a compressed format and usually take up only a few dozen kilobytes.

  • Portability to most GPUs manufactured in the last few years, including integrated GPUs.

Building

Check out the code and run cargo build --release.

Try the demo with cargo run --release --example lorem-ipsum -- resources/tests/nimbus-sans/NimbusSanL-Regu.ttf. Use the mouse wheel or touchpad scrolling to move, and do the same while holding Alt or Option to zoom.

As an alternative, debug builds (without the --release) build quickly and are typically fast, since most of the code runs on GPU.

On Windows, running the demos requires GLFW, which requires CMake to be installed and in your PATH. Get it from cmake.org.

On Linux, some development packages are needed to compile. On Ubuntu, the following line has been reported to suffice to install them:

sudo apt-get install cmake libgl-dev libx11-dev xrandr-dev

Authors

The primary author is Patrick Walton (@pcwalton), with contributions from the Servo development community.

The code is owned by the Mozilla Foundation.

License

Licensed under the same terms as Rust itself. See LICENSE-APACHE and LICENSE-MIT.