From: Adrian Robert <adrian.b.robert@gmail.com>
To: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Cc: emacs-devel@gnu.org, Kenichi Handa <handa@m17n.org>
Subject: Re: fail on osx between 2/4/2009 and 2/5/2009
Date: Tue, 17 Feb 2009 12:26:08 +0200 [thread overview]
Message-ID: <5BF9D3EF-54F8-4386-BAF5-B7BCB510E4C1@gmail.com> (raw)
In-Reply-To: <wlhc2vi5kt.wl%mituharu@math.s.chiba-u.ac.jp>
On Feb 16, 2009, at 2:33 AM, YAMAMOTO Mitsuharu wrote:
>>>>>> On Thu, 12 Feb 2009 20:42:42 +0200, Adrian Robert
>>>>>> <adrian.b.robert@gmail.com> said:
>
>> When I first implemented the Cocoa font back-end, the list and match
>> APIs were mainly based around the font-entity structure, which
>> contained the following information:
>
>> foundry, family, adstyle, registry, weight, slant, width, size, dpi,
>> spacing, avgwidth
>
> Both the list and match are designed to take a font spec and returns
> either font entities or a font entity. So the knowledge of font specs
> as well as font entities were necessary to implement them properly in
> the first place.
At the beginning of font.h, font-spec and font-entity are described
as lists of properties, and then those properties are listed in
font_property_index. There is one property, "FONT_EXTRA_INDEX", that
serves as a kind of basket for various additional properties, that
don't merit being "first class" (listed explicitly) for whatever
reason. The doc says, "extra information of a font such as name,
OpenType features, and language coverage".
At the time I was writing the NS backend (fall 2006) -- with only
Handa-san's X impl and emacs's previous font-handling architecture to
go by -- it wasn't clear to me that although some of these properties
("OpenType features" and "name") were not important for all back-
ends, there were other "extra" properties, such as ":script" and
friends, that were.
>> Display of characters in multiple scripts was handled by the existing
>> emacs "fontset" structure. The "kludge" Yamamoto Mitsuharu refers to
>> was designed to allow this mechanism to work under NS without the
>> user or distributor needing to manually define a font set. It works
>> reasonably well, judging by the HELLO screen. Of course, users /
>> distributors always had the option to fall back to manual fontset
>> definitions to get better results as in other emacsen.
>
> Also, the existence of script-representative-chars you used in the
> kludge implies there were already some mechanisms such as the :script
> property in the font specs for selecting appropriate fonts without
> needing manual definition of fontsets. You could have noticed that if
> you read the implementations of other font backend drivers.
The only other impl was the X one, and it was difficult to separate
out from the code what was X-specific, and what was generally
applicable for all backends. At the time I understood that emacs
handled multiple scripts through explictly-defined fontsets. script-
representative-chars was there, but didn't seem to be used for
anything, and most of the X code seemed centered around low-level
font glyph encoding schemes like the "'japanese-jisx0208" and
"chinese-gb2312" that you use in your example, rather than scripts.
NS does not expose font glyph encoding schemes to the developer.
There were also the has_char() and encode_char() methods in the font
backend driver API. These led me to think that the determination of
whether a font was suitable for rendering a given script would be
done automatically by the font backend common code (through calling
these methods on representative characters). So I might not have
been as persistent in tracking down things relating to ":script" as I
might have been.
> In general, you should consider/propose platform-independent ways of
> solving problems/adding features rather than doing that by adding
> platform-specific kludges, unless they are inherently
> platform-specific matters. Such kludges might be acceptable for
> unofficial distributions, but not for the official Emacs distribution,
I agree that platform-independent is better. However I did not have
enough knowledge at the time of what Handa-san's full plans were, of
how X fonts worked in Xft/Freetype, nor whether what I did under NS
was possible under X. Nonetheless adding it was valuable because (a)
it allowed users on one platform to benefit from automatically-
generated fontsets, and (b) it COULD have inspired people who ARE
familiar with other platforms to try implementing something like it
themselves.
Allowing for some innovation around the edges on different platforms
can help drive the entire application forward on all systems.
Disallowing it, you have a situation where no one tries any new
features, because they cannot themselves do them for all platforms.
For example, the font backend system itself was started only on X.
That brought some new functionality, but it also "caught X up" to
functionality that had already been innovated on other platforms,
such as antialiasing.
Anyway, I appreciate your recent criticism which has been helpful in
improving the port, but it would be even nicer if you would help out
with the code. ;-) Together we could make it better and hopefully
satisfying all of your standards as well as mine and most importantly
the needs of users.
You have expressed reservations because you feel the port tries to do
things in a different way from the rest of emacs, but that is not
really accurate. It would be counterproductive. As I've said
before, the port aims for clean, clear code taking into account both
other ports' approaches and the fact that Cocoa is an OO API. It's
not always going to fit as well as Carbon or X, but it has been
improving. Certainly my efforts over the past months have been to
shift things rather towards using common approaches than away. It
doesn't happen overnight with a codebase of that size, but it gets
better, and your help would speed that process.
Adrian
next prev parent reply other threads:[~2009-02-17 10:26 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-07 1:15 fail on osx between 2/4/2009 and 2/5/2009 Randal L. Schwartz
2009-02-07 5:02 ` Will Farrington
2009-02-07 10:46 ` Adrian Robert
2009-02-09 2:52 ` Will Farrington
2009-02-10 6:42 ` Kenichi Handa
2009-02-10 6:47 ` Will Farrington
2009-02-10 8:08 ` Jules Colding
2009-02-10 8:44 ` YAMAMOTO Mitsuharu
2009-02-10 9:05 ` Jules Colding
2009-02-10 10:51 ` YAMAMOTO Mitsuharu
2009-02-10 12:06 ` Kenichi Handa
2009-02-10 13:06 ` Jason Rumney
2009-02-12 7:37 ` Kenichi Handa
2009-02-12 8:03 ` YAMAMOTO Mitsuharu
2009-02-12 10:22 ` Kenichi Handa
2009-02-12 18:42 ` Adrian Robert
2009-02-14 13:03 ` Kenichi Handa
2009-02-15 16:04 ` Adrian Robert
2009-02-16 0:53 ` Kenichi Handa
2009-02-16 4:09 ` Kenichi Handa
2009-02-17 10:15 ` Adrian Robert
2009-02-17 11:15 ` Kenichi Handa
2009-02-18 2:48 ` Kenichi Handa
2009-02-18 3:12 ` YAMAMOTO Mitsuharu
2009-02-18 4:01 ` Kenichi Handa
2009-02-18 5:43 ` YAMAMOTO Mitsuharu
2009-02-19 10:30 ` Adrian Robert
2009-02-24 2:55 ` Kenichi Handa
2009-02-16 0:33 ` YAMAMOTO Mitsuharu
2009-02-17 10:26 ` Adrian Robert [this message]
2009-02-17 11:09 ` YAMAMOTO Mitsuharu
2009-02-19 10:30 ` Adrian Robert
2009-02-20 1:19 ` YAMAMOTO Mitsuharu
2009-02-11 1:08 ` YAMAMOTO Mitsuharu
2009-02-10 12:59 ` William Xu
2009-02-09 14:39 ` William Xu
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5BF9D3EF-54F8-4386-BAF5-B7BCB510E4C1@gmail.com \
--to=adrian.b.robert@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=handa@m17n.org \
--cc=mituharu@math.s.chiba-u.ac.jp \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).