Skip to content

Conversation

@hjick
Copy link
Contributor

@hjick hjick commented Oct 3, 2023

fix: #2696 (comment)

Description

I switched to weightKey -> weightValue.
The fontWeight BO, H, and BL were not applied to Android.

const weightsMap = {
THIN: 'T',
LIGHT: 'L',
REGULAR: 'R',
MEDIUM: 'M',
BOLD: 'BO',
HEAVY: 'H',
BLACK: 'BL'
};

_.forEach(keys, (key) => {
_.forEach(weightsMap, (weightValue, weightKey) => {
const fontKey = text${key} as keyof TypographyKeys;
const fontWeightKey = ${fontKey}${weightValue} as keyof TypographyKeys;
Typography[fontWeightKey] = {
...Typography[fontKey],
fontWeight: Constants.isIOS ? WEIGHT_TYPES[weightKey] : ['BO', 'H', 'BL'].includes(weightKey) ? 'bold' : undefined
};
});
});

In this codes, weightKey can never be included in ['BO', 'H', 'BL']. It can be only 'THIN', 'LIGHT', 'REGULAR' ....
weightValue must to be there.

Changelog

Fix fontWeight (BO, H, and BL) not applied to Android (thanks HyunJick Lee)

Additional info

#2696

@hjick
Copy link
Contributor Author

hjick commented Mar 22, 2024

@M-i-k-e-l hello, Can you check this PR? I think this PR fixed it.
I know you're busy, but could you please take a look?

Copy link
Collaborator

@M-i-k-e-l M-i-k-e-l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @hjick!
I've updated the PR description so it corresponds with our convention.

@M-i-k-e-l M-i-k-e-l merged commit ba2fc88 into wix:master Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

text70BO on iOS is bold but on Android is not bold.

3 participants