Fix bold fonts not being used
This commit is contained in:
parent
93872f8319
commit
a00e7fbed8
@ -42,7 +42,7 @@ def get_font(query, bold, italic):
|
|||||||
def find_font_for_character(family, char, bold=False, italic=False):
|
def find_font_for_character(family, char, bold=False, italic=False):
|
||||||
q = escape_family_name(family) + ':charset={}'.format(hex(ord(char[0]))[2:])
|
q = escape_family_name(family) + ':charset={}'.format(hex(ord(char[0]))[2:])
|
||||||
if bold:
|
if bold:
|
||||||
q += ':bold=200'
|
q += ':weight=200'
|
||||||
if italic:
|
if italic:
|
||||||
q += ':slant=100'
|
q += ':slant=100'
|
||||||
return get_font(q, bold, italic)
|
return get_font(q, bold, italic)
|
||||||
@ -52,7 +52,7 @@ def find_font_for_character(family, char, bold=False, italic=False):
|
|||||||
def get_font_information(q, bold=False, italic=False):
|
def get_font_information(q, bold=False, italic=False):
|
||||||
q = escape_family_name(q)
|
q = escape_family_name(q)
|
||||||
if bold:
|
if bold:
|
||||||
q += ':bold=200'
|
q += ':weight=200'
|
||||||
if italic:
|
if italic:
|
||||||
q += ':slant=100'
|
q += ':slant=100'
|
||||||
return get_font(q, bold, italic)
|
return get_font(q, bold, italic)
|
||||||
|
|||||||
@ -138,7 +138,7 @@ class Sprites:
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
text, attrs = key
|
text, attrs = key
|
||||||
bold, italic = attrs & BOLD_MASK, attrs & ITALIC_MASK
|
bold, italic = bool(attrs & BOLD_MASK), bool(attrs & ITALIC_MASK)
|
||||||
first, second = render_cell(text, bold, italic)
|
first, second = render_cell(text, bold, italic)
|
||||||
self.first_cell_cache[key] = first = self.add_sprite(first)
|
self.first_cell_cache[key] = first = self.add_sprite(first)
|
||||||
if second is not None:
|
if second is not None:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user