ParagraphStyle with ellipsis for only one line issue

57 views
Skip to first unread message

aisnote com

unread,
Apr 16, 2024, 12:44:02 PMApr 16
to skia-d...@googlegroups.com
hi, 

Recently, I found one issue on ParagraphStyle with ellipsis for only one line.
but the result seems not good.

The input is:

ParagraphStyle pgStyle;

    pgStyle.setEllipsis(u"\u2026");
    pgStyle.setMaxLines(1);
    pgStyle.setTextAlign(skia::textlayout::TextAlign::kLeft);

input: string strTest = "Hello world testwordingwithoutspaceandisVeryLog";

and the output is:
image.png

what I want is like: image.png

I debugged and found the longest line is not right.

Any ideas?

Thanks.

jlav...@google.com

unread,
Apr 22, 2024, 10:47:01 AMApr 22
to skia-discuss
I tried to reproduce the issue and it shows all correct for me in C++. 
There is something wrong with the text positioning and shifting... 
Could you please send the entire code snippet that produces the wrong result?
Also, what do you mean that "the longest line is not right"?


Reply all
Reply to author
Forward
0 new messages