All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vesa Jääskeläinen" <chaac@nic.fi>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] GSoC #10 new font engine (vs r1885)
Date: Sun, 05 Oct 2008 11:50:01 +0300	[thread overview]
Message-ID: <48E87FB9.8070603@nic.fi> (raw)
In-Reply-To: <20081004214640.5ab21f53@gibibit.com>

Colin D Bennett wrote:
> Clean patch against SVN revision 1885.
> 
> Regards,
> Colin

Thanks for the re-base.

Here are some comments about the patch.

Check the commenting of multi line comments.

> +int
> +grub_font_get_string_width (grub_font_t font, const char *str)
> +{
> +  int i;
> +  int width;
> +  struct grub_font_glyph *glyph;
> +  grub_size_t len;
> +
> +  len = grub_strlen (str);
> +
> +  for (i = 0, width = 0; i < len; i++)
> +    {
> +      glyph = grub_font_get_glyph (font, str[i]);
> +      width += glyph->device_width;
> +    }
> +
> +  return width;
> +}

I do not see this being utf-8 compatible eg. it breaks our Unicode
displaying support. See how grub_putchar() handles this.

There is also the same problem in grub_video_vbe_draw_string().

> === modified file 'conf/sparc64-ieee1275.rmk'
> --- conf/sparc64-ieee1275.rmk	2008-09-08 12:52:30 +0000
> +++ conf/sparc64-ieee1275.rmk	2008-10-05 04:30:04 +0000

As font code is common code. There is no need to modify sparc64 specific
makefile. You have correctly modified common.rmk so that is enough. If
sparc64 support should be moved to use common.rmk like any other arch.
Let it rot.

> === added file 'font/loader.c'
> --- font/loader.c	1970-01-01 00:00:00 +0000
> +++ font/loader.c	2008-10-05 04:30:04 +0000

> +/*
> +   Read a 16-bit big-endian integer from FILE, convert it to native byte
> +   order, and store it in *VALUE.
> +   Returns 0 on success, 1 on failure.
> + */
> +static int
> +read_be_uint16 (grub_file_t file, grub_uint16_t * value)

Are you fan of bigendian or why did you choose that :) ?

> +struct grub_font_glyph *
> +grub_font_get_glyph (grub_font_t font, grub_uint32_t code)

I would propose to but all public API's to one file.

> === modified file 'include/grub/video.h'
> --- include/grub/video.h	2008-10-05 04:28:39 +0000
> +++ include/grub/video.h	2008-10-05 04:30:04 +0000

Now that you have moved glyph rendering out from specialized glyph
rendering to bitmap rendering I would propose that no font rendering
code resides in Video API. I think this is a good move.

I would move that to font.mod (or perhaps to graphical terminal?). We
can adapt other graphical terminals to use video API to render stuff. It
just takes a bit time. But I think this time is as good as any to start
that process.

Lets have another look at it after those modifications :)

Thanks,
Vesa Jääskeläinen




  reply	other threads:[~2008-10-05  8:49 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-01 16:27 [PATCH] GSoC #10 new font engine Colin D Bennett
2008-10-05  4:46 ` [PATCH] GSoC #10 new font engine (vs r1885) Colin D Bennett
2008-10-05  8:50   ` Vesa Jääskeläinen [this message]
2008-10-30 19:11     ` [PATCH] GSoC #10 new font engine (UTF-8 support) Colin D Bennett
2008-10-31  3:57       ` [PATCH] GSoC #10 new font engine (UTF-8 support+bugfix) Colin D Bennett
2008-10-31 18:31         ` Matt Sturgeon
2008-10-31 19:50           ` Colin D Bennett
2008-11-04 20:19             ` Vesa Jääskeläinen
2008-11-04 20:31               ` Robert Millan
2008-11-04 20:52                 ` Colin D Bennett
2008-12-06 20:18         ` Vesa Jääskeläinen
2008-12-22 17:14           ` Colin D Bennett
2008-12-23 18:39             ` Vesa Jääskeläinen
2008-12-24  1:17               ` Colin D Bennett
2008-12-28  0:34                 ` Vesa Jääskeläinen
2008-12-28  0:35                   ` Vesa Jääskeläinen
2009-01-02 15:26                     ` Vesa Jääskeläinen
2008-12-28  8:44                   ` Arthur Marsh
2009-01-02 22:44                   ` Jerone Young
2009-01-02 22:57                     ` Vesa Jääskeläinen
2009-01-03  4:52                       ` Bean
2009-01-03  7:30                         ` Colin D Bennett
2009-01-03 16:45                     ` Colin D Bennett
2009-01-03 16:54                       ` Vesa Jääskeläinen
2009-01-05  5:05                       ` Jerone Young
2009-01-05  7:59                         ` Colin D Bennett
2009-01-05 13:29                           ` Jerone Young

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=48E87FB9.8070603@nic.fi \
    --to=chaac@nic.fi \
    --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.