mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 22:25:38 +00:00
RTL text segments are now flagged as such
This commit is contained in:
parent
09d16e9c16
commit
c87d2e7584
|
@ -834,6 +834,9 @@ std::vector<Font::ShapeSegment> Font::shapeText(const std::string& text)
|
||||||
hb_buffer_guess_segment_properties(mBufHB);
|
hb_buffer_guess_segment_properties(mBufHB);
|
||||||
hb_shape(segment.fontHB, mBufHB, nullptr, 0);
|
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);
|
glyphInfo = hb_buffer_get_glyph_infos(mBufHB, &glyphCount);
|
||||||
length = glyphCount;
|
length = glyphCount;
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,6 +194,7 @@ private:
|
||||||
float glyphsWidth; // TEMPORARY
|
float glyphsWidth; // TEMPORARY
|
||||||
hb_font_t* fontHB;
|
hb_font_t* fontHB;
|
||||||
bool doShape;
|
bool doShape;
|
||||||
|
bool rightToLeft;
|
||||||
std::string substring;
|
std::string substring;
|
||||||
std::vector<unsigned int> glyphIndexes;
|
std::vector<unsigned int> glyphIndexes;
|
||||||
|
|
||||||
|
@ -203,6 +204,7 @@ private:
|
||||||
, glyphsWidth {0} // TEMPORARY
|
, glyphsWidth {0} // TEMPORARY
|
||||||
, fontHB {nullptr}
|
, fontHB {nullptr}
|
||||||
, doShape {false}
|
, doShape {false}
|
||||||
|
, rightToLeft {false}
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue