[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch for Mac OS X Text Drawing

From: Steven Tamm
Subject: Re: Patch for Mac OS X Text Drawing
Date: Sun, 16 Jan 2005 21:31:47 -0800

I'd rather not invest too much in this as the whole thing should be replaced with ATSUI. With emacs22 and the switch to UTF8, it'll make sense to redo all the font metric calculations. I put some time into this, and now that I'm healthier, I'll start working on it some more.

However, adding the quick and dirty anti-aliasing seemed straightforward enough. Switching over with every text call seemed like overkill, but I wanted to make it based on a variable. With reflection it should be a frame property; that'll make the use of CGTextMetrics practical.

It seems odd to specify a regexp that includes font, including font size, and then also specify a minimum font size. Perhaps relying on the system preferences (or on Silk) would be enough?


On Jan 16, 2005, at 7:18 PM, YAMAMOTO Mitsuharu wrote:

On Sat, 15 Jan 2005 16:39:19 -0800, Steven Tamm <address@hidden> said:

I've checked in a change that allows for anti-aliasing, but makes it
optional (personally I only use it for large fonts).  I added the
variable: mac-allow-anti-aliasing

I'd prefer specifying kQDUseCGTextMetrics as in

  (Emulations of the srcCopy text transfer mode in them are no longer
   needed because a recent change obviated the use of this mode.)

because that makes bold faces have the same width as their normal
ones.  But that requires additional modifications because the metrics
are no longer compatible between two kinds of rendering engines:
QuickDraw and Quartz 2D.  One way to do such modification would be
devising XLFD foundry names as "-apple quartz2d-..." or "-apple
cg-..." (or whatever).

Maybe we need to determine the followings:

  * What do we choose?

    - Kind of rendering engines?
    - Use of anti-aliasing?
    - Or both?

  * How do we choose?

    - By compilation option?
    - By XLFD?
    - By specifying the maximum font size by a lisp variable?
    - ...

And its customization should not be too complicated.

I'd suggest two candidates:

  1. Choose the kind of rendering engines by XLFD.
     I already have a prototype for this strategy.

  2. Fix the kind of rendering engines at a compilation time (Quartz
     2D by default for >= 10.2), and control only the use of
     anti-aliasing by a lisp variable.  The variable is a list of
     pairs of a regexp and a font size.  And it overrides the system
     provided setting of the maximum font size that uses
     non-anti-aliased fonts for those that match the regexp.

I've been thinking about the former, but now I'm inclined to push the

                                     YAMAMOTO Mitsuharu

Emacs-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]