All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Cc: Colin D Bennett <colin@gibibit.com>
Subject: Re: [PATCH] Font antialiasing v2
Date: Fri, 09 Apr 2010 19:54:07 +0200	[thread overview]
Message-ID: <4BBF69BF.1060105@gmail.com> (raw)
In-Reply-To: <1270446606.2581.41.camel@EK>

[-- Attachment #1: Type: text/plain, Size: 3094 bytes --]

Evgeny Kolesnikov wrote:
> 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? 
>
>   
I've run indent on the file in the tree. If you do the same on your tree
it should help.
You can also try generating patches with -bB
>> +#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).
>
>   
Well "current" doesn't mean "best possible". I want to know motivation
behind this packed/unpacked bit.
Mixing compression and font engine will make the code more complex and
bug prone. It's better to put compression layer below the font and make
font subsystem unaware of it. The only exception is if compression takes
advantage of knowing font structures.
>> 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.
>   
We can change the spec and make pff3. Also notice I didn't oppose to
glyph in memory having this info, only on disk
> Moreover I thinking about transparent gz or xz reader for font
> file. This will drastically reduce the size.
>
>   
You can already gz it.
>   
>> +  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.
>   
Ok then

-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]

  parent reply	other threads:[~2010-04-09 17:54 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
2010-04-05  5:50   ` Evgeny Kolesnikov
2010-04-05 21:33     ` Michal Suchanek
2010-04-09 17:54     ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
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=4BBF69BF.1060105@gmail.com \
    --to=phcoder@gmail.com \
    --cc=colin@gibibit.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.