Go to file
Josh Matthews 2cd534609d
Add arm64 to CI.
2020-04-07 11:15:29 -04:00
c Add the ability to merge scenes together, and expose it to the canvas API. 2020-04-02 14:04:58 -07:00
canvas Make text respect clip, blend mode, and opacity 2020-04-03 15:37:59 -07:00
color Add convenience color construction methods 2020-04-01 16:37:36 -07:00
content Remove `draw_render_target()` in favor of the standard tile-based rendering 2020-04-03 13:05:53 -07:00
demo Remove `draw_render_target()` in favor of the standard tile-based rendering 2020-04-03 13:05:53 -07:00
doc Don't use <style> elements in the architecture Markdown file 2019-01-03 10:40:31 -08:00
examples Add the tooltip to the NanoVG demo 2020-04-03 15:38:14 -07:00
export Add some implicit conversions between scalars and vectors where appropriate 2020-04-01 17:20:32 -07:00
geometry Add some more operators to rects and vectors 2020-04-02 11:59:11 -07:00
gl Stop leaking textures and framebuffers in the OpenGL backend. 2020-03-31 17:14:28 -07:00
gpu Add convenience constructors: `vec2f`, `vec2i`, `Vector2F::zero()`, 2020-03-31 11:29:21 -07:00
lottie Initial rudimentary Lottie parsing code 2019-05-23 18:03:09 -07:00
metal Add convenience constructors: `vec2f`, `vec2i`, `Vector2F::zero()`, 2020-03-31 11:29:21 -07:00
renderer Remove `draw_render_target()` in favor of the standard tile-based rendering 2020-04-03 13:05:53 -07:00
resources Improve ergonomics of the canvas font interface, and use the right fonts in the 2020-04-01 16:25:13 -07:00
shaders Add `precision highp sampler2D` everywhere so our winding numbers don't get clipped 2020-03-27 14:53:00 -07:00
simd Add missing packed comparisons to the scalar implementation of `I32x2` 2020-03-27 10:04:42 -07:00
site Some more work on the site 2019-03-01 14:58:02 -08:00
svg Add convenience constructors: `vec2f`, `vec2i`, `Vector2F::zero()`, 2020-03-31 11:29:21 -07:00
swf Add some implicit conversions between scalars and vectors where appropriate 2020-04-01 17:20:32 -07:00
text Make text respect clip, blend mode, and opacity 2020-04-03 15:37:59 -07:00
ui Add convenience constructors: `vec2f`, `vec2i`, `Vector2F::zero()`, 2020-03-31 11:29:21 -07:00
utils Update `image`, `glutin`, and `jni` crates. 2020-03-27 15:49:26 -07:00
webgl Update `image`, `glutin`, and `jni` crates. 2020-03-27 15:49:26 -07:00
.gitignore Split colors out into their own crate. 2020-01-31 09:17:04 +01:00
.travis.yml Add arm64 to CI. 2020-04-07 11:15:29 -04:00
Cargo.lock Improve ergonomics of the canvas font interface, and use the right fonts in the 2020-04-01 16:25:13 -07:00
Cargo.toml Add an embedded resource loader that places resources directly in the binary. 2020-02-28 17:10:53 -08: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 CoC in the community section 2020-02-28 10:07:27 -08:00

README.md

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+, 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.

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.

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.