From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1US9Oy-00008f-ER for mharc-grub-devel@gnu.org; Tue, 16 Apr 2013 13:10:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US9Oq-0008VS-Qp for grub-devel@gnu.org; Tue, 16 Apr 2013 13:10:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1US9Ol-00069o-CY for grub-devel@gnu.org; Tue, 16 Apr 2013 13:10:32 -0400 Received: from mail-la0-x22e.google.com ([2a00:1450:4010:c03::22e]:34285) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US9Ol-00069G-3A for grub-devel@gnu.org; Tue, 16 Apr 2013 13:10:27 -0400 Received: by mail-la0-f46.google.com with SMTP id ea20so668469lab.5 for ; Tue, 16 Apr 2013 10:10:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:subject:message-id:in-reply-to:references :x-mailer:mime-version:content-type:content-transfer-encoding; bh=JY+xXq3bWVYV56wNaYvmMdcLxV0vgQW5RfSIusbnde0=; b=TOBbH3NXxLDIsHX7G3HkAS1YZGmklck6q3nITdphkdLho+Ea6n4J1iuxOeugYRyIpH DBZ5uB733sO/lDfi7/WRw6Os9E1/rR1HEaQ6Mq58CN1nhBo+MifqzI1BNd46mKIjVARt RhoZxLNgLxFBYNZHCooOuY648UPx69VsTyb2Geog/+iiqwhyEddw0HakrUyRdfITFUf5 ecUoviYZhzGjNpwSW4XVUGGCv1pWYP/z8LjtWXoXC348tSfHa44fdR85gj3pFU41q7x2 gVoh9UMul0Iqq2o9Z3Ntf0Hmz/f3Xde10nsouUfQJZ3e1sLzU0r5v73zaGQXMTzVbPme BdGQ== X-Received: by 10.112.150.4 with SMTP id ue4mr1834039lbb.28.1366132225417; Tue, 16 Apr 2013 10:10:25 -0700 (PDT) Received: from opensuse.site ([94.29.72.160]) by mx.google.com with ESMTPS id q4sm1220285lbi.14.2013.04.16.10.10.24 (version=SSLv3 cipher=RC4-SHA bits=128/128); Tue, 16 Apr 2013 10:10:24 -0700 (PDT) Date: Tue, 16 Apr 2013 21:10:23 +0400 From: Andrey Borzenkov To: grub-devel@gnu.org Subject: Re: [PATCH] multistring support in gui_label Message-ID: <20130416211023.34876656@opensuse.site> In-Reply-To: <1720724.fd4NVO69U8@icedphoenix> References: <1720724.fd4NVO69U8@icedphoenix> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.14; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22e 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: Tue, 16 Apr 2013 17:10:39 -0000 В Tue, 16 Apr 2013 13:04:28 +0400 Vladimir Testov пишет: > >Please don't use // comments. > O.k. I won't. > >This code completely forgets the cases > >when even the first word doesn't fit in the available space. > > Mmm. It can handle this case actually. > > >The code as whole breaks some unicode concepts like e.g. bidi stack. > > Didn't get what you mean. > > >Could you reuse the already available line-vreaking algorithm in > >normal/term.c and normal/charset.c ? Since the line-breaking is > >artificially disabled for labels it should require only minor > >adjustments to be reenabled. > > Yep! Here it is (patch included)! > > +/* Differs from grub_font_draw_line only in multiline output */ You mean grub_font_draw_string? Is it possible to extend this function instead of duplicating it? > +grub_err_t > +grub_font_draw_multiline (const char *str, grub_font_t font, > + grub_video_color_t color, > + int baseline_y, int font_height, > + int max_width, int max_height, > + int align) > + > + grub_err_t print_line () > + { > + while (pos != ptr) > + auto grub_ssize_t getcharwidth (const struct grub_unicode_glyph *c); > + grub_ssize_t getcharwidth (const struct grub_unicode_glyph *c) > + { > + return grub_font_get_constructed_device_width (font, c); > + } All nested functions were removed from trunk. Please do not reintroduce them. This should not even compile.