From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Steven Tamm Newsgroups: gmane.emacs.devel Subject: Re: Patch for Mac OS X Text Drawing Date: Sun, 16 Jan 2005 21:31:47 -0800 Message-ID: <14A8EE9A-6849-11D9-9ECE-000D93B67DC4@mac.com> References: <0F0CEC8B-6757-11D9-9ECE-000D93B67DC4@mac.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1105940387 10813 80.91.229.6 (17 Jan 2005 05:39:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 17 Jan 2005 05:39:47 +0000 (UTC) Cc: "Arthur G.P. Schuster" , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 17 06:39:40 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CqPc4-0002HK-00 for ; Mon, 17 Jan 2005 06:39:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CqPnt-0004HF-F4 for ged-emacs-devel@m.gmane.org; Mon, 17 Jan 2005 00:51:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CqPmP-00039Z-4L for emacs-devel@gnu.org; Mon, 17 Jan 2005 00:50:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CqPmF-00034n-Rr for emacs-devel@gnu.org; Mon, 17 Jan 2005 00:50:12 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CqPmE-00032w-Kt for emacs-devel@gnu.org; Mon, 17 Jan 2005 00:50:10 -0500 Original-Received: from [17.250.248.44] (helo=smtpout.mac.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CqPUa-0004Ir-I4 for emacs-devel@gnu.org; Mon, 17 Jan 2005 00:31:56 -0500 Original-Received: from mac.com (smtpin02-en2 [10.13.10.147]) by smtpout.mac.com (8.12.6/MantshX 2.0) with ESMTP id j0H5VrCS013271; Sun, 16 Jan 2005 21:31:54 -0800 (PST) Original-Received: from [10.0.1.201] (c-24-4-203-197.client.comcast.net [24.4.203.197]) (authenticated bits=0) by mac.com (Xserve/smtpin02/MantshX 4.0) with ESMTP id j0H5VmSh006412; Sun, 16 Jan 2005 21:31:50 -0800 (PST) In-Reply-To: Original-To: YAMAMOTO Mitsuharu X-Mailer: Apple Mail (2.619) 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: main.gmane.org gmane.emacs.devel:32283 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32283 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? -Steven On Jan 16, 2005, at 7:18 PM, YAMAMOTO Mitsuharu wrote: >>>>>> On Sat, 15 Jan 2005 16:39:19 -0800, Steven Tamm >>>>>> 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 > > http://lists.gnu.org/archive/html/emacs-devel/2003-08/msg00139.html > http://lists.gnu.org/archive/html/bug-gnu-emacs/2004-07/msg00095.html > (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 > latter. > > YAMAMOTO Mitsuharu > mituharu@math.s.chiba-u.ac.jp > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel