Skip to main content

Crate fontspector_checkhelper

Crate fontspector_checkhelper 

Source
Expand description

Checks in fontspector are made up of two parts: the implementation, which is a Rust function, and metadata: the check’s ID, rationale, proposal URL(s) and so on. This crate provides a procedural macro to help associate the metadata with the implementation.

To write a fontspector check, you need to implement a function that takes a Testable and a Context as arguments (for checks which operate on a single font) or a TestableCollection and a Context. You then decorate the function with the #[check(...)] macro, passing the metadata as arguments. The macro will generate the necessary code to associate the metadata with the implementation.

A function which takes a TestableCollection should have the argument implementation = "all" in the #[check(...)] attribute. This will

Attribute Macros§

check
A procedural macro to associate metadata with a check implementation.