<div dir="ltr"><div dir="ltr">Hi Lubos,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Luboš Luňák <<a href="mailto:l.lunak@collabora.com">l.lunak@collabora.com</a>> 於 2021年4月29日 週四 上午1:19寫道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wednesday 28 of April 2021, Mark Hung wrote:<br>
> Anyway, if you need someone to verify text layout results with vertical<br>
> writing or<br>
> , don't hesitate to ask.<br>
><br>
> I can definitely help. I can also verify patches on Windows.<br>
> There is also a telegram group of TDF members from the CJK area if you<br>
> prefer.<br>
<br>
 The Skia VCL backend code for text drawing is <br>
SkiaSalGraphicsImpl::drawGenericLayout(). For non-vertical glyphs, the code <br>
is easy, just iterate over all glyphs and pass them to Skia with their <br>
positions, possibly rotated. That approach doesn't work well for vertical <br>
glyphs, for the tdf#103785 document I get [1], with the glyphs being <br>
positioned too high. If I apply the attached patch that moves all vertical <br>
glyphs down based on the glyph height, then I get [2], which appears to be at <br>
least roughly acceptable, although it doesn't look to be completely correct.<br>
<br>
 And I don't know how to make it correct. First of all, I don't know how to <br>
visually identify what is correct. At [3] I've uploaded screenshots of the <br>
document rendered by LO/Cairo, LO/GDI and Word2013. They are all different, <br>
both in X and Y positioning. Cairo draws them slightly to the left of the <br>
latin alphabet characters, GDI is roughly centered, Word draws them to the <br>
right. Vertically they also differ, I made sure to include cursor in all the <br>
screenshots and e.g. with the first glyph (中) the cursor doesn't touch the <br>
glyph with Word, it touches it with GDI and it overlaps the glyph with Cairo <br>
(the image may need zooming to see it clearly). Which of those are correct?<br>
<br></blockquote><div><br></div><div>To be honest, I can only verify from the point of view of a user who can read Chinese.</div><div><br></div><div>The cursor which overlaps the position doesn't seem right. It's not a big problem</div><div>as long as it does not strike through the glyph in the middle. But the inconsistence among</div><div>platforms might be a problem. </div><div>I would have tested fullwidth punctuations.</div><div>It went wrong in vertical writing before.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
 Second, I would need to express the correct positioning in the code. Do you <br>
know how to do that? I copied the glyph-size change in the attached patch <br>
from Cairo, it also moves in X direction by the font descent, but I'd prefer <br>
not to do random modifications without understanding them.<br>
<br></blockquote><div><br></div><div>I tried to make a patch to highlight the relative positions, and find out something that I added </div><div>to fix the issue - of course it can not complete fix the problem, but it may make more sense.</div><div><br></div><div><a href="https://gerrit.libreoffice.org/c/core/+/114887">https://gerrit.libreoffice.org/c/core/+/114887</a><br></div><div>( the image of the test of the patch is also attached. )</div><div><br></div><div>Vertical positioning there is more correct to me. It also doesn't overlap with the cursor. It introduce</div><div>horizontal offset issue unfortunately.</div><div><br></div><div>Hope that helps.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
[1] <a href="https://people.collabora.com/~llunak/skia/skia_current.png" rel="noreferrer" target="_blank">https://people.collabora.com/~llunak/skia/skia_current.png</a><br>
[2] <a href="https://people.collabora.com/~llunak/skia/skia_vert1.png" rel="noreferrer" target="_blank">https://people.collabora.com/~llunak/skia/skia_vert1.png</a><br>
[3] <a href="https://people.collabora.com/~llunak/skia/" rel="noreferrer" target="_blank">https://people.collabora.com/~llunak/skia/</a><br>
<br>
-- <br>
 Luboš Luňák<br>
 <a href="mailto:l.lunak@collabora.com" target="_blank">l.lunak@collabora.com</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Mark Hung<br></div></div></div></div>