diff --git a/CHANGELOG.md b/CHANGELOG.md index d2763b548..957abe593 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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: ``, `
`, `
  • `... * [`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 `
    ` 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://github.com/py-pdf/fpdf2/issues/1092) ### Deprecated diff --git a/fpdf/line_break.py b/fpdf/line_break.py index 33505c9bc..af5877c45 100644 --- a/fpdf/line_break.py +++ b/fpdf/line_break.py @@ -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)