How LibreOffice Handles BiDi and RTL Text Rendering
LibreOffice provides full native support for bidirectional (BiDi) and right-to-left (RTL) scripts such as Arabic, Hebrew, Urdu, and Persian. By leveraging modern text-shaping engines, standard Unicode algorithms, and dedicated Complex Text Layout (CTL) settings, LibreOffice accurately shapes complex characters, handles mixed-direction text flow, and dynamically adjusts document layout structures to support RTL writing systems seamlessly.
Complex Text Layout (CTL) Framework
LibreOffice manages RTL and non-Latin scripts through its Complex Text Layout (CTL) framework. While standard Latin text uses simple left-to-right character positioning, RTL languages often require contextual glyph shaping, ligatures, and dynamic diacritic positioning. Users enable this functionality via Tools > Options > Language Settings > Languages, which unlocks specialized CTL typographic features, font selections, and alignment controls across all LibreOffice modules.
HarfBuzz and ICU Rendering Engines
Under the hood, LibreOffice relies on HarfBuzz as its primary text-shaping engine alongside International Components for Unicode (ICU) libraries. HarfBuzz processes OpenType font tables (such as GSUB for glyph substitution and GPOS for glyph positioning) to correctly render cursive connections in Arabic or vowel point placement in Hebrew. ICU provides the standard implementation of the Unicode Bidirectional Algorithm (UBA), ensuring characters are stored in logical memory order (the sequence they are typed) while being rendered on screen in correct visual order.
Handling Mixed-Direction Text
When a document contains both RTL and LTR text—such as Arabic sentences containing English product names or numbers—LibreOffice applies the Unicode Bidirectional Algorithm to resolve the visual placement of each run of text. Weak directional characters, punctuation, and neutral symbols are automatically oriented according to the surrounding paragraph context, preventing misplaced periods, brackets, or numerical sequences.
Paragraph and Sheet-Level Directionality
Directionality in LibreOffice Writer is established at the paragraph level rather than purely at the character level. Users can toggle paragraph direction between LTR and RTL via dedicated toolbar buttons or paragraph styles. Changing direction automatically flips text alignment, indents, tab stops, and bullet point placements. In LibreOffice Calc, directionality extends to entire spreadsheets, allowing users to reverse the grid layout so column A begins on the right side of the screen, matching natural RTL reading order.
Tables, Frames, and Object Reversal
Beyond body text, LibreOffice applies bidirectional logic to structured layout elements. In RTL mode, table columns order from right to left, header cells align accordingly, and cell navigation keys (Tab and arrow keys) invert to follow the expected reading path. Graphical elements, text frames, and page margins also adapt to right-to-left coordinate systems, ensuring consistent document formatting across exports to PDF, HTML, and native ODF formats.