Git Product home page Git Product logo

parley's Introduction

Parley

Rich text layout

Latest published parley version. Documentation build status. Dependency staleness status. Linebender Zulip chat. Apache 2.0 or MIT license.

Parley provides an API for implementing rich text layout. It is backed by Swash.

The Parley text stack

Currently, Parley directly depends on four crates: Fontique, Swash, Skrifa, and Peniko. These crates cover different pieces of the text-rendering process.

Peniko

Peniko builds on top of kurbo and provides vocabulary types for 2D rendering.

Peniko mostly just exports types like Blob, Color, Gradient, Brush, Point, Rect, Vec2, etc.

Fontique

Fontique provides font enumeration and fallback.

Font enumeration means listing (enumerating) all the fonts installed on the system. It also means collecting metadata about those fonts: whether they are serif, sans-serif, monospace, their weight, the code points they cover, etc. The library is responsible for loading fonts into memory; it will use memory-mapped IO to load portions into memory lazily and share them between processes on the system.

Font fallback is matching runs of text to a font. This is necessary because fonts typically don't cover the entire unicode range: you have different fonts for latin text, chinese text, arabic text, etc and also usually a separate font for emoji. But if you have, say arabic text or emoji embedded within latin text, you don't typically specify the font for the arabic text or the emoji, one is chosen for you. Font fallback is the process which makes that choice.

Skrifa

Skrifa reads TrueType and OpenType fonts.

It is built on top of the read-fonts low-level parsing library and is also part of the oxidize project.

Skrifa provides higher level metrics on top of read-fonts. Notably it converts the raw glyph representations in font files into scaled, hinted vector paths suitable for rasterisation.

Swash

Swash implements text shaping and some miscellaneous unicode-related features.

Text shaping means mapping runs of unicode codepoints to specific glyphs within fonts. This includes applying ligatures, resolving emoji modifiers, but also much more complex transformations for some scripts.

Swash's implementation is faster but less complete and tested than Harfbuzz and Rustybuzz.

Swash also implements font parsing, scaling, and hinting. This part of Swash is now superseeded by Skrifa: the implementation in Skrifa is directly descended from the one in Swash.

Parley

Parley itself does text layout.

Text layout means computing x/y coordinates for each glyph in a string of text. Besides what the other libraries do, this involves things like determining a glyph's size, line breaking, and bidi resolution.

In the future, Parley will likely also implement text selection and text editing helpers.

Minimum supported Rust Version (MSRV)

This version of Parley has been verified to compile with Rust 1.70 and later.

Future versions of Parley might increase the Rust version requirement. It will not be treated as a breaking change and as such can even happen with small patch releases.

Click here if compiling fails.

As time has passed, some of Parley's dependencies could have released versions with a higher Rust requirement. If you encounter a compilation issue due to a dependency and don't want to upgrade your Rust toolchain, then you could downgrade the dependency.

# Use the problematic dependency's name and version
cargo update -p package_name --precise 0.1.1

Community

Discussion of Parley development happens in the Linebender Zulip, specifically the #text stream. All public content can be read without logging in.

Contributions are welcome by pull request. The Rust code of conduct applies.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache 2.0 license, shall be licensed as noted in the License section, without any additional terms or conditions.

License

Licensed under either of

at your option.

parley's People

Contributors

dfrg avatar waywardmonkeys avatar xstrom avatar xorgy avatar nicoburns avatar poignardazur avatar jneem avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.