From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH] Font antialiasing v2
Date: Fri, 02 Apr 2010 22:23:13 +0200 [thread overview]
Message-ID: <4BB65231.10205@gmail.com> (raw)
In-Reply-To: <1267019540.8797.9.camel@EK>
[-- Attachment #1: Type: text/plain, Size: 2533 bytes --]
Evgeny Kolesnikov wrote:
> Hello!
>
> Here is improved patch for fonts anti-aliasing. Includes:
>
> 1) Optimized blending blitters for 8-bit masks;
> 2) Absolute compatibility with pf2 format. No PFF3 magic additions.
>
> Affected files:
> font/font.c
> include/grub/fbblit.h
> include/grub/font.h
> include/grub/fontformat.h
> include/grub/video.h
> util/grub-mkfont.c
> video/video.c
> video/fb/fbblit.c
> video/fb/fbutil.c
> video/fb/video_fb.c
>
>
- 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)
- 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
+#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
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?
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,
+ 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;
Please avoid mixing declarations and code
+
> ------------------------------------------------------------------------
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]
next prev parent reply other threads:[~2010-04-02 20:23 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-24 13:52 [PATCH] Font antialiasing v2 Evgeny Kolesnikov
2010-03-16 11:22 ` Evgeny Kolesnikov
2010-03-17 21:21 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-04-02 20:23 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2010-04-05 5:50 ` Evgeny Kolesnikov
2010-04-05 21:33 ` Michal Suchanek
2010-04-09 17:54 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-04-09 19:56 ` Colin D Bennett
2010-04-11 10:20 ` Michal Suchanek
2010-04-12 7:31 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-04-12 14:24 ` Colin D Bennett
2010-04-12 15:50 ` Szymon Janc
2010-04-12 16:28 ` Michal Suchanek
2010-04-12 17:24 ` Michal Suchanek
2010-04-12 17:30 ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-04-12 18:13 ` Szymon Janc
2010-04-12 20:53 ` Michal Suchanek
2010-04-12 18:25 ` Michal Suchanek
2011-06-25 1:53 ` Vladimir 'φ-coder/phcoder' Serbinenko
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BB65231.10205@gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.org \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.