Skip to content

Add Font.set_named_instance(index) for variable fonts #13

Description

@hasanzakeri

Variable fonts often expose named instances (e.g. "Regular", "Bold", "Light Condensed"). harfrust supports ShaperInstance::from_named_instance(font, index) and ShaperInstance::set_named_instance(font, index), but our Font only exposes set_variations(...).

API:

font.set_named_instance(0)# apply named instance at index 0

Implementation parallels set_variations in src/font.rs:80 — direct field access on &self.data + &mut self.instance, dispatch on whether instance is Some.

Out of scope: enumerating available named instances (would require exposing the fvar table). Add only if asked.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions