From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juhapekka Tolvanen Newsgroups: gmane.emacs.help Subject: Re: emacs with truetype fonts Date: Mon, 08 Nov 2004 18:36:04 +0200 Organization: What?+ Me organized?+ Never!1 Message-ID: <87bre8s3gr.fsf@heresy.ainola.jyu.fi> References: <877jows5k2.fsf@hasecke.com> Reply-To: SNAFU.juhtolv@iki.fi.FUBAR.invalid NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1099932414 9117 80.91.229.6 (8 Nov 2004 16:46:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 8 Nov 2004 16:46:54 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 08 17:46:42 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CRCfC-0005sm-00 for ; Mon, 08 Nov 2004 17:46:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CRCnY-00068k-7C for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Nov 2004 11:55:20 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!bloom-beacon.mit.edu!news2.telebyte.nl!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder2.news.jippii.net!feeder1.news.jippii.net!newsfeed1.funet.fi!newsfeeds.funet.fi!mordred!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 234 Original-NNTP-Posting-Host: heresy.ainola.jyu.fi Original-X-Trace: mordred.cc.jyu.fi 1099931744 29794 130.234.191.114 (8 Nov 2004 16:35:44 GMT) Original-X-Complaints-To: newsmaster@cc.jyu.fi Original-NNTP-Posting-Date: Mon, 8 Nov 2004 16:35:44 +0000 (UTC) X-User-Agent-URL: http://www.gnus.org/ User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:tB4tSzQuPNaeXSUBlB5Q4RQ/jIc= Original-Xref: shelby.stanford.edu gnu.emacs.help:126437 Original-To: help-gnu-emacs@gnu.org 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: main.gmane.org gmane.emacs.help:21828 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:21828 Jan Ulrich Hasecke writes: > I can use gvim with truetype fonts on my debian notebook. Very nice is > LMTypewriter from the tex lmodern fonts. I think those lmodern-fonts you see in your gvim are not True Type -fonts at all. They are Type 1 -fonts. > Can I use these fonts in emacs too? It looks nicer than courier. Just use a program called xfontsel and try to find a good font. Don't define charset. Then click "Select". Now that font-definition is in buffer of your mouse. Paste that fontdefinition to your ~/.Xresources -file with middle-button of your mouse. If your mouse has just two buttons, you can emulate middle-button by pressing both puttons simultaneously. Create also these symbolic links: ln -s ~/.Xresources ~/.Xdefaults ln -s ~/.Xresources ~/.xresources After each update of .Xresources run this command to enable those settings immediately: xrdb -merge $HOME/.Xresources Then you need to restart your emacs. Here are my emacs-related X-resources: ----- Clip here ----- ! {{{ emacsen ! Somehow these X-resources do not have efect for first window in my GNU Emacs. emacs.font: -*-bitstream vera sans mono-medium-r-normal-*-*-100-100-100-m-*-*-* Emacs.pane.menubar.font: -*-bitstream vera sans-medium-r-normal-*-*-100-100-100-*-*-*-* Emacs*menubar*Font: -*-bitstream vera sans-medium-r-*-*-*-100-100-100-*-*-*-* Emacs*popup*Font: -*-bitstream vera sans-medium-r-*-*-*-100-100-100-*-*-*-* !Emacs*Background: MidnightBlue !Emacs*Foreground: LightSalmon Emacs*popup*background: gray60 Emacs*popup*foreground: black emacs*bitmapIcon: on Emacs*toolBar: 0 !emacs.geometry: 80x25 !Emacs.geometry: 110x55 !Emacs.geometry: 110x55+0+0 Emacs.geometry: 143x53+0+0 ! GNU Emacs 21 (these font-settings don't work) Emacs.Paned.XlwMenu.font: -*-bitstream vera sans-medium-r-normal-*-*-100-100-100-*-*-*-* Emacs.Paned.EmacsFrame.font: -*-bitstream vera sans mono-medium-r-normal-*-*-100-100-100-m-*-*-* Emacs.Paned.XlwMenu.background: gray60 Emacs.Paned.XlwMenu.foreground: black Emacs.Paned.EmacsFrame.background: MidnightBlue Emacs.Paned.EmacsFrame.foreground: LightSalmon Emacs.pane.menubar.horizontalSpacing: 4 Emacs.pane.menubar.verticalSpacing: 2 Emacs.pane.menubar.Margin: 0 ! XEmacs Emacs.TopLevelEmacsShell.EmacsManager.XlwMenu.font: -*-bitstream vera sans-medium-r-normal-*-*-100-100-100-*-*-*-* Emacs.TopLevelEmacsShell.EmacsManager.EmacsFrame.font: -*-bitstream vera sans mono-medium-r-normal-*-*-100-100-100-m-*-*-* Emacs.TopLevelEmacsShell.EmacsManager.XlwMenu.foreground: black Emacs.TopLevelEmacsShell.EmacsManager.XlwMenu.background: gray60 Emacs*Xlw''''''Menu*fontSet: -*-bitstream vera sans-medium-r-normal-*-*-100-100-100-*-*-*-* Emacs*Xlw''''''Menu*background: gray60 Emacs*Xlw''''''Menu*foreground: black Emacs*Xlw''''''Menu*shadowThickness: 1 Emacs.TopLevelEmacsShell.EmacsManager.XlwScrollBar.background: gray60 ! }}} ----- Clip here ----- Lines that start with "!" are comments, of course. If setting X-resources don't work, edit your ~/.emacs and then restart your emacs. Here are my font-related settings from my ~/.emacs: ----- Clip here ----- ;;{{{ Fix for handling of X-resources ;; http://www.emacswiki.org/cgi-bin/wiki/ProblemSettingCertainFaceAttributesFromXResources ;; ;; Loading this patch will make face-attributes inherit, underline, ;; overline and strike-through properly be set up from X11 resources. ;; Values `t', `nil' and facenames must be quoted. ;; ;; code by fledermaus (defun set-face-attribute-from-resource (face attribute resource class frame) "Set FACE's ATTRIBUTE from X resource RESOURCE, class CLASS on FRAME. Value is the attribute value specified by the resource, or nil if not present. This function displays a message if the resource specifies an invalid attribute." (let* ((face-name (face-name face)) (value (internal-face-x-get-resource (concat face-name resource) class frame))) (when value (if (and (string-match "^'" value) (or (eq attribute :inherit ) (eq attribute :underline ) (eq attribute :overline ) (eq attribute :strike-through))) (progn (setq value (intern (substring value 1))) (condition-case () (internal-set-lisp-face-attribute face attribute value frame) (error (message "Face %s, frame %s: attribute %s %S from XRDB" face-name frame attribute value)))) (setq value (downcase value)) (condition-case () (internal-set-lisp-face-attribute-from-resource face attribute value frame) (error (message "Face %s, frame %s: bad attribute %s %s from X resource" face-name frame attribute value))))) value)) ;;}}} ;;{{{ Fonts and colors (global-font-lock-mode t) (show-paren-mode t) ;;(setq font-lock-maximum-decoration t ;; font-lock-maximum-size nil) ;;(setq font-lock-support-mode 'fast-lock-mode ; lazy-lock-mode ;; fast-lock-cache-directories '("~/.emacs-flc")) (setq fast-lock-cache-directories '("~/.emacs-flc")) ;; do lazy locking, it's quicker ;;(setq font-lock-support-mode 'lazy-lock-mode) ;; more font-locking, variables for `lazy-lock-mode' ;; wait 10 secs before font-locking stuff ;;(setq lazy-lock-defer-time 10 ;; don't font lock as I type ;;lazy-lock-defer-on-the-fly t ;; If I'm not doing stuff, start fontifying ;; the rest of the buffer ;;lazy-lock-stealth-time 30) ;; emacs 21 has jit-lock which is better (setq font-lock-support-mode 'jit-lock-mode) (setq jit-lock-stealth-time 16 jit-lock-defer-contextually t jit-lock-stealth-nice 0.5) (setq-default font-lock-multiline t) ;;}}} ----- Clip here ----- Lines that start with ";" are comments, of course. Before those setting my ~/.emacs reads file ~/.emacsen-elisp/common.el . It is for those settings that work under both emacsen, both GNU emacs and XEmacs. Here are its font-related settings: ----- Clip here ----- ;;{{{ Fonts and colors ;; Somehow X-resources do not have effect for first window in my GNU Emacs. (setq initial-frame-alist '( (top . 0) (left . 0) ;; (width . 80) (height . 72) ;; (width . 110) (height . 55 (width . 143) (height . 53) ;; (font . "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*") (font . "-*-bitstream vera sans mono-medium-r-normal-*-*-100-100-100-m-*-*-*") (set-face-font 'default "-*-bitstream vera sans mono-medium-r-normal-*-*-100-100-100-m-*-*-*") (set-face-font 'menu "-*-bitstream vera sans-medium-r-normal-*-*-100-100-100-*-*-*-*") ) ) (setq default-frame-alist '( (top . 0) (left . 0) ;;(width . 80) (height . 62) ;;(width . 110) (height . 55) (width . 143) (height . 53) ;; (cursor-color . "white") (cursor-type . box) ;; (foreground-color . "green") ;; (background-color . "black") ;;(font . "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*") ;;(font . "-*-bitstream vera sans mono-medium-r-normal-*-*-100-100-100-m-*-*-*") (font . "-*-bitstream vera sans mono-medium-r-normal-*-*-100-100-100-m-*-*-*") (set-face-font 'default "-*-bitstream vera sans mono-medium-r-normal-*-*-100-100-100-m-*-*-*") (set-face-font 'menu "-*-bitstream vera sans-medium-r-normal-*-*-100-100-100-*-*-*-*") ) ) ;;; Syntax highlight for everywhere (require 'font-lock) (turn-on-font-lock) (setq font-lock-maximum-decoration t) (require 'ctypes) (ctypes-auto-parse-mode 1) (require 'gnus-cite) (add-to-list 'default-frame-alist '(foreground-color . "LightSalmon")) (add-to-list 'default-frame-alist '(background-color . "MidnightBlue")) (add-to-list 'default-frame-alist '(cursor-color . "Gold")) (add-to-list 'initial-frame-alist '(foreground-color . "LightSalmon")) (add-to-list 'initial-frame-alist '(background-color . "MidnightBlue")) (add-to-list 'initial-frame-alist '(cursor-color . "Gold")) ;;}}} ----- Clip here ----- -- Juhapekka "naula" Tolvanen * * http colon slash slash iki dot fi slash juhtolv "kummaan paikkaan itsesi karkotit, syyttä syyllisten seuduille. raskaisiin taloihin pesit, kirkuviin huoneisiin. mitä ne sinulle tekevät siellä? kuka on raapinut nimesi pois, nimesi, kasvosi, mielesi oivat palvelemaan konetta?" CMX