This PR aims to fix the incorrect mapping of font-weight values in the switch statement. The original implementation had an issue where UIFont.Weight.medium.rawValue would incorrectly map to a bold weight due to the raw value being 0.23000000417232513.
Changes
Updated the switch statement to map the font-weight values correctly based on Mozilla's documentation (MDN Web Docs).
Why this is important
The issue can cause unexpected behavior in text rendering, especially when comparing UIFont.Weight.medium.rawValue and weight.rawValue.
Test Plan
Validate the new font-weight values against Mozilla's documentation.
Run existing unit tests to ensure no regressions.
Add new unit tests to confirm the correct mapping of font-weight values.
Summary
This PR aims to fix the incorrect mapping of
font-weight
values in theswitch
statement. The original implementation had an issue whereUIFont.Weight.medium.rawValue
would incorrectly map to a bold weight due to the raw value being0.23000000417232513
.Changes
switch
statement to map thefont-weight
values correctly based on Mozilla's documentation (MDN Web Docs).Why this is important
The issue can cause unexpected behavior in text rendering, especially when comparing
UIFont.Weight.medium.rawValue
andweight.rawValue
.Test Plan
font-weight
values against Mozilla's documentation.font-weight
values.Checklist