From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: Emacs Mac port Date: Fri, 27 Jul 2012 06:50:22 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: dough.gmane.org 1343339448 20737 80.91.229.3 (26 Jul 2012 21:50:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 26 Jul 2012 21:50:48 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 26 23:50:44 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SuVx3-00033G-8H for ged-emacs-devel@m.gmane.org; Thu, 26 Jul 2012 23:50:33 +0200 Original-Received: from localhost ([::1]:57811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuVx2-0001XU-JI for ged-emacs-devel@m.gmane.org; Thu, 26 Jul 2012 17:50:32 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuVwz-0001XC-MP for emacs-devel@gnu.org; Thu, 26 Jul 2012 17:50:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuVwy-0004ud-J5 for emacs-devel@gnu.org; Thu, 26 Jul 2012 17:50:29 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:49645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuVwy-0004uE-2C for emacs-devel@gnu.org; Thu, 26 Jul 2012 17:50:28 -0400 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 740F1C055D for ; Fri, 27 Jul 2012 06:50:22 +0900 (JST) In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-operating-system: by eggs.gnu.org: NetBSD 3.0 (DF) X-Received-From: 133.82.132.2 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:151894 Archived-At: >>>>> On Thu, 26 Jul 2012 18:45:11 +0900, YAMAMOTO Mitsuharu said: > The first update of Emacs 24 Mac port 3.x is available from > ftp://ftp.math.s.chiba-u.ac.jp/emacs/emacs-24.1-mac-3.1.tar.gz > The second update of Emacs 23 Mac port 2.x is also available from > ftp://ftp.math.s.chiba-u.ac.jp/emacs/emacs-23.4-mac-2.2.tar.gz I found that the preferred font family selection mechanism in the mac-ct font backend driver did not work on OS X 10.8 Mountain Lion. Please apply the patch below. This is not required for 10.7 and earlier, though it also works on these versions. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp === modified file 'src/macfont.c' *** src/macfont.c 2012-04-28 03:42:42 +0000 --- src/macfont.c 2012-07-26 21:39:20 +0000 *************** *** 2814,2840 **** if (charset_string && (length = CFStringGetLength (charset_string)) > 0) { ! CTFontRef last_resort = ! CTFontCreateWithName (CFSTR ("LastResort"), 0, NULL); ! if (last_resort) { ! CTFontRef font = CTFontCreateForString (last_resort, charset_string, ! CFRangeMake (0, length)); ! if (font) { ! result = CTFontCopyAttribute (font, kCTFontFamilyNameAttribute); ! ! if (CFStringCompare (result, CFSTR ("LastResort"), 0) ! == kCFCompareEqualTo) ! { ! CFRelease (result); ! result = NULL; ! } ! CFRelease (font); } ! CFRelease (last_resort); } } --- 2814,2862 ---- if (charset_string && (length = CFStringGetLength (charset_string)) > 0) { ! CFAttributedStringRef attr_string = NULL; ! CTLineRef ctline = NULL; ! CFDictionaryRef attrs = ! CFDictionaryCreate (NULL, NULL, NULL, 0, ! &kCFTypeDictionaryKeyCallBacks, ! &kCFTypeDictionaryValueCallBacks); ! if (attrs) { ! attr_string = CFAttributedStringCreate (NULL, charset_string, attrs); ! CFRelease (attrs); ! } ! if (attr_string) ! { ! ctline = CTLineCreateWithAttributedString (attr_string); ! CFRelease (attr_string); ! } ! if (ctline) ! { ! CFArrayRef runs = CTLineGetGlyphRuns (ctline); ! CFIndex i, nruns = CFArrayGetCount (runs); ! CTFontRef font; ! for (i = 0; i < nruns; i++) { ! CTRunRef run = CFArrayGetValueAtIndex (runs, i); ! CFDictionaryRef attributes = CTRunGetAttributes (run); ! CTFontRef font_in_run; ! ! if (attributes == NULL) ! break; ! font_in_run = ! CFDictionaryGetValue (attributes, kCTFontAttributeName); ! if (font_in_run == NULL) ! break; ! if (i == 0) ! font = font_in_run; ! else if (!mac_ctfont_equal_in_postscript_name (font, font_in_run)) ! break; } ! if (nruns > 0 && i == nruns) ! result = CTFontCopyAttribute (font, kCTFontFamilyNameAttribute); ! CFRelease (ctline); } }