Skip to content
A fast, practical GPU rasterizer for fonts and vector graphics
Rust GLSL Metal Other
Branch: master
Clone or download
pcwalton Merge pull request #225 from est31/optional_text_rendering
Make text rendering optional in pathfinder_canvas
Latest commit f89ed90 Aug 5, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
c Rename the feature text → pf-text Aug 5, 2019
canvas Rename the feature text → pf-text Aug 5, 2019
content Allow overloaded `*` to work between transforms and line segments and Jul 12, 2019
demo Overload `*` between transforms and points Jul 12, 2019
doc Don't use <style> elements in the architecture Markdown file Jan 3, 2019
examples Rename the feature text → pf-text Aug 5, 2019
export Fix SVG export in the demo; update `Cargo.lock` Jun 25, 2019
geometry Fix tests Jul 12, 2019
gl Rename `pathfinder_geometry::basic` to simply `pathfinder_geometry`, … Jun 21, 2019
gpu Rename `Transform2DF` to `Transform2F` and `Transform3DF` to `Transfo… Jul 11, 2019
lottie Initial rudimentary Lottie parsing code May 24, 2019
metal Use 2-lane instead of 4-lane SIMD types for 2D vectors. Jun 26, 2019
renderer don't run doc code Jul 16, 2019
resources Use a 3D transform in the tile vertex shaders. Jun 25, 2019
shaders Use a 3D transform in the tile vertex shaders. Jun 25, 2019
simd Use 2-lane instead of 4-lane SIMD types for 2D vectors. Jun 26, 2019
site Some more work on the site Mar 1, 2019
svg Fix incorrect definition of 2D transform multiplication Jul 12, 2019
swf don't return a reference Jul 19, 2019
text Overload `*` between transforms and points Jul 12, 2019
ui Use 2-lane instead of 4-lane SIMD types for 2D vectors. Jun 26, 2019
utils merge with master Jun 25, 2019
.gitignore Add a minimal macOS example app using the C Metal API Jun 25, 2019
.travis.yml add tests back to CI Jul 16, 2019
Cargo.lock Fix SVG export in the demo; update `Cargo.lock` Jun 25, 2019
Cargo.toml add default-members (and exclude metal). fixes #217 Jul 16, 2019
LICENSE-APACHE Add a license file to `partitionfinder/`, and copy it into the root d… Aug 7, 2017
LICENSE-MIT Add a license file to `partitionfinder/`, and copy it into the root d… Aug 7, 2017
README.md docs: fix typo Jul 6, 2019

README.md

Build Status

Pathfinder 3

Pathfinder 3 is a fast, practical, GPU-based rasterizer for fonts and vector graphics using OpenGL 3.0+, OpenGL ES 3.0+, or 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 app with it. See the examples/canvas_minimal for a small example of usage.

This example app requires SDL 2; see the "Building" section below for information on getting it up and running.

Demos

Demo app sources are available in demo/. A prebuilt package for Magic Leap can be found in releases.

Features

The project features:

  • High quality antialiasing. Pathfinder can compute exact fractional trapezoidal area coverage on a per-pixel basis for the highest-quality antialiasing possible (effectively 256xAA).

  • Fast CPU setup, making full use of parallelism. Pathfinder 3 uses the Rayon library to quickly perform a CPU tiling prepass to prepare vector scenes for the GPU. This prepass can be pipelined with the GPU to hide its latency.

  • Fast GPU rendering, even at small pixel sizes. Even on lower-end GPUs, Pathfinder typically matches or exceeds the performance of the best CPU rasterizers. The difference is particularly pronounced at large sizes, where Pathfinder regularly achieves multi-factor speedups. All shaders have no loops and minimal branching.

  • Advanced font rendering. Pathfinder can render fonts with slight hinting and can perform subpixel antialiasing on LCD screens. It can do stem darkening/font dilation like macOS and FreeType in order to make text easier to read at small sizes. The library also has support for gamma correction.

  • Support for SVG. Pathfinder 3 is designed to efficiently handle workloads that consist of many overlapping vector paths, such as those commonly found in SVG and PDF files. It can perform occlusion culling, which often results in dramatic performance wins over typical software renderers that use the painter's algorithm. A simple loader that leverages the resvg library to render a subset of SVG is included, so it's easy to get started.

  • 3D capability. Pathfinder can render fonts and vector paths in 3D environments without any loss in quality. This is intended to be useful for vector-graphics-based user interfaces in VR, for example.

  • Lightweight. Unlike large vector graphics packages that mix and match many different algorithms, Pathfinder 3 uses a single, simple technique. It consists of a set of modular crates, so applications can pick and choose only the components that are necessary to minimize dependencies.

  • Portability to most GPUs manufactured in the last decade, including integrated and mobile GPUs. Geometry, tessellation, and compute shader functionality is not required.

Building

Pathfinder 3 is a set of modular packages, allowing you to choose which parts of the library you need. An SVG rendering demo, written in Rust, is included, so you can try Pathfinder out right away. It also provides an example of how to use the library. (Note that, like the rest of Pathfinder, the demo is under heavy development and has known bugs.)

Running the demo is as simple as:

$ cd demo/native
$ RUSTFLAGS="-C target-cpu=native" cargo run --release

The SDL 2 library requires some additional manual installation steps. Follow the rust-sdl2 installation instructions to make sure the libraries are installed. Note that SDL2 is only required to run the demo; Pathfinder itself has no dependency on the library.

Authors

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

The logo was designed by Jay Vining.

Contributors to Pathfinder are expected to abide by the same Code of Conduct as Rust itself.

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.

You can’t perform that action at this time.