From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: Font slants Date: Tue, 08 Apr 2008 15:06:09 +0900 Message-ID: References: <873aq09x7a.fsf@stupidchicken.com> <873aq0cdan.fsf@stupidchicken.com> <87y77s9fah.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1207634856 6822 80.91.229.12 (8 Apr 2008 06:07:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Apr 2008 06:07:36 +0000 (UTC) Cc: cyd@stupidchicken.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 08 08:08:08 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jj703-0007CA-To for ged-emacs-devel@m.gmane.org; Tue, 08 Apr 2008 08:08:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jj6zQ-00048Y-Pn for ged-emacs-devel@m.gmane.org; Tue, 08 Apr 2008 02:07:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jj6yP-0003qr-Qx for emacs-devel@gnu.org; Tue, 08 Apr 2008 02:06:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jj6yO-0003qP-J2 for emacs-devel@gnu.org; Tue, 08 Apr 2008 02:06:25 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jj6yO-0003qJ-EE for emacs-devel@gnu.org; Tue, 08 Apr 2008 02:06:24 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jj6yN-0001Lo-N7 for emacs-devel@gnu.org; Tue, 08 Apr 2008 02:06:24 -0400 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id m3866FiO006912; Tue, 8 Apr 2008 15:06:15 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp1.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id m3866Fg7006591; Tue, 8 Apr 2008 15:06:15 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp1.aist.go.jp with ESMTP id m3866ADs018152; Tue, 8 Apr 2008 15:06:10 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.69) (envelope-from ) id 1Jj6y9-0002PD-UI; Tue, 08 Apr 2008 15:06:09 +0900 In-reply-to: (message from Stefan Monnier on Sat, 05 Apr 2008 21:44:46 -0400) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-kernel: by monty-python.gnu.org: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:94671 Archived-At: In article , Stefan Monnier writes: > What we could do is to keep (in the new internal vector format) the > original names along side the numbers. This way the conversion > back can recover the original name without forcing the numbers to > be unique. > What do you think, Handa san? In the version I'm working on locally, I cancelled your change for assuring bijection of numeric and symbol style values. And, to recover the original X fontname, I changed the xfont driver to store proper information in the slot of FONT_EXTRA_INDEX in each font-entity. enum font_property_index { [...] /* In a font-spec, the value is an alist of extra information of a font such as name, OpenType features, and language coverage. In addition, in a font-entity, the value may contain a pair (font-entity . INFO) where INFO is an extra infomation to identify a font (font-driver dependent). */ FONT_EXTRA_INDEX, /* alist alist */ [...] That way, we can treat, for instance, font-weight-table as a table that provides symbolic representation of numeric weight values just for user convenience. The font selection routine and each font-backend always work on numeric values. So, if a user specifies the weight `light' and it's mapped to 50 in the table, each font-backend finds a font of weight 50 (not `light'). And, as names in font-weight-table are just for user convenience, we can delete, for instance, one of extra-bold and extrabold. The numeric values must have constant meaning; for instance, 100 is normal, 0 is the mininum weight/slant/width, 255 is the maximum weight/slant/width. Each font-backend must convert information of font's weight/slant/width to those values. The conversion algorithm is upto font-backend. For instance, in font-weight-table, all of medium, normal, regular are mapped to 100 (as the pre-unicode-merge emacs). If X font-backend finds two fonts whose XLFD-WEIGHT are `regular' and `medium' and thinks that their weight must be treated as the same `normal' value, it maps both values to 100. If it thinks they are different, `regular' may be mapped to 95. In any case, it keeps the information of the original weight name in FONT_EXTRA_INDEX slot. I need some more time to test the current code. When I think it gets stable, I'll make a new branch and commit the code in it. --- Kenichi Handa handa@ni.aist.go.jp