From: Visuwesh <visuweshm@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: rpluim@gmail.com, 54646@debbugs.gnu.org
Subject: bug#54646: 29.0.50; set-fontset-font and font clipping issues
Date: Thu, 21 Apr 2022 20:20:45 +0530 [thread overview]
Message-ID: <87wnfitrqy.fsf@gmail.com> (raw)
In-Reply-To: <87v8vqcthz.fsf@gmail.com> (Visuwesh's message of "Sun, 03 Apr 2022 16:40:32 +0530")
[ஞாயிறு ஏப்ரல் 03, 2022] Visuwesh wrote:
> [Sunday April 03, 2022] Eli Zaretskii wrote:
>
>>> From: Visuwesh <visuweshm@gmail.com>
>>> Cc: rpluim@gmail.com, 54646@debbugs.gnu.org
>>> Date: Sun, 03 Apr 2022 15:56:35 +0530
>>>
>>> > The %c format is only good for single-byte characters, which these
>>> > ones aren't. Please use %x to print them (in hex).
>>> >
>>>
>>> Will do, thanks.
>>>
>>> > Also, I think printing everything is too much, and doesn't allow to
>>> > focus. Please print only when the character's code is one of those
>>> > involved in the problematic display.
>>>
>>> Unfortunately, the characters that are problematic tend to differ from
>>> each run. Nevertheless, I will hand-pick the problematic characters and
>>> send it.
>>
>> That'd be good. We need a reproducible case to work with.
>>
>>> > if (chars[char_idx] == CHAR1
>>> > || chars[char_idx] == CHAR2
>>> > || chars[char_idx] == CHAR3)
>>> > printf (...
>>> >
>>> > where CHAR1, CHAR2, and CHAR3 are the characters involved in the
>>> > problematic display, according to "C-u C-x =".
>>> >
>>> > May I suggest that you show me the code you add to hbfont.c before you
>>> > run it? This would avoid unnecessary iterations for you.
>>> >
>>>
>>> Sure,
>>
>> This is okay, but please don't forget to add that 'if' condition. I
>> think the characters involved in the composition, and in addition one
>> character on each side of those, should be enough.
>
> It seems like I did not get my point across: the characters that tend
> to be rendered problematic differ from each run so I will hand-pick the
> data for the problematic characters in _that_ run and send it.
>
>>
>> Please show the final code, so that I could then interpret the
>> print-outs correctly.
>>
>> Thanks.
>
> Considering the above, it would be
>
> [....]
It took me eons to do this again, I apologise for that. There's one
thing that I noticed about this issue: when I use this webpage
https://www.dinamalar.com/news_detail.asp?id=3012739 as a test page and
I let _all_ the scaled characters in that page be displayed, I cannot
reproduce the issue but if I let only some of the scaled characters in
that page be displayed and go to a part that was never displayed before,
the characters there have the "bad" shaping. I'm writing this here
in the hopes that it might help in debugging.
I was not successful in getting the data for all offending sequences.
The offending sequences were,
bb9 bbf -- ஹி
ba9 bc1 -- னு
bb5 bbf -- வி
b86 -- ஆ
and the GOOD case for bb9 bbf is
lbearing 1 rbearing 28 width 28 ascent 9 descent 5
1 bb9 bbf xadvance 1809 yadvance 0 xoffset 0 yoffset 0
xpos 0 yoff 0 wadjust 28
and the BAD case is
lbearing 1 rbearing 28 width 28 ascent 9 descent 5
1 bb9 bbf xadvance 3193 yadvance 0 xoffset 0 yoffset 0
xpos 0 yoff 0 wadjust 50
If you want more data, then I can try repeating this (I did not retry
since it is really tedious).
The data is for -Goss-Kurinto Seri-regular-normal-normal-*-17-*-*-*-*-0-iso10646-1
and HarfBuzz version is still at 4.2.0.
The patch I used is
diff --git a/src/hbfont.c b/src/hbfont.c
index 2721a66120..9432f75bbf 100644
--- a/src/hbfont.c
+++ b/src/hbfont.c
@@ -490,6 +490,7 @@ hbfont_shape (Lisp_Object lgstring, Lisp_Object direction)
: NULL;
if (!hb_font)
return make_fixnum (0);
+ printf("position_unit begin_hb_font: %f\n", position_unit);
hb_bool_t success = hb_shape_full (hb_font, hb_buffer, NULL, 0, NULL);
if (font->driver->end_hb_font)
@@ -589,10 +590,17 @@ hbfont_shape (Lisp_Object lgstring, Lisp_Object direction)
LGLYPH_SET_RBEARING (lglyph, metrics.rbearing);
LGLYPH_SET_ASCENT (lglyph, metrics.ascent);
LGLYPH_SET_DESCENT (lglyph, metrics.descent);
+ printf("lbearing %d rbearing %d width %d ascent %d descent %d\n",
+ metrics.lbearing, metrics.rbearing, metrics.width, metrics.ascent, metrics.descent);
xoff = lround (pos[i].x_offset * position_unit);
yoff = - lround (pos[i].y_offset * position_unit);
wadjust = lround (pos[i].x_advance * position_unit);
+ printf("%x %x %x xadvance %d yadvance %d xoffset %d yoffset %d\n",
+ (char_idx == 0 ? 1 : chars[char_idx-1]), chars[char_idx],
+ (char_idx == glyph_len-1 ? 1 : chars[char_idx+1]),
+ pos[i].x_advance, pos[i].y_advance, pos[i].x_offset, pos[i].y_offset);
+ printf("xpos %d yoff %d wadjust %d\n", xoff, yoff, wadjust);
if (xoff || yoff || wadjust != metrics.width)
LGLYPH_SET_ADJUSTMENT (lglyph, CALLN (Fvector,
make_fixnum (xoff),
next prev parent reply other threads:[~2022-04-21 14:50 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-31 3:37 bug#54646: 29.0.50; set-fontset-font and font clipping issues Visuwesh
2022-03-31 5:34 ` Eli Zaretskii
2022-03-31 7:03 ` Visuwesh
2022-03-31 7:11 ` Eli Zaretskii
2022-03-31 7:35 ` Visuwesh
2022-03-31 8:45 ` Visuwesh
2022-03-31 9:04 ` Eli Zaretskii
2022-03-31 9:29 ` Visuwesh
2022-03-31 9:41 ` Eli Zaretskii
2022-03-31 12:16 ` Visuwesh
2022-03-31 14:04 ` Eli Zaretskii
2022-03-31 13:44 ` Visuwesh
2022-03-31 14:10 ` Eli Zaretskii
2022-03-31 14:12 ` Eli Zaretskii
2022-03-31 15:07 ` Visuwesh
2022-03-31 16:49 ` Eli Zaretskii
2022-03-31 17:38 ` Robert Pluim
2022-04-01 1:05 ` Visuwesh
2022-04-01 3:08 ` Visuwesh
2022-04-01 8:49 ` Robert Pluim
2022-04-01 10:54 ` Eli Zaretskii
2022-04-01 11:38 ` Visuwesh
2022-04-01 12:14 ` Eli Zaretskii
2022-04-01 13:10 ` Visuwesh
2022-04-01 14:19 ` Eli Zaretskii
2022-04-01 14:58 ` Visuwesh
2022-04-01 15:27 ` Eli Zaretskii
2022-04-01 16:40 ` Visuwesh
2022-04-01 17:58 ` Eli Zaretskii
2022-04-03 9:15 ` Visuwesh
2022-04-03 10:06 ` Eli Zaretskii
2022-04-03 10:26 ` Visuwesh
2022-04-03 10:50 ` Eli Zaretskii
2022-04-03 11:10 ` Visuwesh
2022-04-21 14:50 ` Visuwesh [this message]
2022-04-22 7:23 ` Eli Zaretskii
2022-04-22 10:46 ` Visuwesh
2022-04-22 10:48 ` Eli Zaretskii
2022-06-11 13:54 ` Visuwesh
2022-06-12 1:34 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-06-12 5:55 ` Eli Zaretskii
2022-06-12 4:49 ` Visuwesh
2022-06-12 5:53 ` Eli Zaretskii
2022-06-12 7:47 ` Visuwesh
2022-06-12 10:16 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-08 11:48 ` Visuwesh
2022-10-08 12:42 ` Eli Zaretskii
2022-10-08 12:53 ` Visuwesh
2022-10-08 13:00 ` Eli Zaretskii
2022-10-09 11:31 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-09 11:59 ` Visuwesh
2022-03-31 7:48 ` Eli Zaretskii
2022-03-31 8:47 ` Visuwesh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wnfitrqy.fsf@gmail.com \
--to=visuweshm@gmail.com \
--cc=54646@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=rpluim@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).