From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NyfCW-0002yx-4s for mharc-grub-devel@gnu.org; Mon, 05 Apr 2010 01:50:20 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NyfCT-0002yr-Lu for grub-devel@gnu.org; Mon, 05 Apr 2010 01:50:17 -0400 Received: from [140.186.70.92] (port=41758 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NyfCR-0002yh-5c for grub-devel@gnu.org; Mon, 05 Apr 2010 01:50:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NyfCP-0006NR-S2 for grub-devel@gnu.org; Mon, 05 Apr 2010 01:50:15 -0400 Received: from mail-fx0-f227.google.com ([209.85.220.227]:53907) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NyfCP-0006NH-NG for grub-devel@gnu.org; Mon, 05 Apr 2010 01:50:13 -0400 Received: by fxm27 with SMTP id 27so659218fxm.8 for ; Sun, 04 Apr 2010 22:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:in-reply-to :references:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=03/BQgv8ObBs0/YoOkzlUhljZZPVftL7akj3p3pLDvQ=; b=P2Rqzy+KLG3c7ST7gmUQOXkXYxgEElASGtbx7i55mBVbvOu8YfZ7MqBd+nOaqCZsod 9z/+EREzlqU++wtSoa9a5UlIId4eSCuqnMy1kybiArcO2RqeKjmCXeJ7NW+g5neo8VQw 4OCnMTUciVGTElL7xLN2R4C4txEN8qE3ItG20= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; b=gdimAhJfzVx+T8JUxY9hGm0XpNrY3x+cUCFpwYjKc0ys4j0WGk4zrZtwrsg4SRSs1M Sw7Jk8KrfODNgEsL572I3K/UXCDpCxGUTZ/2dgTiGCOUAOZJlPOM99Foy/PVyd0BgY/2 Low/RdL/0yqWzqWGaB+aiPmImY3VTDAT0xhZ4= Received: by 10.87.13.6 with SMTP id q6mr7207219fgi.19.1270446609904; Sun, 04 Apr 2010 22:50:09 -0700 (PDT) Received: from [78.140.16.69] (main-nat.tomgate.net [88.204.14.4]) by mx.google.com with ESMTPS id 4sm15474572fge.28.2010.04.04.22.50.07 (version=SSLv3 cipher=RC4-MD5); Sun, 04 Apr 2010 22:50:08 -0700 (PDT) From: Evgeny Kolesnikov To: The development of GNU GRUB In-Reply-To: <4BB65231.10205@gmail.com> References: <1267019540.8797.9.camel@EK> <4BB65231.10205@gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Mon, 05 Apr 2010 12:50:06 +0700 Message-ID: <1270446606.2581.41.camel@EK> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] Font antialiasing v2 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 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: Mon, 05 Apr 2010 05:50:17 -0000 On Fri, 2010-04-02 at 22:23 +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote: > - for (j = font_info->ranges[i * 2]; j <= font_info->ranges[i * 2 + 1]; > - j++) > - add_char (font_info, face, j); > + for (j = font_info->ranges[i * 2]; j <= font_info->ranges[i * 2 + 1]; j++) > + add_char (font_info, face, j); > > Can you fix the style of your patch to avoid hunks like these? (Hint: > GNU indent) Most of sources related to font functionality contains awful mix of spaces and tabs. Should I fix this? Strictly use spaces everywhere? > - glyph_bitmap.mode_info.blit_format = GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED; > - glyph_bitmap.mode_info.bpp = 1; > - > - /* Really 1 bit per pixel. */ > - glyph_bitmap.mode_info.bytes_per_pixel = 0; > - > These bits need to be filled even if blit_format is set OK. > +#define FONT_FORMAT_STORAGE_PACK_MASK 0x0F > +#define FONT_FORMAT_STORAGE_PACKED 1 > +#define FONT_FORMAT_STORAGE_DEPTH_MASK 0xF0 > +#define FONT_FORMAT_STORAGE_1BIT 0 > +#define FONT_FORMAT_STORAGE_8BIT_GRAY 32 > Using entire byte for this is quite a waste. It's better to use 2 or 3 last bit as STORAGE_FORMAT This byte is already wasted with packed/unpacked bit. 3 bits actually, others as reserved. And I used reserved ones. See http://grub.gibibit.com/New_font_format (PFF2 spec, CHIX, item 2). > Also I doubt usefulness of a font in which only some glyphs are anti-aliased. Perhaps we could move antialiasing flags to file header and shave off few bytes? Yes this makes sense. I.e. substitution glyph for unknown symbol have no AA. Also frames and other geometry can benefit from this. Anyway this byte is already wasted in original spec. Moreover I thinking about transparent gz or xz reader for font file. This will drastically reduce the size. > Another point is that although storage_flags are present since some time trying to use antialised fonts in older grub will result in garbage. I prefer to put PFF3 signature if any flag is used. It will also allow more freedom it fields specification, Well, generally I agree. This will be more evident in case of troubles. > + fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red, > + src->mode_info->fg_green, > + src->mode_info->fg_blue, > + src->mode_info->fg_alpha); > background color isn't handled correctly (it's not always transparent) > + grub_uint8_t fa, a; Actually it always 0x00000000. See grub_font_draw_glyph: there is only FG color in declaration. Moreover I don't think that bg color is useful because we handle alpha channel correctly for fg and mask itself, so anyone can blit glyph onto everything he want. Also filling rectangle with color below text and then rendering only fg mask will be way more fast. But if you insist we should fix grub_font_draw_glyph and all it's callers at first place. How exactly? > Please avoid mixing declarations and code OK.