linebender / linebender/vello

Fast specialized CPU glyph rasterization

Open
#1,692 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
4.3k
Forks
300
Avg merge
2d 13h
Merged PRs (30d)
61

Description

https://github.com/emilk/egui/issues/8093 notes that glyph rasterization in egui is slower using `skrifa`+`vello_cpu` compared to the old rendering using `ab_glyph`. To some extent that is expected and reflects that `skrifa`+`vello_cpu` renders glyphs at higher quality.

Nevertheless, `vello_cpu` is a generalized rasterisation pipeline that is slower than it could be for the task of rendering glyph outlines, and we may want to consider creating an optimised pipeline specifically for glyph rasterization.

I am assuming that this rasterizer would be only for regular "outline" glyphs and COLR glyphs would still use the regular `vello_cpu` pipeline. We may also want to consider whether we could/should support subpixel rendering.

### Prior Art

Potential sources of inspiration for such a renderer

- Raph's https://github.com/raphlinus/font-rs ([blog post](https://medium.com/@raphlinus/inside-the-fastest-font-renderer-in-the-world-75ae5270c445))
- Chad's https://github.com/dfrg/zeno (used in swash)
- Behdad's https://github.com/harfbuzz/harfbuzz/blob/main/src/hb-raster-draw.cc ([zulip thread](https://xi.zulipchat.com/#narrow/channel/296640-font-tech/topic/hb-raster.3A.20a.20new.20CPU.20rasterizer/with/575467244))
- FreeType's rasterizer
- Vello CPU

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by profiling the existing glyph path in vello_cpu and comparing it with the cited font-rs, zeno, HarfBuzz, and FreeType rasterizers. Define the scope for outline glyphs versus COLR glyphs and decide whether subpixel rendering is required. Done means an agreed specialized pipeline design with performance and quality criteria; the issue names no files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.