Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Rich text layout library

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

linebender/parley

Repository files navigation

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 bySwash.

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 ofkurbo and provides vocabulary types for 2D rendering.

Peniko mostly just exports types likeBlob,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 theread-fonts low-level parsing library and is also part of theoxidize 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 andsome 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 superseded by Skrifa: the implementation in Skrifa is directly descended from the one in Swash.

Parley

Parley itself does text layout and includes utilities for text selection and editing.

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.

Minimum supported Rust Version (MSRV)

This version of Parley has been verified to compile withRust 1.82 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 versioncargo update -p package_name --precise 0.1.1

Community

Discussion of Parley development happens in theLinebender Zulip, specifically the#parley channel.All public content can be read without logging in.

Contributions are welcome by pull request. TheRust 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 theLicense section, without any additional terms or conditions.

License

Licensed under either of

at your option.

Some files used for tests are under different licenses:

  • The font fileRoboto-Regular.ttf in/parley/tests/assets/roboto_fonts/ is licensed solely as documented in that folder (and is licensed under the Apache License, Version 2.0).
  • The font fileNotoKufiArabic-Regular.otf in/parley/tests/assets/noto_fonts/ is licensed solely as documented in that folder (and is licensed under the SIL Open Font License, Version 1.1).

[8]ページ先頭

©2009-2025 Movatter.jp