Skip to content

Commit

Permalink
Update docs about NBSP (#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
rysson committed Jul 23, 2023
1 parent 0075d36 commit ca9b3fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This can also be enabled programmatically with `warnings.simplefilter('default',
- [`FPDF.table()`](https://pyfpdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.table): the `colspan` setting has been fixed - [documentation](https://pyfpdf.github.io/fpdf2/Tables.html#column-span)
- [`FPDF.image()`](https://pyfpdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.image): allowing images path starting with `data` to be passed as input
- the initial text color is preserved when using `FPDF.write_html()` - _cf._ [issue #846](https://github.com/PyFPDF/fpdf2/issues/846)
- variable-width non-breaking space support [issue #834](https://github.com/PyFPDF/fpdf2/issues/834)
### Deprecated
- the `center` optional parameter of [`FPDF.cell()`](https://pyfpdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.cell) is **no more** deprecated, as it allows for horizontal positioning, which is different from text alignment control with `align="C"`

Expand Down
5 changes: 3 additions & 2 deletions docs/Text.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ 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.
By default, `multi_line()` and `write()` will wrap lines based on words, using space characters and soft hyphens as separators.
Non-breaking spaces (\U00a0) do not trigger a word wrap, but are otherwise treated exactly as a normal space character.
For languages like Chinese and Japanese, that don't usually separate 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.

Expand Down

0 comments on commit ca9b3fa

Please sign in to comment.