From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Florian Beck Newsgroups: gmane.emacs.help Subject: Re: getting unicode chars to show on Windows Date: Sat, 29 Aug 2009 01:40:26 +0200 Message-ID: <878wh3ecd1.fsf@sophokles.streitblatt.de> References: <66341491-5c5b-406a-bb4c-7f02b7709983@t11g2000prh.googlegroups.com> <9b617e7b-9840-499d-b22b-881e4a540a70@h21g2000yqa.googlegroups.com> <6e107769-cd13-43f0-ac9f-8daa9fb83c5e@a39g2000pre.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1251502895 11110 80.91.229.12 (28 Aug 2009 23:41:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Aug 2009 23:41:35 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Xah Lee Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Aug 29 01:41:28 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MhB4R-0006gy-6v for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Aug 2009 01:41:28 +0200 Original-Received: from localhost ([127.0.0.1]:57639 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MhB4Q-0003J1-L4 for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Aug 2009 19:41:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MhB3d-00032l-3s for help-gnu-emacs@gnu.org; Fri, 28 Aug 2009 19:40:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MhB3Y-00030y-FE for help-gnu-emacs@gnu.org; Fri, 28 Aug 2009 19:40:36 -0400 Original-Received: from [199.232.76.173] (port=56002 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MhB3Y-00030r-7g for help-gnu-emacs@gnu.org; Fri, 28 Aug 2009 19:40:32 -0400 Original-Received: from mo-p05-ob.rzone.de ([81.169.146.181]:29012) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1MhB3X-0003Kf-Ha for help-gnu-emacs@gnu.org; Fri, 28 Aug 2009 19:40:31 -0400 X-RZG-AUTH: :KmALZ0mpdbGonPxw7gDkop508XQjelhLxGYn4B74/iddlkME3ssvHN/NVn+dtQ6oeNmRD72T/ePg X-RZG-CLASS-ID: mo05 Original-Received: from flo-laptop (p54997A8E.dip.t-dialin.net [84.153.122.142]) by post.strato.de (mrclete mo10) (RZmta 21.0) with ESMTP id 907033l7SNK4mX ; Sat, 29 Aug 2009 01:40:28 +0200 (MEST) In-Reply-To: (Xah Lee's message of "Fri, 28 Aug 2009 07:00:57 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:67627 Archived-At: Xah Lee writes: > Hi Florian, > > thank for your info. I'll need to study it more... getting any unicode > char to display ... also wished to understand emacs fontset in some > detail, so am a bit slow and taking it easy. There are several posts > on this font issue recently... i think Peter? posted a fonset code > that supposed to make all unicode display...=20=20 Unlikely, unless you have the appropriate fonts installed. There are some fonts that cover many characters, like Code2000/Code2001 or Arial Unicode Ms, but, as you found out, the quality is not the best. Thats why I recommended using `set-fontset-font' to set the best font for a particular range. Start with defining two fontsets, e.g. (create-fontset-from-fontset-spec "-*-Courier New-medium-r-normal-*-14-*-*-*-*-*-fontset-mono") (create-fontset-from-fontset-spec "-*-DejaVu Serif-medium-r-normal-*-14-*-*-*-*-*-fontset-serif") or whatever you want to use for variable pitch. Don't worry about the string. The second element =C2=BBCourier New=C2=AB i= s the font family, the last is the name of the fontset. Switch with (set-frame-font "fontset-mono") and (set-frame-font "fontset-serif"). [Use a keybinding, e.g. (global-set-key (kbd "") '(lambda () (interacti= ve) (set-frame-font "fontset-serif")))] Once you find a better font for a particular range, use (set-fontset-font "fontset-mono" 'cherokee (font-spec :family "MPH 2B Damase" :size 24)) to modify your fontset.=20=20 > (saved to be studied later) A complication with emacs/fonts is that > different OS comes with different sets of fonts, and for particular > platform emacs also deals font differently ... > > Though, right now there's this one thing i need. How do i set a font > for the current frame? With `set-frame-font'. [You might also want to look into `buffer-face-mode' which allows a per-buffer setting, but works with faces.]=20 > What i want is a toggle-font code so that i can press a key and have > the font set to either a monospaced or variable-spaced one, and just > for the current frame.=20 First, try `variable-pitch-mode'. This works on the current buffer and may be all you want. > More specifically: > > =E2=80=A2 what's the elisp function that makes the current frame use Cour= ier > New?=20 (set-frame-font "Courier New") This also takes a fontset as an argument:=20 (set-frame-font "fontset-mono") > (i'll also need to know the full string or whatever that emacs uses > for what Windows calls the Courier New font.) Finding the right font name can be a bit tricky. But (font-family-list) shows the available fonts. > > Thanks. > > Xah > > On Aug 28, 3:40 am, Florian Beck wrote: >> > Thanks. Spent a couple of hours reading about emacs fonts... am still >> > pretty much nowhere.... agh emacs. >> >> Not sure what exactly your problem is, but here are a couple of pointers: >> >> To figure out what character ranges, fonts, etc I need, I use this site: >> >> http://www.alanwood.net/unicode/fontsbyrange.html >> >> Then you simply specify the font you want for specific characters (like >> Jason wrote), e.g. >> >> (set-fontset-font t 'cherokee >> (font-spec :family "MPH 2B Damase" :size 24)) >> >> Instead of the script name 'cherokee you can also use a range '(5024 . >> 5119) or '(#x13A0 . #x13FF) or specify the first and last character '(?= =E1=8E=A0 >> . ?=E1=8F=BF). >> >> After you have done this for the most important characters you can use >> something like >> >> (set-fontset-font t nil (font-spec :family "Code2000") nil 'prepend) >> >> Called with 'prepend, set-fontset-font will only affect characters that >> had no font previously, so you can use Code2000 as a fallback. >> >> If you want to use several fontsets or start from scratch, the easiest >> way is to define a fontset >> >> (create-fontset-from-fontset-spec >> "-*-DejaVu Sans Mono-medium-r-normal-*-14-*-*-*-*-*-fontset-mono") >> >> This fontset will be called fontset-mono, so you would use >> >> (set-fontset-font "fontset-mono" 'cherokee >> (font-spec :family "MPH 2B Damase" :size 24)) >> >> to modify it. >> >> Hope that helps. >> >> -- >> Florian Beck > --=20 Florian Beck