Library / SDK
servo/pathfinder avatar
servo/pathfinder

servo/pathfinder: a GPU rasterizer for fonts and vector graphics, and who should adopt it

A fast, practical GPU rasterizer for fonts and vector graphics

3,896 stars238 forksRustApache-2.0

At a glance

What is it?
Pathfinder 3 is a Rust and C library that rasterizes fonts and vector paths on the GPU through OpenGL, OpenGL ES, Metal and WebGL. It targets workloads with many overlapping paths, but its README calls it incomplete, and the last commit landed on 2026-04-23.
Who is it for?
Adopt servo/pathfinder if you are embedding vector or font rendering in a Rust or C/C++ application and your workload is dominated by many overlapping paths, where tile-based occlusion culling is the design bet. Do not adopt it if you need a stable, complete canvas implementation or a fully documented C API; the README says the library is incomplete in various areas and that the C bindings are less complete.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 160 days ago.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What servo/pathfinder solves, and who it is for

Rasterizing vector paths and glyphs is normally CPU work. Software rasterizers walk paths, sort them with a painter's algorithm, and fill pixels one after another; the cost grows with path count and overlap. Pathfinder moves that work to the GPU. The README describes it as a "fast, practical, GPU-based rasterizer for fonts and vector graphics" that runs on OpenGL 3.0+, OpenGL ES 3.0+, WebGL 2 and Metal. The intended audience is developers embedding vector rendering in a Rust or C/C++ application, not end users looking for a drawing program. The README states that Pathfinder contains a library implementing a subset of the HTML canvas API, so a Rust or C/C++ app can add vector rendering without writing a rasterizer. The project also targets SVG files with many overlapping paths, and it ships a loader built on the resvg library for a subset of SVG. A third use case is 3D: the README says Pathfinder can render fonts and vector paths in 3D environments without quality loss, aimed at vector-based interfaces in VR.

How the tile-based renderer and its two modes work

Pathfinder splits rendering into a CPU-side setup stage and a GPU-side drawing stage, and the balance between them depends on which of two modes is active. The README calls these modes D3D11 and D3D9 and notes that the names refer to hardware levels rather than to actual Direct3D backends, since no proper Direct3D backend exists yet. In the D3D11 mode, compute shaders do the tiling and the CPU usage drops sharply. In the D3D9 mode, the tiling step runs on the CPU using SIMD and Rayon for parallelism, and the README says that CPU step can be pipelined with the GPU to hide its latency. The rendering model itself is tile-based: Pathfinder culls occluded geometry per tile, which the README contrasts with software renderers that use the painter's algorithm and redraw hidden surfaces. For antialiasing, the README states that Pathfinder can compute exact fractional trapezoidal area coverage per pixel, described as effectively 256xAA. Font handling goes further than plain rasterization: the README lists slight hinting, subpixel antialiasing on LCD screens, stem darkening and font dilation like macOS and FreeType, and gamma correction. The codebase mirrors this split into crates such as geometry, gl, gpu, renderer, simd, svg, text and ui, which the README says lets applications pick only the components they need.

Building servo/pathfinder and running a first canvas example

The README gives two build paths. For Rust, the instruction is to run cargo build --release at the top level, which builds all the crates in the workspace. The libraries are published on crates.io with the pathfinder_ prefix, for example pathfinder_canvas, but the README notes that you may wish to use the main branch for the latest features and bug fixes.

bash
cargo build --release

For a first real use, the README points at the canvas_minimal example under examples/ as a small example of the canvas API in action, and it names canvas_nanovg as another example you can run directly. Running an example is the fastest way to see output on screen:

bash
cd examples/canvas_nanovg
cargo run --release

There is also a native demo application whose sources live in demo/native. The README gives these commands, and after the release build finishes you should see the demo window open:

bash
cd demo/native
cargo run --release

C and C++ users take a different route. The C bindings use cargo-c, which you install first, then you install the library into a destination directory and copy it into place:

