From owner-freebsd-current@FreeBSD.ORG Wed Jul 15 07:28:10 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB9F0106564A for ; Wed, 15 Jul 2009 07:28:10 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id 7ACC38FC0A for ; Wed, 15 Jul 2009 07:28:10 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id B6C7C1CF29; Wed, 15 Jul 2009 09:28:09 +0200 (CEST) Date: Wed, 15 Jul 2009 09:28:09 +0200 From: Ed Schouten To: Mel Flynn Message-ID: <20090715072809.GU48776@hoeg.nl> References: <4A5C9CE2.6060801@free.fr> <200907141204.12480.mel.flynn+fbsd.current@mailing.thruhere.net> <20090714201053.GR48776@hoeg.nl> <200907141418.20445.mel.flynn+fbsd.current@mailing.thruhere.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Y2MvAzIId+Qf2TkR" Content-Disposition: inline In-Reply-To: <200907141418.20445.mel.flynn+fbsd.current@mailing.thruhere.net> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: freebsd-current@freebsd.org Subject: Re: UTF-8 on 8.0-CURRENT: Yes We Can! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jul 2009 07:28:11 -0000 --Y2MvAzIId+Qf2TkR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Mel, * Mel Flynn wrote: > Would there be a screen font yet for Unicode? share/syscons/fonts > doesn't show me one. Or do you plan to retain mapping multibyte to > 8-bit positions? Right now my console driver already understands the notion of fonts, but unfortunately there is no ioctl/API to load them into the kernel. I've written a tool called fontcvt (in my Perforce branch) which converts .bdf files to a C file with some array initialisations. Eventually I'll modify this tool to emit binary data. I've looked at the Linux PSF2 format, but it has some restrictions... Some details about vt(4)'s handling of fonts: vt(4) allows you to use different glyphs for bold characters. To preserve space, fontcvt makes sure we never store two glyphs that are exactly the same. This means that if the bold character is the same as the normal one, it will only store one of them. All the different types of spaces (ASCII space, NBSP) are also stored as one glyph. The file format also has two remapping tables from Unicode code points to font indices; one for normal characters, one for bold characters. These tables have to be ordered, because the kernel will just do some binary searching. Each entry is also includes a length of the mapping, so right now mapping ASCII to its glyphs only takes one entry in the table. fontcvt also discards entries from the bold table if there is an equal one in the normal table. The kernel will display normal characters if there is no bold one. When there is no entry in any of the tables, it will always use glyph 0. fontcvt makes sure it stores the glyph for U+FFFD at location 0. Here's how I store the default in-kernel font: http://p4web.freebsd.org/@md=3Dd&c=3DWOQ@//depot/user/ed/newcons/sys/dev/v= t/font/font_default.c When I've finished the font loader, I'll just strip it down to ASCII, so we'll load the complete font through rc(8). --=20 Ed Schouten WWW: http://80386.nl/ --Y2MvAzIId+Qf2TkR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkpdhQkACgkQ52SDGA2eCwX7CwCeLJ4mcC9jqABbzIQcKXMwVcBd Q04An2O1Ah556YgqN6xNyLJe3mTmUkH+ =mpKZ -----END PGP SIGNATURE----- --Y2MvAzIId+Qf2TkR--