mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Du Huanpeng <u74147@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] font: fbconsole: add custom font support
Date: Fri, 13 Nov 2015 09:36:36 +0100	[thread overview]
Message-ID: <20151113083636.GC8526@pengutronix.de> (raw)
In-Reply-To: <1447323205-10743-1-git-send-email-u74147@gmail.com>

Hi,

On Thu, Nov 12, 2015 at 02:13:25AM -0800, Du Huanpeng wrote:
> add custom font and charset support. useful for
> non ascii chars, e.g. Chinese and others.
> 
> Signed-off-by: Du Huanpeng <u74147@gmail.com>
> ---
>  drivers/video/fbconsole.c   |  5 +++--
>  include/linux/font.h        | 11 ++++++++++-
>  lib/fonts/Kconfig           |  5 +++++
>  lib/fonts/Makefile          |  1 +
>  lib/fonts/font_7x14.c       |  1 +
>  lib/fonts/font_8x16.c       |  1 +
>  lib/fonts/font_custom_16x.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
>  lib/fonts/font_mini_4x6.c   |  1 +
>  lib/fonts/fonts.c           | 32 ++++++++++++++++++++++++++++++++
>  9 files changed, 98 insertions(+), 3 deletions(-)
>  create mode 100644 lib/fonts/font_custom_16x.c

I just sent a patch to the list which makes it possible to register the
fonts during runtime rather than putting them into an array during
compile time. Could you rebase your patch on this one?
It will allow you to register your (real) custom font more easily.

> diff --git a/lib/fonts/font_7x14.c b/lib/fonts/font_7x14.c
> index fe99871..60cb57e 100644
> --- a/lib/fonts/font_7x14.c
> +++ b/lib/fonts/font_7x14.c
> @@ -4113,4 +4113,5 @@ const struct font_desc font_7x14 = {
>  	.width	= 7,
>  	.height	= 14,
>  	.data	= fontdata_7x14,
> +	.index	= NULL,
>  };

No need to do that. Uninitialized members will be NULL anyway.

> +#include <linux/font.h>
> +#include <common.h>
> +
> +/* place real font data here or set fontdata_custom_16x points to
> + * the address of font data and also setup the index.
> + */
> +
> +static const unsigned char fontdata_custom_16x[] = {
> +	0xFF, 0xFF,	/*OOOOOOOOOOOOOOOO*/
> +	0x80, 0x01,	/*O______________O*/
> +	0x80, 0x01,	/*O______________O*/
> +	0x80, 0x01,	/*O______________O*/
> +	0x80, 0x01,	/*O______________O*/
> +	0x80, 0x01,	/*O______________O*/
> +	0x80, 0x01,	/*O______________O*/
> +	0x80, 0x01,	/*O______________O*/
> +	0x80, 0x01,	/*O______________O*/
> +	0x80, 0x01,	/*O______________O*/
> +	0x80, 0x01,	/*O______________O*/
> +	0x80, 0x01,	/*O______________O*/
> +	0x80, 0x01,	/*O______________O*/
> +	0x80, 0x01,	/*O______________O*/
> +	0x80, 0x01,	/*O______________O*/
> +	0xFF, 0xFF,	/*OOOOOOOOOOOOOOOO*/
> +};

Instead of a completely dummy font maybe we could add some example
characters. Something enough for a chinese hello world maybe? Or some
emoticons.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2015-11-13  8:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 10:13 Du Huanpeng
2015-11-13  8:36 ` Sascha Hauer [this message]

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=20151113083636.GC8526@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=u74147@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox