From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: sand@blarg.net Newsgroups: gmane.emacs.devel Subject: Accumulated fontset definition tweaks for testing Date: Thu, 15 May 2008 21:19:07 -0700 Message-ID: <18477.2875.876651.446827@priss.frightenedpiglet.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1210911591 10574 80.91.229.12 (16 May 2008 04:19:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 May 2008 04:19:51 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 16 06:20:27 2008 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 1JwrQg-0002xB-Fp for ged-emacs-devel@m.gmane.org; Fri, 16 May 2008 06:20:26 +0200 Original-Received: from localhost ([127.0.0.1]:59986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JwrPr-000192-W5 for ged-emacs-devel@m.gmane.org; Fri, 16 May 2008 00:19:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JwrPo-00018x-55 for emacs-devel@gnu.org; Fri, 16 May 2008 00:19:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JwrPn-00018i-Jn for emacs-devel@gnu.org; Fri, 16 May 2008 00:19:31 -0400 Original-Received: from [199.232.76.173] (port=36738 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JwrPn-00018f-E1 for emacs-devel@gnu.org; Fri, 16 May 2008 00:19:31 -0400 Original-Received: from v-static-143-234.avvanta.com ([206.124.143.234]:52329 helo=priss.frightenedpiglet.com) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JwrPm-0008N2-JF for emacs-devel@gnu.org; Fri, 16 May 2008 00:19:31 -0400 Original-Received: (qmail 32290 invoked by uid 1000); 16 May 2008 04:19:08 -0000 X-Mailer: VM 8.0.9 under Emacs 23.0.60.1 (i486-pc-linux-gnu) X-URL: http://home.blarg.net/~sand X-detected-kernel: by monty-python.gnu.org: 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:97236 Archived-At: Below is the complete set of fontset changes that my system needed to display the HELLO file and Markus Kuhn's "UTF-8-demo.txt" file. There are various problems with the fontset definitions that we can fix in Emacs Lisp. 1. The "symbol" and "phonetic" scripts don't have any representative characters defined, and they don't have any fontset defined. 2. The Latin script doesn't have representative characters over 7-bits. This means the Xft backend doesn't have any constraint that would reject ISO8859-1 fonts. Emacs appears to have special support for real ISO8859-1 characters, so the new definition should not break anything. 3. The Armenian script has representative characters, but no fontset defined. 4. The Thai fontset definition assumes that you have OpenType set up. It needs a fallback in case you don't. 5. The Hangul fontset definition assumes that you have a language definition in your Hangul font. It needs a fallback in case you don't. Note that for some people, the "symbol", "phonetic" and Latin scripts may display just fine. The problem is that Emacs is not rejecting ISO8859-1 fonts---but if your installation happens to pick a ISO10646-1 font with coverage first then you won't see any weirdness. For example, my work machine had trouble displaying the scripts while my home machine did not. It may be that the Thai and Hangul definitions are the tip of the iceberg. I suspect that *every* ISO10646-1 fontset definition that uses :otf or :language needs a fallback definition that uses :script. If your HELLO file shows weird fonts being picked (such as a double-width Chinese font for U+2018 LEFT SINGLE QUOTATION MARK) or "missing font" boxes, can you please try putting the below code into your .emacs file to see if it fixes the problem? These were sufficent to get my work machine displaying every HELLO and "UTF-8-demo.txt" glyphs for every font that I had installed. This code can be applied to CVS HEAD before or after the font-backend merge. Derek -- Derek Upham sand@blarg.net ------------------------------ cut here ------------------------------ ;; The eval-after-load here is a hack for testing. These should ;; really be changes in "fontset.el". ;; ;; Some of the fontset definitions have 'prepend for testing. When ;; added to "fontset.el" they should go into some appropriate ;; location in the current lists. (eval-after-load "fontset" '(progn ;; Representative characters for Latin need to include the ;; various extension blocks. This should replace the existing ;; definition. (setq script-representative-chars (cons '(latin ?A ?Z ?a ?z #x00C0 #x0100 #x0180 #x1e00) script-representative-chars)) ;; Representative characters for symbols were not defined. (setq script-representative-chars (cons '(symbol #x201C #x2200 #x2500) script-representative-chars)) ;; Representative characters for phonetics were not defined. (setq script-representative-chars (cons '(phonetic #x0250 #x0283) script-representative-chars)) ;; 'latin script needs a declaration that incorporates the Latin ;; representative characters. None of the current ones do. (set-fontset-font "fontset-default" 'latin (font-spec :registry "iso10646-1" :script 'latin) nil 'prepend) ;; No 'symbol script declaration exists. Create one using the new ;; representative characters. (set-fontset-font "fontset-default" 'symbol (font-spec :registry "iso10646-1" :script 'symbol)) ;; No 'phonetic declaration exists. Create one using the new ;; representative characters. (Note that there is an 'ipa ;; declaration, but 'ipa doesn't exist as a real script.) (set-fontset-font "fontset-default" 'phonetic (font-spec :registry "iso10646-1" :script 'phonetic)) ;; No fontset was defined for Armenian. (set-fontset-font "fontset-default" 'armenian (font-spec :registry "iso10646-1" :script 'armenian)) ;; The Thai fontset definition assumes that you have OpenType ;; definitions set up properly. We need an explicit :script ;; declaration as a backup. I think this should go after the :otf ;; declaration, but I'm doing it as a 'prepend here. (Perhaps ;; FreeSerif Thai fonts comply with OpenType, but Misc-Fixed ;; ones don't.) (set-fontset-font "fontset-default" 'thai (font-spec :registry "iso10646-1" :script 'thai) nil 'prepend) ;; 'hangul script has a :language restriction for iso10646-1, but also ;; needs :script restriction as alternative. (set-fontset-font "fontset-default" 'hangul (font-spec :registry "iso10646-1" :script 'hangul) nil 'prepend) ))