Skip to content

Commit

Permalink
Merge pull request #44 from BojarLab/dev_gd_fp
Browse files Browse the repository at this point in the history
GlycoDraw now checks for file extensions only
  • Loading branch information
Old-Shatterhand authored May 17, 2024
2 parents b6b9619 + 9c90c56 commit 3e73a6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions glycowork/motif/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -2409,10 +2409,10 @@ def calculate_degree(y1, y2, x1, x2):
data = re.sub(r'<text font-size="17.5" ', r'<text font-size="17.5" font-family="century gothic" font-weight="bold" ', data)
data = re.sub(r'<text font-size="20.0" ', r'<text font-size="20" font-family="century gothic" ', data)
data = re.sub(r'<text font-size="15.0" ', r'<text font-size="17.5" font-family="century gothic" font-style="italic" ', data)
if 'svg' in filepath:
if filepath.endswith('.svg'):
with open(filepath, 'w') as f:
f.write(data)
elif 'pdf' in filepath:
elif filepath.endswith('.pdf'):
try:
from cairosvg import svg2pdf
svg2pdf(bytestring = data, write_to = filepath)
Expand Down

0 comments on commit 3e73a6b

Please sign in to comment.