Skip to content

Commit

Permalink
fix: creating bold font by default
Browse files Browse the repository at this point in the history
  • Loading branch information
vcellu committed Jun 6, 2022
1 parent 4295caa commit bcc8269
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cpp/jsi/Text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ Text::Text(jsi::Runtime &rt, const jsi::Object &object) {
text = object.getProperty(rt, "text").toString(rt).utf8(rt);
SkScalar fontSize = static_cast<SkScalar>(Helium::toPx(object.getProperty(rt, "fontSize").asNumber()));
auto fontFamily = object.getProperty(rt, "fontFamily").toString(rt).utf8(rt);
auto typeFace = SkTypeface::MakeFromName(fontFamily.c_str(), SkFontStyle::Bold());
auto typeFace = SkTypeface::MakeFromName(fontFamily.c_str(), SkFontStyle::Normal());
auto fontManager = SkFontMgr::RefDefault();
if(!isASCII(text)) {
auto data = text.c_str();
auto sk = SkFontMgr::RefDefault();
const char *bcp47_locale = "";
SkUnichar unichar = nextUTF8(&data, data + text.size() );
auto tp = sk->matchFamilyStyleCharacter(fontFamily.c_str(), SkFontStyle::Normal(),
auto tp = fontManager->matchFamilyStyleCharacter(fontFamily.c_str(), SkFontStyle::Normal(),
&bcp47_locale, 1, unichar);
typeFace.reset(tp);
}
Expand Down

0 comments on commit bcc8269

Please sign in to comment.