diff --git a/ofdgo_font_match.go b/ofdgo_font_match.go index 284f568..d6215d5 100644 --- a/ofdgo_font_match.go +++ b/ofdgo_font_match.go @@ -318,8 +318,11 @@ func fontDefaultSystemNames() []string { func fontNoSyntheticBold(names ...string) bool { for _, name := range names { for _, rule := range fontMatchRules { + if !rule.NoSyntheticBold { + continue + } level := fontRuleMatchLevel(rule, name) - if rule.NoSyntheticBold && level >= fontMatchExact && level <= fontMatchPartial { + if level >= fontMatchExact && level <= fontMatchPartial { return true } } diff --git a/ofdgo_renderer_text.go b/ofdgo_renderer_text.go index a1e4535..7b6acb1 100644 --- a/ofdgo_renderer_text.go +++ b/ofdgo_renderer_text.go @@ -139,7 +139,7 @@ func (r *Renderer) renderText(ctx *canvas.Context, obj TextObject, pageH float64 embeddedFont := false if of, ok := r.Reader.fontCache[fontID]; ok { embeddedFont = of.FontFile != "" - if !embeddedFont && fontNoSyntheticBold(of.FontName, of.FamilyName) { + if syntheticBold && !embeddedFont && fontNoSyntheticBold(of.FontName, of.FamilyName) { syntheticBold = false } if of.Bold {