bash
cargo install cargo-c
cargo cinstall --destdir=/tmp/pathfinder-destdir --manifest-path c/Cargo.toml
sudo cp -a /tmp/pathfinder-destdir/* /

The README states the resulting library is usable through pkg-config under the name pathfinder, and that examples beginning with c_ in the examples/ directory show how to call it. Note the README's own caveat that the C bindings are currently less complete than the Rust ones.

Where servo/pathfinder is the wrong choice

The README opens with a warning: Pathfinder is under heavy development and is incomplete in various areas. That sentence should shape any adoption decision. A library implementing a subset of the HTML canvas API is not a drop-in canvas replacement, so code that relies on parts of the canvas specification outside that subset will not port cleanly. The C bindings are explicitly described as less complete, with pull requests welcome, which makes the C path riskier than the Rust path for a production integration. The backend naming is another source of confusion: D3D11 and D3D9 are labels for hardware capability levels, and the README says the project does not have a proper Direct3D backend yet, so anyone reading the mode names as Direct3D support will be misled. There is also a maintenance question that the repository metadata answers more clearly than the README does. The last push to the default branch was on 2026-04-23, and the most recent tagged release is preview-3 from 2019-06-11. The gap between those two dates means the tagged releases are far behind the branch the README tells you to use. If your project requires versioned releases with a support story, that mismatch is a real obstacle, and the README does not document a release cadence or a rollback procedure for the main branch.

How servo/pathfinder differs from NanoVG and Skia

The README names NanoVG in the canvas_nanovg example, and the workspace contains a utility directory called utils/svg-to-skia, which makes both useful reference points. NanoVG is a compact immediate-mode vector drawing library that rasterizes through the GPU's built-in path rasterization, with antialiasing produced by that hardware path. Pathfinder's compute mode instead does tiling with compute shaders and computes per-pixel fractional trapezoidal area coverage, which the README describes as effectively 256xAA. The practical difference appears with many overlapping paths: Pathfinder culls occluded geometry per tile, while a painter's-algorithm renderer draws hidden surfaces and discards them later. Skia is a full 2D graphics library with its own rasterization pipeline, and the presence of an svg-to-skia conversion utility in this repository suggests the two are used side by side rather than as substitutes. Pathfinder is narrower by design: the README says it aims for simplicity and generality instead of a large number of specialized fast paths, and it is organized as modular crates so you can omit what you do not need. If you want one library that also handles image decoding, color management and platform text shaping, Pathfinder's crate-by-crate approach asks more assembly work from you.

Licence, crates and the cost of tracking main

The repository carries LICENSE-APACHE and LICENSE-MIT, and the README says Pathfinder is licensed under the same terms as Rust itself, referring to both files. That is a permissive dual licence, and the README adds that the bundled Material Design icons are copyright Google Inc. and licensed under Apache 2.0, so the icon assets carry their own notice separate from the code. This is a description of what the files say, not legal advice; check the actual licence texts for your distribution model. The upgrade cost is the part worth weighing carefully. The README recommends the main branch for the latest features and bug fixes, while the newest tagged release listed in the repository is preview-3 from 2019-06-11. In practice that means pinning a crates.io version may leave you without fixes that exist only on main, and tracking main means building from a branch whose state changes without a release boundary. The workspace Cargo.toml reinforces how tightly the crates are coupled: it patches pathfinder_geometry and pathfinder_simd to local paths, and patches pathfinder_content, pathfinder_color, pathfinder_geometry, pathfinder_renderer and pathfinder_simd for the servo/pathfinder source, so a mixed setup of published and git dependencies needs care to stay consistent.

Editorial conclusion

Adopt servo/pathfinder if you are embedding vector or font rendering in a Rust or C/C++ application and your workload is dominated by many overlapping paths, where tile-based occlusion culling is the design bet. Do not adopt it if you need a stable, complete canvas implementation or a fully documented C API; the README says the library is incomplete in various areas and that the C bindings are less complete. Before committing, verify that your target GPU and backend combination is covered by the OpenGL, OpenGL ES, Metal or WebGL backends, and check whether the crates.io releases or the main branch carry the fixes you need, because the README recommends the main branch for the latest features and bug fixes.

Frequently asked questions

What is servo/pathfinder?

It is a GPU-based rasterizer for fonts and vector graphics, written primarily in Rust, that runs on OpenGL 3.0+, OpenGL ES 3.0+, WebGL 2 and Metal. It ships a library implementing a subset of the HTML canvas API plus Rust and C bindings.

How do I install servo/pathfinder for a Rust project?

The README says to run cargo build --release at the top level to build all the crates. The libraries are published on crates.io with the pathfinder_ prefix, such as pathfinder_canvas, though the README notes you may prefer the main branch for the latest features and bug fixes.

How do I build the C bindings for servo/pathfinder?

Install cargo-c with cargo install cargo-c, then run cargo cinstall with --destdir and --manifest-path c/Cargo.toml, and copy the staged files into place. The README states the resulting library is usable via pkg-config as pathfinder, and that the C bindings are currently less complete than the Rust ones.

Which GPUs and backends does servo/pathfinder support?

The README says any GPU capable of Direct3D 9, OpenGL 3.0 or WebGL 2.0 should be able to run it, including integrated and mobile GPUs. Backends are available for OpenGL, OpenGL ES, Metal and WebGL.

Is servo/pathfinder complete enough for production use?

The README states that Pathfinder is under heavy development and is incomplete in various areas, and that the C bindings are less complete than the Rust ones. The last push to the default branch was on 2026-04-23, while the newest tagged release is preview-3 from 2019-06-11.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. README
  4. Releases
  5. servo/pathfinder on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/servo-pathfinder.svg)](https://hysenlabs.com/projects/servo-pathfinder)