added LiberationSans font to resources

This commit is contained in:
iLLiCiTiT 2020-11-04 11:05:46 +01:00
parent d3aa437066
commit aff94de43b
6 changed files with 94 additions and 1 deletions

View file

@ -10,12 +10,28 @@ def get_resource(*args):
"""
return os.path.normpath(
os.path.join(
os.path.dirname(__file__),
os.path.dirname(os.path.abspath(__file__)),
*args
)
)
def get_liberation_font_path(bold=False, italic=False):
font_name = "LiberationSans"
suffix = ""
if bold:
suffix += "Bold"
if italic:
suffix += "Italic"
if not suffix:
suffix = "Regular"
filename = "{}-{}.ttf".format(font_name, suffix)
font_path = get_resource("fonts", font_name, filename)
return font_path
def pype_icon_filepath(debug=None):
if debug is None:
debug = bool(os.getenv("PYPE_DEV"))