Skip to content

Commit b8c1816

Browse files
committed
fix(ios): fix the "given a font name rather than font family" condition
1 parent 46d3540 commit b8c1816

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

renderer/native/ios/renderer/HippyFont.mm

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,16 @@ + (UIFont *)updateFont:(UIFont *)font
284284
// Gracefully handle being given a font name rather than font family, for
285285
// example: "Helvetica Light Oblique" rather than just "Helvetica".
286286
if (!didFindFont && familyName.length > 0 && fontNamesForFamilyName(familyName).count == 0) {
287-
familyName = [HippyFont familyNameWithCSSNameMatching:familyName] ?: familyName;
288-
fontWeight = weight ? fontWeight : weightOfFont(font);
289-
isItalic = style ? isItalic : isItalicFont(font);
290-
isCondensed = isCondensedFont(font);
291-
font = cachedSystemFont(fontSize, fontWeight);
287+
font = [UIFont fontWithName:familyName size:fontSize];
288+
if (font) {
289+
didFindFont = YES;
290+
}
291+
else {
292+
fontWeight = weight ? fontWeight : weightOfFont(font);
293+
isItalic = style ? isItalic : isItalicFont(font);
294+
isCondensed = isCondensedFont(font);
295+
font = cachedSystemFont(fontSize, fontWeight);
296+
}
292297

293298
if (font) {
294299
// It's actually a font name, not a font family name,

0 commit comments

Comments
 (0)