-
- colorNames[name] = parseColor(color)
-
- for c in elementsWithTag(skin.childNodes, "fonts"):
- for font in elementsWithTag(c.childNodes, "font"):
- filename = str(font.getAttribute("filename") or "<NONAME>")
- name = str(font.getAttribute("name") or "Regular")
- scale = int(font.getAttribute("scale") or "100")
- is_replacement = font.getAttribute("replacement") != ""
- addFont(resolveFilename(SCOPE_FONTS, filename, path_prefix=path_prefix), name, scale, is_replacement)
-
- for windowstyle in elementsWithTag(skin.childNodes, "windowstyle"):
+
+ for c in skin.findall("fonts"):
+ for font in c.findall("font"):
+ get_attr = font.attrib.get
+ filename = get_attr("filename", "<NONAME>")
+ name = get_attr("name", "Regular")
+ scale = get_attr("scale")
+ if scale:
+ scale = int(scale)
+ else:
+ scale = 100
+ is_replacement = get_attr("replacement") and True or False
+ resolved_font = resolveFilename(SCOPE_FONTS, filename, path_prefix=path_prefix)
+ if not fileExists(resolved_font): #when font is not available look at current skin path
+ skin_path = resolveFilename(SCOPE_CURRENT_SKIN, filename)
+ if fileExists(skin_path):
+ resolved_font = skin_path
+ addFont(resolved_font, name, scale, is_replacement)
+ #print "Font: ", resolved_font, name, scale, is_replacement
+
+ for windowstyle in skin.findall("windowstyle"):