Skip to content

Commit

Permalink
Fix: markdown now processed correctly when adding BI or negating B or…
Browse files Browse the repository at this point in the history
… I base font - fix #1094
  • Loading branch information
Alan-Collins committed Jan 17, 2024
1 parent 9569ccb commit 4b95179
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fpdf/fpdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3189,6 +3189,12 @@ def _preload_font_styles(self, text, markdown):
if any("I" in frag.font_style for frag in styled_txt_frags):
# Ensuring italics font is supported:
self.set_font(style="I")
if any("BI" in frag.font_style for frag in styled_txt_frags):
# Ensuring bold italics font is supported:
self.set_font(style="BI")
if any("" in frag.font_style for frag in styled_txt_frags):
# Ensuring base font is supported:
self.set_font(style="")
for frag in styled_txt_frags:
frag.font = self.fonts[frag.font_family + frag.font_style]
# Restoring initial style:
Expand Down

0 comments on commit 4b95179

Please sign in to comment.