mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: microcai@fedoraproject.org
Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
	brad@neruo.com
Subject: Re: [PATCH] Kernel fbcon UNICODE font support
Date: Sat, 27 Nov 2010 13:57:42 +0100	[thread overview]
Message-ID: <20101127125742.GD4865@const.famille.thibault.fr> (raw)
In-Reply-To: <1290750825.2372.59.camel@cai.gentoo>

Hello,

Microcai, le Fri 26 Nov 2010 13:53:45 +0800, a écrit :
>  I know there are most people speaking only English, and never meet
> non-ASCII characters on console. But, hey , what about others ?

Well, you can't deny that there _is_ some support for non-ASCII. But
just at most 512 glyphs and single width, indeed.

>  The first thing I need to handle is that, currently there is no room
> for adding UNICODE font, only 8bit for characters, how can you do?

(or 9bit, but no more indeed)

>  Also , some characters are double-width. So the solution is  make an
> backing store. 0xFE and 0xFF stands for character value store else
> where, and 0xFF means , left-half of the else where character, and 0xFE
> means right-half of the else where character. 
> 
>  This is a basic solution, the best is that making vc->vc_screenbuf
> store full UNICODE/attribute value, But changing it may break some
> drivers, so , currently I won't try that way. 

I'd much prefer the full unicode way, however.  Trying to hack around
with 0xFE/0xFF will just bring hard-to-fix bugs, while it's quite easy
to make sure we capture not-up-to-date drivers by changing field names
for instance.  I'd say we should first do that, and then it'll be
easy to move the old vgaposition/glyph translation cruft into the few
drivers that need it.  Yes, this seems to be the hard way.  But that's
the short-term hard then mid-term easy way, which is way easier to
accept than the short-term easy then mid/long-term tedious way that you
propose.

> The UNICODE font just too large to be included in e-mail, please follow

There is no way we want to include a big unicode font in the kernel :)

> In future, we don't have to compile  that big font into kernel, we
> should use setfont to load UNICODE font.

Yes.

> But, .psf does not support that much charcount (or maybe yes, and  I
> need some search? )

That's just a matter of fixing tools: the newer version of the psf
format already supports 2^16 glyphs.

> So, here is the patch that add UNICODE font handling functionary.

I've just had a quick glance over it, and there are quite a few things
that bother me, including:

> @@ -296,6 +295,8 @@ int set_selection(const struct tiocl_selection
> __user *sel, struct tty_struct *t
>  			}
>  			obp = bp;
>  		}
> +		if (c > 0x80)
> +			i += 2;
>  	}
>  	sel_buffer_lth = bp - sel_buffer;
>  	return 0;

That is the kind of hack that really shows your current approach will
most probably just bring us bugs.

> @@ -2171,6 +2205,8 @@ static int do_con_write(struct tty_struct *tty,
> const unsigned char *buf, int co
>  		rescan = 0;
>  		inverse = 0;
>  		width = 1;
> +		vc->vc_utf = 1;

?!
There is now way we can accept to systematically switch to utf-8.

> -		vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_NOWAIT);
> +		vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size * 2, GFP_NOWAIT);

With a proper switch to a "unicode character" type, this would rather be
"* sizeof(something)", so that choosing between 16bit unicode and 32bit
unicode would even be trivial.

Samuel

  reply	other threads:[~2010-11-27 12:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-26  5:53 Microcai
2010-11-27 12:57 ` Samuel Thibault [this message]
2010-11-27 16:18   ` microcai
2010-11-27 16:39     ` Samuel Thibault
2010-11-28  6:50   ` microcai
2010-11-28  8:15     ` Vojtech Pavlik
2010-11-28  8:29       ` Microcai
2010-12-02 13:50         ` James Simmons
2010-12-02 13:59           ` Samuel Thibault
2010-12-02 18:25             ` James Simmons
2010-11-28  8:47       ` Samuel Thibault

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=20101127125742.GD4865@const.famille.thibault.fr \
    --to=samuel.thibault@ens-lyon.org \
    --cc=brad@neruo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=microcai@fedoraproject.org \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®