Skip to content

Commit

Permalink
fix bug ordering RTL runs on bidirectional text
Browse files Browse the repository at this point in the history
  • Loading branch information
andersonhc authored Mar 1, 2024
1 parent 7e1efc2 commit cdf7185
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ This can also be enabled programmatically with `warnings.simplefilter('default',
* [`FPDF.write_html()`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.write_html) now accepts a `tag_styles` parameter to control the font, color & size of HTML elements: `<a>`, `<blockquote>`, `<li>`...
* [`FPDF.write_html()`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.write_html) now accepts a `tag_indents` parameter to control, for example, the indent of `<blockquote>` elements
* allow to define custom `cell_fill_mode` logic for tables: [_Set cells background_ - documentation section](https://py-pdf.github.io/fpdf2/Tables.html#set-cells-background). Also added 2 new values: `TableCellFillMode.EVEN_ROWS` & `TableCellFillMode.EVEN_COLUMNS`: [documentation](https://py-pdf.github.io/fpdf2/fpdf/enums.html#fpdf.enums.TableCellFillMode)
### Fixed
* ordering RTL fragments on bidirectional texts
### Changed
* improved the performance of `FPDF.start_section()` - _cf._ [issue #1092](https:/py-pdf/fpdf2/issues/1092)
### Deprecated
Expand Down
2 changes: 1 addition & 1 deletion fpdf/line_break.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def get_ordered_fragments(self):
ordered_fragments = []
for run in directional_runs:
ordered_fragments += (
run[::1] if run[0].fragment_direction == TextDirection.RTL else run
run[::-1] if run[0].fragment_direction == TextDirection.RTL else run
)
return tuple(ordered_fragments)

Expand Down

0 comments on commit cdf7185

Please sign in to comment.