servo / pathfinder

A fast, practical GPU rasterizer for fonts and vector graphics
Apache License 2.0
3.52k stars 198 forks source link

Pathfinder 3

Logo

Pathfinder 3 is a fast, practical, GPU-based rasterizer for fonts and vector graphics using OpenGL 3.0+, OpenGL ES 3.0+, WebGL 2, and Metal.

Please note that Pathfinder is under heavy development and is incomplete in various areas.

Quick start

Pathfinder contains a library that implements a subset of the HTML canvas API. You can quickly add vector rendering to any Rust or C/C++ app with it. The library is available on crates.io. See examples/canvas_minimal for a small example of usage.

Demos

Demo app sources are available in demo/native. Simply run:

$ cd demo/native
$ cargo run --release

A variety of small examples are also available to get you up and running quickly. For example, you can run the canvas_nanovg example like so:

$ cd examples/canvas_nanovg
$ cargo run --release

Features

The project features:

Building

Pathfinder can be used from either Rust or C/C++. See the appropriate section below.

Rust

Simply run cargo build --release at top level to build all the crates. Pathfinder is a set of modular crates, allowing you to select only the parts of the library you need and omit the rest. The libraries are available on crates.io with the pathfinder_ prefix (e.g. pathfinder_canvas), but you may wish to use the main branch for the latest features and bug fixes.

C

The C bindings use cargo-c. Install cargo-c with cargo install cargo-c, and then use a command like:

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

The resulting library is usable via pkg-config as pathfinder. For examples of use, see the examples in the examples/ directory beginning with c_.

cargo-c has a variety of other options such as --prefix, which may be useful for packagers.

Community

There's a Matrix chat room available at #pathfinder:mozilla.org. If you're on the Mozilla Matrix server, you can search for Pathfinder to find it. For more information on connecting to the Matrix network, see this wiki.mozilla.org page.

The entire Pathfinder community, including the chat room and GitHub project, is expected to abide by the same Code of Conduct that the Rust project itself follows. (At the moment, the authors will handle violations.)

Build status

Build Status

Authors

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

The logo was designed by Jay Vining.

License

Pathfinder is licensed under the same terms as Rust itself. See LICENSE-APACHE and LICENSE-MIT.

Material Design icons are copyright Google Inc. and licensed under the Apache 2.0 license.