Skip to content

Feature Request: Merge Font Types #3491

@TSIA-SN

Description

@TSIA-SN

Description

Currently there are two different sets types being used for fonts, one in Core and one in Types/Font. This causes the need to convert between the two if I want to make something that can take an object with various font details.

For example, say I have an object I want to use that has a fontWeight of 500. Something like:

const labelFont = {
  fontSize: 16,
  fontWeight: 500,
};

If I want to use it as the first param to matchFont, I need fontWeight to be a string so it matches the Weight type. However, if I wish to use that same object to style the font in a Paragraph with Skia.ParagraphBuilder.Make, I need it to be a number, so it matches the FontWeight enum.

It would be nice if there were consistent Font Types that were exported (matchFont's RNFontStyle and its associated types are not exported) and that would work all around.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions