From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1USQiZ-0003mO-IX for mharc-grub-devel@gnu.org; Wed, 17 Apr 2013 07:40:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USQiV-0003kP-Uh for grub-devel@gnu.org; Wed, 17 Apr 2013 07:40:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USQiT-0003Eb-8U for grub-devel@gnu.org; Wed, 17 Apr 2013 07:39:59 -0400 Received: from collab.rosalab.ru ([217.199.216.181]:58661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USQiS-0003EU-Sl for grub-devel@gnu.org; Wed, 17 Apr 2013 07:39:57 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by collab.rosalab.ru (Postfix) with ESMTP id 4982F29C286; Wed, 17 Apr 2013 15:39:55 +0400 (MSK) X-Virus-Scanned: amavisd-new at rosalab.ru Received: from collab.rosalab.ru ([127.0.0.1]) by localhost (collab.rosalab.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cFzuzZfMA2DM; Wed, 17 Apr 2013 15:39:54 +0400 (MSK) Received: from icedphoenix.localnet (unknown [10.168.1.56]) by collab.rosalab.ru (Postfix) with ESMTPSA id AF4A629C1BD; Wed, 17 Apr 2013 15:39:54 +0400 (MSK) From: Vladimir Testov To: grub-devel@gnu.org Subject: Re: [PATCH] multistring support in gui_label Date: Wed, 17 Apr 2013 15:39:54 +0400 Message-ID: <1369975.AMEnTUhb9u@icedphoenix> User-Agent: KMail/4.9.5 (Linux/3.5.0-26-generic; KDE/4.9.5; x86_64; ; ) In-Reply-To: <21349117.1Nj3dUL9Cm@icedphoenix> References: <1720724.fd4NVO69U8@icedphoenix> <516E48DB.8070506@gmail.com> <21349117.1Nj3dUL9Cm@icedphoenix> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 217.199.216.181 Cc: Vladimir =?utf-8?B?J8+GLWNvZGVyL3BoY29kZXIn?= Serbinenko X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 11:40:01 -0000 On Wednesday, April 17, 2013 01:02:44 PM Vladimir Testov wrote: > O.k. Here it is. > > from grub-core/font/font.c line 1387 function blit_comb : > > do_blit (combining_glyphs[i], > > > > main_glyph->device_width > > > > + combining_glyphs[i]->offset_x, > > -(combining_glyphs[i]->height > > > > + combining_glyphs[i]->offset_y), &ctx); > > > > add_device_width (combining_glyphs[i]->device_width, &ctx); > > > > } > > > > } > > > > } > > > > add_device_width ((above_rightx > > > > > below_rightx ? above_rightx : below_rightx) - > > > > (main_glyph->offset_x + main_glyph->width), &ctx); > > > > add_device_width (above_leftx - main_glyph->offset_x, &ctx); > > if (glyph && glyph->device_width < min_devwidth) > > > > glyph->device_width = min_devwidth; > > > > if (device_width && *device_width < min_devwidth) > > > > *device_width = min_devwidth; > > ***device_width is changed sometimes. > > from grub-core/font/font.c line 1458 function grub_font_construct_dry_run : > > if (device_width) > > > > *device_width = main_glyph->device_width; > > > > if (!glyph_id->ncomb && !glyph_id->attributes) > > > > return main_glyph; > > > > combining_glyphs = grub_malloc (sizeof (combining_glyphs[0]) > > > > * glyph_id->ncomb); > > > > if (glyph_id->ncomb && !combining_glyphs) > > > > { > > > > grub_errno = GRUB_ERR_NONE; > > return main_glyph; > > > > } > > > > for (i = 0; i < glyph_id->ncomb; i++) > > > > combining_glyphs[i] > > > > = grub_font_get_glyph_with_fallback (main_glyph->font, > > > > glyph_id->combining[i].code); > > > > blit_comb (glyph_id, NULL, bounds, main_glyph, combining_glyphs, > > > > device_width); > > > > if (combining_glyphs_out) > > > > *combining_glyphs_out = combining_glyphs; > > > > else > > > > grub_free (combining_glyphs); > > > > return main_glyph; > > ***return value *device_width set to main_glyph->device_width before > main_glyph->device_width is changed during execution of blit_comb > > If we want to get device_width of some glyph - we use function > get_constructed_device_width. It returns device_width parameter of the asked > glyph with parameter *device_width of the function > grub_font_construct_dry_run. > > When we actually construct glyph, we take device_width from glyph- > > >device_width. > > The most adequate way to find device_width of grub_unicode_glyph is to call > grub_font_get_constructed_device_width. But it is miscalculated in some > cases. > > So these two values are different in some cases (This is all about problem > 2) > > Suggested patch to fix this problem (second one) is attached. > > I will remake the patch for multistring support for the upstream version. Looks like I've misunderstood something... Sorry. Can't see where the problem is... -- With best regards, _______________________________ Vladimir Testov, ROSA Laboratory. www.rosalab.ru