Hi all, 

I was hoping someone who has an understanding of text layout might be able to 
help me. I have written a unit test for ImplLayoutRuns, but I would like to 
confirm my approach and understanding is correct. 

The patch on gerrit can be found here:

https://gerrit.libreoffice.org/c/core/+/121204 
<https://gerrit.libreoffice.org/c/core/+/121204>

In testImplLayoutRuns_AddPos() I add 7 positions. I assume these are glyph 
positions. 

What I think I’m doing is to setup a run of 3 non-RTL glyphs, then add a fourth 
RTL marker glyph, which makes a run of three characters with the RTL maker. I 
then create a non-RTL glyph position. etc.

The code being:

ImplLayoutRuns aRuns;
aRuns.AddPos(1, false);
aRuns.AddPos(2, false);
aRuns.AddPos(3, false);
aRuns.AddPos(4, true); // add RTL marker glyph
aRuns.AddPos(5, false);
aRuns.AddPos(6, true); // add RTL marker glyph
aRuns.AddPos(7, false);


I believe this creates a run of four LTR glyphs, then a run of 2 RTL glyphs, 
then a run of two LTR glyphs, and final run of 2 RTL glyphs. 

Can I clarify this is correct? And does each run explicitly include the RTL 
marker as the first glyph position? The test seems to show this. 

Chris

Reply via email to