Skip to content

Commit

Permalink
update expected file and refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
Yingfang committed Dec 13, 2024
1 parent 83e6a26 commit cc4c4b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions platform/darwin/src/local_glyph_rasterizer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,11 @@ CGContextHandle context(CGBitmapContextCreate(

manufacturedGlyph.id = glyphID;
BOOL isBold = NO;
for (auto& fontName : fontStack) {
std::string lowercaseFont = platform::lowercase(fontName);
if (lowercaseFont.find("bold") != std::string::npos) {
// Only check the first font name to detect if the user prefers using bold
if (!fontStack.empty()) {
std::string lowercaseFont = platform::lowercase(fontStack.front());
if (lowercaseFont.find("bold") != std::string::npos && lowercaseFont.find("semibold") == std::string::npos) {
isBold = YES;
break;
}
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cc4c4b1

Please sign in to comment.