Skip to content

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
david-fed committed Jul 19, 2024
1 parent e386a16 commit 56d0f2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/TextStyling.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ An optional `markdown=True` parameter can be passed to the [`cell()`](fpdf/fpdf.
& [`multi_cell()`](fpdf/fpdf.html#fpdf.fpdf.FPDF.multi_cell) methods
in order to enable basic Markdown-like styling: `**bold**, __italics__, --underlined--`.

If your text contains Markdown-like styling that you don't want to apply, you can escape it using `\`. The escape character works the same way it generally does in Python (see the example below).
If the printable text contains a character sequence that would be incorrectly interpreted as a formatting marker, it can be escaped using `\`. The escape character works the same way it generally does in Python (see the example below).

Bold & italics require using dedicated fonts for each style.

Expand All @@ -192,8 +192,8 @@ from fpdf import FPDF

pdf = FPDF()
pdf.add_page()
pdf.set_font("Times", size=30)
pdf.cell(text="**Lorem** __Ipsum__ --dolor--", markdown=True)
pdf.set_font("Times", size=50)
pdf.cell(text="**Lorem** __Ipsum__ --dolor--", markdown=True, new_x='LEFT', new_y='NEXT')
pdf.cell(text="\\**Lorem\\** \\\\__Ipsum\\\\__ --dolor--", markdown=True)
pdf.output("markdown-styled.pdf")
```
Expand Down
Binary file modified docs/markdown-style.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 56d0f2c

Please sign in to comment.