From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: getting unicode chars to show on Windows Date: Sat, 29 Aug 2009 09:22:54 -0700 (PDT) Organization: http://groups.google.com Message-ID: 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 1251715250 21849 80.91.229.12 (31 Aug 2009 10:40:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 31 Aug 2009 10:40:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 31 12:40:44 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 1Mi4JX-0006te-63 for geh-help-gnu-emacs@m.gmane.org; Mon, 31 Aug 2009 12:40:43 +0200 Original-Received: from localhost ([127.0.0.1]:40393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mi4JW-0001OZ-8R for geh-help-gnu-emacs@m.gmane.org; Mon, 31 Aug 2009 06:40:42 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!u16g2000pru.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 147 Original-NNTP-Posting-Host: 76.102.12.87 Original-X-Trace: posting.google.com 1251562974 9741 127.0.0.1 (29 Aug 2009 16:22:54 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sat, 29 Aug 2009 16:22:54 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u16g2000pru.googlegroups.com; posting-host=76.102.12.87; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.43 Safari/530.5, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:172500 comp.emacs:98669 X-Mailman-Approved-At: Mon, 31 Aug 2009 06:34:33 -0400 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:67677 Archived-At: On Aug 28, 5:20 pm, "Drew Adams" wrote: > > How do i set a font for the current frame? > > M-x icicle-font S-TAB > > Choose any available font, using completion. Use `M-SPC', if you want to = match > different font parts separately (taking the intersection). > > > 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. More specifically: what's the elisp function > > that makes the current frame use Courier New? (i'll also need to > > know the full string or whatever that emacs uses for what Windows > > calls the Courier New font.) > > (set-frame-parameter nil 'font "-*-Courier > New-normal-r-*-*-14-112-96-96-c-*-iso8859-1") > > or whatever font you want. > > M-: (frame-parameters) is your friend. Thanks Drew & Florian. Spent another 1 hour on this, didn't want to go further at this moment but wanted to report some findings and reply. finally was able to get something useful: (defun cycle-font () "Change font in current frame, cycling thru a predefined set of fonts." (interactive) (if (not (eq last-command this-command)) (progn (set-frame-parameter nil 'font "-*-Courier New-normal-r-*- *-14-112-96-96-c-*-iso8859-1") (put this-command 'state "2")) (cond ((string=3D (get this-command 'state) "1") (set-frame-parameter nil 'font "-*-Courier New-normal-r-*- *-13-112-96-96-c-*-iso8859-1") (put this-command 'state "2")) ((string=3D (get this-command 'state) "2" ) (set-frame-parameter nil 'font "-outline-Lucida Sans Unicode- normal-normal-normal-sans-13-*-*-*-p-*-iso8859-1") (put this-command 'state "3")) ((string=3D (get this-command 'state) "3") (set-frame-parameter nil 'font "-outline-Code2000-normal-normal- normal-*-13-*-*-*-p-*-iso8859-1") (put this-command 'state "1")) ) ) ) (global-set-key (kbd "") 'cycle-font) This is for Windows Vista machine. Press a button it'll cycle among 3 fonts. Mostly for the purpose of switching between mono-width courier and variable-width lucida. The Code2000 is there just for the occation of viewing some unicode. Code2000 is so bad that it renders ascii dash/hyphen as invisible if the font size is not huge. Code2000 is not part of Windows Vista. You have to downloaded it, i wouldn't recommend it, just that i happened to already did and that seems to be the font containing the most unicode the elisp dealing is also painful, or, much less than ideal. Here's a outline of my problem. So, Drew showed me this (set-frame-parameter nil 'font "-*-Courier New-normal-r-*- *-14-112-96-96-c-*-iso8859-1") which is great. So, i wanted Lucida. So, logically, i replaced the courier name to lucida like this: (set-frame-parameter nil 'font "-*-Lucida Sans Unicode-normal-r-*- *-14-112-96-96-c-*-iso8859-1") but emacs spits out error. I didn't know what those 112, 96, 96 are, so i figured i replace them with asterisk. Tried a few variations, no go. After a while, i found this works: (set-frame-parameter nil 'font "Lucida Sans Unicode") (set-frame-parameter nil 'font "courier new") (set-frame-parameter nil 'font "Fixedsys") (set-frame-parameter nil 'font "FixedsysTTF") but i do need to set size because the size spec is not equivalent among fonts. e.g. One font at size 14 will be too large/small for another font at 14. So i need something like.: (set-frame-parameter nil 'font "Lucida Sans Unicode" 'size 12) after looking up some inline doc or elisp doc in few min, i can't find out what's the available parms for set-frame-parameter. But i did find this function: (frame-parameters) which gives out all the params/value pairs in a frame. So, after a while finding no easier way, i went thru the rather tedious process of using the menu to set a font, then run the frame-parameters and get the value of the font. So, i get the right font string spec for the fonts i want. e.g. "-*-Courier New-normal-r-*-*-13-112-96-96-c-*-iso8859-1" "-outline-Lucida Sans Unicode-normal-normal-normal-sans-13-*-*-*-p-*- iso8859-1" "-outline-Code2000-normal-normal-normal-*-15-*-*-*-p-*-iso8859-1" "-raster-Fixedsys-normal-normal-normal-mono-15-*-*-*-c-*-iso8859-1" "-outline-FixedsysTTF-semi-bold-normal-normal-mono-16-*-*-*-c-*- iso8859-1" btw, in my haphazard notes i found font-spec, e.g.. (font-spec :family "Unicode Symbols" :size 24) which turns out not useful here. now i got cycle-font, next job when i have time would be setting monospaced font whenever dired is opened or calendar (recently someone asked for that, which prob means lots others have the same question)... and also the job of getting all unicode to show... --------------- ok a question. Is there a doc that list all the params of set-frame- parameter? i've not attempted to read the elisp doc for the frame section or font/ faces section in some cover-to-cover manner... well eventually i'll have to do that. the cycle-font command above can be improved too... not happy with the state cycle code... hackish. Xah =E2=88=91 http://xahlee.org/ =E2=98=84