Skip to content

Commit

Permalink
doc: Typography and Language Specific Concepts
Browse files Browse the repository at this point in the history
  • Loading branch information
gmischler committed Feb 28, 2023
1 parent 7f307c3 commit 1bb75f5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion docs/Text.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ There are several ways in fpdf to add text to a PDF document, each of which come
| [`.write()`](#write) | several | no | no | auto | Inserts a multi-line text string within the boundaries of the page margins, starting at the current x/y location (typically the end of the last inserted text). |
| [`.write_html()`](#write_html) | several | no | yes | auto | An extension to `.write()`, with additional parsing of basic HTML tags.

## Typographical Limitations
## Typography and Language Specific Concepts

### Limitations
There are a few advanced typesetting features that fpdf doesn't currently support.

* Automatic ligatures - Some writing systems (eg. most Indic scripts such as Devaganari, Tamil, Kannada) frequently combine a number of written characters into a single glyph. This would require advanced font analysis capabilities, which aren't currently implemented.
Expand All @@ -30,6 +31,13 @@ some_text = 'اَلْعَرَبِيَّةُכַּף סוֹפִית'
fixed_text = get_display(reshape(some_text))
```

### Character or Word Based Line Wrapping
By default, `multi_line()` and `write()` will wrap lines based on words, using space characters and soft hyphens as seperators.
For languages like Chinese and Japanese, that don't usually seperate their words, character based wrapping is more appropriate.
In such a case, the argument `wrapmode="CHAR"` can be used (the default is "WORD"), and each line will get broken right before the
character that doesn't fit anymore.


## Text Formatting
For all text insertion methods, the relevant font related properties (eg. font/style and foreground/background color) must be set before invoking them. This includes using:

Expand Down

0 comments on commit 1bb75f5

Please sign in to comment.