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
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel