8000 Migrate away from the `truetype` crate · Issue #28101 · servo/servo · GitHub
[go: up one dir, main page]

Skip to content
Migrate away from the truetype crate #28101
@SimonSapin

Description

@SimonSapin

In PR #27619 which updates rustc, a test failure shows that the truetype has code that calls std::mem::zeroed for at least one struct that contains a Vec.

This is Undefined Behavior, and newer Rust versions prevent it by panicking at runtime.

Unfortunately this problem is still present in the latest git commit for that crate, which is from 2017. Fixing it is likely possible but not trivial. Since we only use this crate in components/gfx/platform/windows/font.rs it might be easier to migrate to another crate that doesn’t have this problem. There exist several that can parse Truetype files. stb_truetype is already in our Cargo.lock (though I don’t know if we actually build it in typical configs, it might be behind a feature flag of an intermediate dependency). ttf-parser is under active maintenance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0