From: Kenichi Handa <handa@m17n.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: cyd@stupidchicken.com, emacs-devel@gnu.org
Subject: Re: Font slants
Date: Tue, 08 Apr 2008 15:06:09 +0900 [thread overview]
Message-ID: <E1Jj6y9-0002PD-UI@etlken.m17n.org> (raw)
In-Reply-To: <jwv8wzrvjx0.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Sat, 05 Apr 2008 21:44:46 -0400)
In article <jwv8wzrvjx0.fsf-monnier+emacs@gnu.org>, Stefan Monnier <monnier@iro.umontreal.ca> 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
next prev parent reply other threads:[~2008-04-08 6:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-05 14:46 Font slants Chong Yidong
2008-04-05 18:28 ` Stefan Monnier
2008-04-05 19:27 ` Chong Yidong
2008-04-05 20:30 ` Stefan Monnier
2008-04-05 21:12 ` Chong Yidong
2008-04-06 1:44 ` Stefan Monnier
2008-04-08 6:06 ` Kenichi Handa [this message]
2008-04-05 21:46 ` Chong Yidong
2008-04-06 1:45 ` Stefan Monnier
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=E1Jj6y9-0002PD-UI@etlken.m17n.org \
--to=handa@m17n.org \
--cc=cyd@stupidchicken.com \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
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.