Better font loading #34

Open
opened 2022-11-10 18:33:37 +00:00 by mars · 0 comments
Owner

Right now, scripts can only load fonts by family name. This means that they do not have access to italicized or bold font faces.

The script crates needs a new FontStyle enum:

pub enum FontStyle {
    Normal = 0,
    Italic = 1,
    Oblique = 2,
}

The ABI's font_load function should add new arguments:

  • style: FontStyle
  • weight: f32
  • stretch: f32

Canary should then forward this data into the FontStore when it loads a new face.

See font-kit's font properties docs for more info.

Right now, scripts can only load fonts by family name. This means that they do not have access to italicized or bold font faces. The `script` crates needs a new `FontStyle` enum: ```rs pub enum FontStyle { Normal = 0, Italic = 1, Oblique = 2, } ``` The ABI's `font_load` function should add new arguments: - `style: FontStyle` - `weight: f32` - `stretch: f32` Canary should then forward this data into the `FontStore` when it loads a new face. See [font-kit's font properties docs](https://docs.rs/font-kit/latest/font_kit/properties/struct.Properties.html) for more info.
mars added the
feature
abi change
labels 2022-11-10 18:33:37 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: canary/canary-rs#34
No description provided.