diff --git a/es-core/src/resources/Font.cpp b/es-core/src/resources/Font.cpp index 897010a86..e325aa4a6 100644 --- a/es-core/src/resources/Font.cpp +++ b/es-core/src/resources/Font.cpp @@ -834,6 +834,9 @@ std::vector Font::shapeText(const std::string& text) hb_buffer_guess_segment_properties(mBufHB); hb_shape(segment.fontHB, mBufHB, nullptr, 0); + if (hb_buffer_get_direction(mBufHB) == HB_DIRECTION_RTL) + segment.rightToLeft = true; + glyphInfo = hb_buffer_get_glyph_infos(mBufHB, &glyphCount); length = glyphCount; } diff --git a/es-core/src/resources/Font.h b/es-core/src/resources/Font.h index 8f39e8b54..6bdfe2f56 100644 --- a/es-core/src/resources/Font.h +++ b/es-core/src/resources/Font.h @@ -194,6 +194,7 @@ private: float glyphsWidth; // TEMPORARY hb_font_t* fontHB; bool doShape; + bool rightToLeft; std::string substring; std::vector glyphIndexes; @@ -203,6 +204,7 @@ private: , glyphsWidth {0} // TEMPORARY , fontHB {nullptr} , doShape {false} + , rightToLeft {false} { } };