Skip to content

Commit

Permalink
Merge pull request #3799 from rettinghaus/fonts
Browse files Browse the repository at this point in the history
Minor fixes and updates on font generation
  • Loading branch information
ahankinson authored Sep 27, 2024
2 parents 1ba7b68 + cb948bb commit 1733592
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 150 deletions.
4 changes: 2 additions & 2 deletions fonts/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def generate_css(opts: Namespace) -> bool:
Et.register_namespace("", SVG_NS["svg"])
svg_font: Et.ElementTree = Et.parse(str(font_pth))
font_el: Optional[Et.Element] = svg_font.find(".//svg:defs/svg:font", SVG_NS)
if not font_el:
if font_el is None:
log.error("Could not find a font element in %s", font_pth.resolve())
return False

Expand Down Expand Up @@ -482,7 +482,7 @@ def __read_svg_font_file(
) -> Optional[tuple[str, str, str, list[Et.Element]]]:
font_xml: Et.ElementTree = Et.parse(fontfile)
font_el: Optional[Et.Element] = font_xml.find("svg:defs/svg:font", SVG_NS)
if not font_el:
if font_el is None:
log.error("Could not find a font definition in %s.", fontfile)
return None

Expand Down
2 changes: 1 addition & 1 deletion fonts/generate_plain_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@

except EnvironmentError:
print("Error opening font file %s!" % fontFileName)
os.sys.exit(1)
os.sys.exit(1)
Loading

0 comments on commit 1733592

Please sign in to comment.