wxMaxima
Loading...
Searching...
No Matches
Data Structures
Bidi.h File Reference

Reorders a line of text according to the Unicode Bidirectional Algorithm (UAX #9), for lines that mix left-to-right and right-to-left scripts. More...

#include <cstdint>
#include <vector>
#include <wx/string.h>
Include dependency graph for Bidi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  BidiRun
 One maximal run of same-direction text within a display line, in visual (left-to-right on screen) order. More...
 
class  Bidi
 

Detailed Description

Reorders a line of text according to the Unicode Bidirectional Algorithm (UAX #9), for lines that mix left-to-right and right-to-left scripts.

No wxWidgets backend exposes this itself: Pango/CoreText/DirectWrite (or Uniscribe) all compute it internally in order to shape and place the glyphs they draw, but none of them hand the logical-to-visual reordering back to the application, on any platform. EditorCell needs it anyway, to place the caret, the selection highlight and the click-to-position mapping correctly on a line that isn't wholly one direction - so this class recomputes it, using libfribidi where that is available at build time (see USE_FRIBIDI in BuildConfig.h). Where it isn't, GetRuns() returns the line as a single run in the given paragraph direction: the same single-direction approximation EditorCell used before this class existed, and still exactly what a build without libfribidi gets today.