Takashi Hiromatsu
matsu****@users*****
2005年 11月 15日 (火) 21:56:48 JST
Index: fixed-width-fontset/Changelog diff -u fixed-width-fontset/Changelog:1.4 fixed-width-fontset/Changelog:1.5 --- fixed-width-fontset/Changelog:1.4 Mon Oct 10 11:35:39 2005 +++ fixed-width-fontset/Changelog Tue Nov 15 21:56:48 2005 @@ -1,4 +1,21 @@ -2005-10-10 Takashi HIROMATSU <matsu****@ca2*****> +2005-11-15 Takashi HIROMATSU <matsu****@users*****> + + * ntemacs-font.el: Doc. changed slightly + + * carbon-font.el: Doc. changed slightly + + * fixed-width-fontset.el (fixed-width-append-factor): add font check + routine. + (fixed-width-make-frame-function): check existance initial frame + (fixed-width-initial-frame): change initialize timing to making first + new frame from loading file. + (before-make-frame-hook): ditto + (emacs-startup-hook): add face-font-rescale-alist initialize routine + after making initial frame. + (set-default-font): adviced to add font element to the + `default-frame-alist. + +2005-10-10 Takashi HIROMATSU <matsu****@users*****> * carbon-font.el (fixed-width-get-scale-alist): cyrillic support (carbon-font-encode-family-list-hiraginomaru) @@ -17,7 +34,7 @@ version.tex version.texi -2005-10-04 Takashi HIROMATSU <matsu****@ca2*****> +2005-10-04 Takashi HIROMATSU <matsu****@users*****> * ntemacs-font.el (fixed-width-get-scale-alist): modified by functions minor change. Index: fixed-width-fontset/carbon-font.el diff -u fixed-width-fontset/carbon-font.el:1.5 fixed-width-fontset/carbon-font.el:1.6 --- fixed-width-fontset/carbon-font.el:1.5 Mon Oct 10 11:35:39 2005 +++ fixed-width-fontset/carbon-font.el Tue Nov 15 21:56:48 2005 @@ -1,8 +1,8 @@ ;;; carbon-font.el -- fontsets for Carbon Emacs -*- coding: iso-2022-7bit -*- ;; Copyright (C) 2004-2005 by T. Hiromatsu <matsu****@users*****> -;; Version 1_5_1 -;; 2005-10-04 +;; Version 1_5_2 +;; 2005-11-15 ;;; Commentary: @@ -83,9 +83,11 @@ ;; (set-default-font "fontset-hiraginomaru") ;; font size was set to 12 (default). ;; -;; If you want to use another size, please use full fontset name like as +;; If you want to use another size, please use full fontset name like +;; as shown in below. ;; (set-default-font ;; "-*-*-medium-r-normal--8-*-*-*-*-*-fontset-hiraginomaru") +;; or ;; (add-to-list ;; 'default-frame-alist ;; '(font . "-*-*-medium-r-normal--8-*-*-*-*-*-fontset-hiraginomaru")) @@ -176,8 +178,9 @@ ;; ;; これ以外のサイズを使いたい場合は、 ;; -;; (set-default-font +;; (set-default-font ;; "-*-*-medium-r-normal--8-*-*-*-*-*-fontset-hiraginomaru") +;; 又は ;; (add-to-list ;; 'default-frame-alist ;; '(font . "-*-*-medium-r-normal--8-*-*-*-*-*-fontset-hiraginomaru")) @@ -268,7 +271,7 @@ (defvar carbon-font-defined-sizes '(12 7 8 9 10 14 16 18 20 24)) ;; -;; hiraginomaru** = ヒラギノ丸ゴ + monaco(alternative) +;; hiraginomaru = ヒラギノ丸ゴ + monaco ;; (defvar carbon-font-encode-family-list-hiraginomaru @@ -287,7 +290,7 @@ carbon-font-encode-family-list-hiraginomaru) ;; -;; hiraginokaku** = ヒラギノ角ゴ + monaco(alternative) +;; hiraginokaku = ヒラギノ角ゴ + monaco ;; (defvar carbon-font-encode-family-list-hiraginokaku @@ -305,7 +308,7 @@ carbon-font-encode-family-list-hiraginokaku) ;; -;; hiraginomin** = ヒラギノ明朝 + courier +;; hiraginomin = ヒラギノ明朝 + courier ;; (defvar carbon-font-encode-family-list-hiraginomin @@ -323,7 +326,7 @@ carbon-font-encode-family-list-hiraginomin) ;; -;; osaka** = osaka + monaco(alternative) +;; osaka = osaka + monaco ;; (defvar carbon-font-encode-family-list-osaka Index: fixed-width-fontset/fixed-width-fontset.el diff -u fixed-width-fontset/fixed-width-fontset.el:1.4 fixed-width-fontset/fixed-width-fontset.el:1.5 --- fixed-width-fontset/fixed-width-fontset.el:1.4 Wed Oct 5 00:36:40 2005 +++ fixed-width-fontset/fixed-width-fontset.el Tue Nov 15 21:56:48 2005 @@ -1,8 +1,8 @@ ;;; fixed-width-fontset.el -*- coding: iso-2022-7bit -*- ;; Copyright (C) 2005 by T. Hiromatsu <matsu****@users*****> -;; Version 1_0_1 -;; 2005-10-04 +;; Version 1_0_2 +;; 2005-11-15 ;;; Commentary: @@ -92,11 +92,16 @@ ;; カレントフレームで使われているフォントの、リスケールファクターを、 ;; fixed-width-scale-alist から、取得する。 -(defun fixed-width-append-factor (&optional frame) +(defun fixed-width-append-factor (&optional frame init) "取得した rescale factor で、face-font-rescale-alist を書き換える。" - (let* ((rescale-alist (copy-alist face-font-rescale-alist)) - (xlfd-fields (x-decompose-font-name (frame-parameter frame 'font))) - (size (aref xlfd-fields xlfd-regexp-pixelsize-subnum))) + (let* ((alst (frame-parameter frame 'face-font-rescale-alist)) + (rescale-alist (copy-alist (or alst face-font-rescale-alist))) + (init-font (if init (cdr (assoc 'font initial-frame-alist)))) + (frm-font (frame-parameter frame 'font)) + (def-font (cdr (assoc 'font default-frame-alist))) + (fontset (or init-font frm-font def-font "fontset-default")) + (asc (if (fontset-name-p fontset) (fontset-font fontset ?a) fontset)) + (size (aref (x-decompose-font-name asc) xlfd-regexp-pixelsize-subnum))) (dolist (elt fixed-width-get-scale-alist) (let* ((font (car elt)) (new (or (cdr (assoc size elt)) 1.0)) @@ -108,20 +113,37 @@ "Initialize frame-parameter when creating new frame." (let ((lst `((face-font-rescale-alist . ,(fixed-width-append-factor frame))))) (modify-frame-parameters frame lst) - (fixed-width-append-factor fixed-width-initial-frame))) + (if (frame-live-p fixed-width-initial-frame) + (fixed-width-append-factor fixed-width-initial-frame)))) ;; フォントが変更された場合にフックをかけて、 ;; fixed-width-append-factor を起動する。 -(defvar fixed-width-initial-frame (caar (cdr (current-frame-configuration)))) +(defvar fixed-width-initial-frame nil) (make-variable-frame-local 'face-font-rescale-alist) (add-hook 'after-make-frame-functions '(lambda (frame) (fixed-width-make-frame-function frame))) -(add-hook 'after-setting-font-hook - '(lambda () (fixed-width-append-factor nil))) +(add-hook 'before-make-frame-hook + '(lambda () + (or fixed-width-initial-frame + (setq fixed-width-initial-frame (selected-frame))))) + +(add-hook 'after-setting-font-hook '(lambda () (fixed-width-append-factor nil))) + +(add-hook 'emacs-startup-hook '(lambda () (fixed-width-append-factor nil t))) + +(defadvice set-default-font + (after fixed-width-set-default-font (font-name &optional keep-size) activate) + "adviced by the fixed-width-fontset package to add font element to the +`default-frame-alist according to it's name DEFAULT. If you want to change +fontset only on the selected frame without changing `default-frame-alist, +use `set-frame-font." + (let ((old (assoc 'font default-frame-alist))) + (if old (setcdr old font-name) + (add-to-list 'default-frame-alist (cons 'font font-name))))) (provide 'fixed-width-fontset) Index: fixed-width-fontset/ntemacs-font.el diff -u fixed-width-fontset/ntemacs-font.el:1.3 fixed-width-fontset/ntemacs-font.el:1.4 --- fixed-width-fontset/ntemacs-font.el:1.3 Tue Oct 4 01:04:59 2005 +++ fixed-width-fontset/ntemacs-font.el Tue Nov 15 21:56:48 2005 @@ -1,8 +1,8 @@ ;;; ntemacs-font.el -- fontsets for Emacs on Windows -*- coding: iso-2022-7bit -*- ;; Copyright (C) 2004-2005 by T. Hiromatsu <matsu****@users*****> -;; Version 1_0_1 -;; 2005-10-04 +;; Version 1_0_2 +;; 2005-11-15 ;;; Commentary: @@ -78,6 +78,7 @@ ;; If you want to use another size, please use full fontset name like as ;; (set-default-font ;; "-*-*-medium-r-normal--10-*-*-*-*-*-fontset-msgothic") +;; or ;; (add-to-list ;; 'default-frame-alist ;; '(font . "-*-*-medium-r-normal--10-*-*-*-*-*-fontset-msgothic")) @@ -152,6 +153,7 @@ ;; これ以外のサイズを使いたい場合は、 ;; (set-default-font ;; "-*-*-medium-r-normal--10-*-*-*-*-*-fontset-msgothic") +;; 又は ;; (add-to-list ;; 'default-frame-alist ;; '(font . "-*-*-medium-r-normal--10-*-*-*-*-*-fontset-msgothic")) Index: fixed-width-fontset/readme diff -u fixed-width-fontset/readme:1.2 fixed-width-fontset/readme:1.3 --- fixed-width-fontset/readme:1.2 Wed Oct 5 00:36:40 2005 +++ fixed-width-fontset/readme Tue Nov 15 21:56:48 2005 @@ -24,4 +24,4 @@ readme.ja : readme (ja) 2005-09-13 Takashi Hiromatsu - matsu****@ca2***** \ No newline at end of file + matsu****@users***** \ No newline at end of file Index: fixed-width-fontset/readme.ja diff -u fixed-width-fontset/readme.ja:1.1.1.1 fixed-width-fontset/readme.ja:1.2 --- fixed-width-fontset/readme.ja:1.1.1.1 Wed Sep 14 23:48:53 2005 +++ fixed-width-fontset/readme.ja Tue Nov 15 21:56:48 2005 @@ -24,4 +24,4 @@ readme.ja : This file 2005-09-13 Takashi Hiromatsu - matsu****@ca2***** \ No newline at end of file + matsu****@users***** \ No newline at end of file