From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Adrian Robert Newsgroups: gmane.emacs.devel Subject: Font back end font selection process Date: Sun, 7 Jun 2009 10:54:09 +0700 Message-ID: <8BA022EF-AACD-495A-ABBB-24B230475217@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1244346891 20152 80.91.229.12 (7 Jun 2009 03:54:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Jun 2009 03:54:51 +0000 (UTC) To: Emacs-Devel devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 07 05:54:47 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MD9T1-0002Lk-OC for ged-emacs-devel@m.gmane.org; Sun, 07 Jun 2009 05:54:44 +0200 Original-Received: from localhost ([127.0.0.1]:52468 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MD9T1-0006aD-BU for ged-emacs-devel@m.gmane.org; Sat, 06 Jun 2009 23:54:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MD9Sv-0006a8-KK for emacs-devel@gnu.org; Sat, 06 Jun 2009 23:54:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MD9Sq-0006Zt-6b for emacs-devel@gnu.org; Sat, 06 Jun 2009 23:54:36 -0400 Original-Received: from [199.232.76.173] (port=35476 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MD9Sq-0006Zp-2V for emacs-devel@gnu.org; Sat, 06 Jun 2009 23:54:32 -0400 Original-Received: from mail-px0-f189.google.com ([209.85.216.189]:49820) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MD9Sp-0005ma-HY for emacs-devel@gnu.org; Sat, 06 Jun 2009 23:54:31 -0400 Original-Received: by pxi27 with SMTP id 27so2251101pxi.14 for ; Sat, 06 Jun 2009 20:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:mime-version :content-transfer-encoding:message-id:content-type:to:from:subject :date:x-mailer; bh=au2j6YCfnpfWxWKbBuLbc9J58c/YYAGHZAXmP9+8D9Q=; b=xQyIPjp0l80lK/Wk0ll754Z2p39YBhFjE+yfx7WHS73wocKzeCNM41SMI0D/6JGd42 Y65M5W5xyMcV+eiqJ0ANix3bnkET2zdLkzLvOm8nHRseTinGGaIsUpLol767C65xEuOM Gvf1JLyVKz+8EuU3l25AiceDonPhPWGhe9BN4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:content-transfer-encoding:message-id:content-type:to :from:subject:date:x-mailer; b=RJMb3k0fXM88SMzom5U39noWblvR2juYPM0pZV8uh6fd2zJWNIkWK2Bv880GwUHhiN Aw39ek2Am+Kudb3rRfe74dDe2ZhgZ2q4iSvSitj4r6fDoynSCi+PEJpry550v4g6+XvM uLXful2OS8HmKF+jW8iqp9qWwTPZW2z+dyXQ0= Original-Received: by 10.114.88.1 with SMTP id l1mr8457316wab.97.1244346870303; Sat, 06 Jun 2009 20:54:30 -0700 (PDT) Original-Received: from ?10.174.32.39? ([202.149.25.197]) by mx.google.com with ESMTPS id m25sm3088996waf.44.2009.06.06.20.54.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 06 Jun 2009 20:54:29 -0700 (PDT) X-Mailer: Apple Mail (2.753.1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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: news.gmane.org gmane.emacs.devel:111364 Archived-At: I am working on updating the NS font driver to work with script and friends so that correct nonASCII fonts can be chosen using the default fontset skeleton mechanism. The back end seems to use these methods to request a font from the list() method: - registry in the font spec proper - :script property in "extra" properties - :lang property in "extra" - part of the :otf property bundle in "extra" I haven't found a way to respond to the first type of query using Cocoa APIs yet. The others that get requested, and the order, seems to depend on the language in question. In particular, for some languages like Thai, only OTF requests ever seem to get made. It seems like this class might be the scripts requiring compositional rendering, but why, since emacs used to be able to handle compositional rendering without making use of any OTF-specific properties provided by a font driver? Also, often I have noticed that when given a Chinese text file (encoded in UTF-8), the only request that comes through is :lang=ja. How should the font driver know to return a kanji font instead of hiragana / katakana?. Wouldn't it would be better to request :script=han, adding :lang=ja or :lang=zh only if emacs has some knowledge that the file IS actually in one of these languages? The file encoding might be one piece of information to take into account, but when it is UTF-8 it would need to run some kind of lexical analysis, or query the user. I also noticed that if no entities are returned from a list() request with a family and a script specified, it next makes a list() request with no family specified. Instead of this it would be good to request a match() with the family still specified, as this gives the driver the opportunity to find a font that "looks like" the family (e.g. presence of serifs, etc.), instead of just a random font covering the needed characters. Indeed, I have not noticed match() being called at all when searching for a font for a script -- instead the back end just goes with the ascii font (and rendering boxes) before ever making such a request.