Changeset 3052

Show
Ignore:
Timestamp:
03/09/03 07:31:18 (6 years ago)
Author:
himi
Message:

(mw32-windows-font-charset-database):
Don't init. it here. It was removed.
(w32-default-logfont): Removed. It is obsolete.
(w32-automatic-font-regist, w32-generate-tribial-logfont-list): Ditto.
(w32-regist-initial-font, w32-automatic-fontset-regist
(w32-auto-regist-bdf-font): Now it takes <encoding> not <encoding-type> nor
<encoder> as the third argument.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • work/cvs2svn/lisp/international/mw32misc.el

    r3049 r3052  
    277277 
    278278; JOHAB_CHARSET 
    279  
    280 (let ((slot mw32-charset-windows-font-info-alist) 
    281       elem cnum enc) 
    282   (while (setq elem (car slot)) 
    283     (setq cnum (nth 1 elem) 
    284           enc (nth 2 elem) 
    285           slot (cdr slot)) 
    286     (aset mw32-windows-font-charset-database cnum enc))) 
    287  
    288279 
    289280;;; 
     
    417408;;; 
    418409 
    419 ;;; 
    420 ;;; Obsolete codes. 
    421 ;;; 
    422  
    423 (defvar w32-default-logfont '(w32-logfont "FixedSys" 0 0 400 0 nil nil nil 0 1 1 1) 
    424   "Default font is generated from this.") 
    425  
    426 (defun w32-automatic-font-regist (name lflist &optional encoding-type) 
    427   (w32-add-font name '((width . 0) 
    428                        (height . 0) 
    429                        (base . 0) 
    430                        (overhang . 0) 
    431                        (encoding-type . 0))) 
    432   (let (lf metric num encoder 
    433            (i  0) 
    434            (width 0)  
    435            (height 0) 
    436            (base 0)  
    437            (overhang 0)) 
    438     (if (not (numberp encoding-type)) 
    439         (progn 
    440           (setq encoder encoding-type) 
    441           (setq encoding-type 0))) 
    442     (while (setq lf (car lflist)) 
    443       (setq metric (w32-get-logfont-info lf) 
    444             num (cdr (assq 'width metric))) 
    445       (if (> num width) (setq width num)) 
    446       (setq num (cdr (assq 'height metric))) 
    447       (if (> num height) (setq height num)) 
    448       (setq num (cdr (assq 'base metric))) 
    449       (if (> num base) (setq base num)) 
    450       (setq num (cdr (assq 'overhang metric))) 
    451       (if (> num overhang) (setq overhang num)) 
    452       (w32-change-font-logfont name i lf) 
    453       (setq lflist (cdr lflist)) 
    454       (setq i (1+ i))) 
    455     (w32-change-font-attribute 
    456      name 
    457      (list (cons 'width width) 
    458            (cons 'height height) 
    459            (cons 'base base) 
    460            (cons 'overhang overhang) 
    461            (cons 'encoding-type encoding-type) 
    462            (cons 'encoder encoder))))) 
    463  
    464 (defun w32-generate-tribial-logfont-list (logfont) 
    465   (let* ((bold-font (w32-change-logfont-weight logfont 300)) 
    466          (italic-font (w32-change-logfont-italic-p logfont t)) 
    467          (italic-bold-font (w32-change-logfont-italic-p bold-font t))) 
    468     (list logfont bold-font italic-font italic-bold-font))) 
    469  
    470 (defun w32-regist-initial-font () 
    471   (w32-automatic-font-regist 
    472    "initial"  
    473    (w32-generate-tribial-logfont-list w32-default-logfont) 0)) 
    474  
    475 (defun w32-automatic-fontset-regist (name orgfont) 
    476   (let ((encoding-alist mw32-charset-windows-font-info-alist) 
    477         x ret) 
    478     (while encoding-alist 
    479       (setq x (car encoding-alist)) 
    480       (setq encoding-alist (cdr encoding-alist)) 
    481       (let* ((charset (car x)) 
    482              (ms-charset (car (cdr x))) 
    483              (encoding-type (car (cdr (cdr x)))) 
    484              (font-name (format "%s-%s" orgfont (symbol-name charset))) 
    485              orglf newlf metric) 
    486         (setq orglf 
    487               (w32-change-logfont-charset 
    488                (cond 
    489                 ((w32-get-font-logfont orgfont 0)) 
    490                 (t 
    491                  w32-default-logfont)) ms-charset)) 
    492         (setq metric (w32-get-logfont-info orglf)) 
    493         (if (or (= ms-charset (cdr (assq 'charset-num metric))) 
    494                 ;;; This is very dirty hack. 
    495                 ;;  Some Windows(TM) localized editions 
    496                 ;; (at least Windows98 Thai edition) have 
    497                 ;; a bogus font mapper, which may maps a logfont 
    498                 ;; to a font of wrong charset number 
    499                 ;; if any other keys of the logfont are not match. 
    500                 ;; This must be a bug of Windows.  Nevertheless, 
    501                 ;; we should make ASCII font to display, thus, 
    502                 ;; we force to set the logfont (that is 
    503                 ;; seemed to be to invalid) to ASCII font of 
    504                 ;; the fontset that will be created. 
    505                 (eq charset 'ascii)) 
    506             (progn 
    507               (w32-automatic-font-regist 
    508                font-name 
    509                (mapcar 
    510                 (lambda (x) 
    511                   (setq metric (w32-get-logfont-info orglf) 
    512                         newlf (w32-change-logfont-width 
    513                                orglf 
    514                                (cdr (assq 'width metric))) 
    515                         newlf (w32-change-logfont-height 
    516                                newlf 
    517                                (cdr (assq 'height metric)))) 
    518                   newlf) 
    519                '(0 1 2 3)) 
    520                encoding-type) 
    521               (setq ret (cons (cons charset font-name) ret)))))) 
    522       (new-fontset name ret))) 
    523    
    524 ;(new-fontset "default-fontset" '((ascii . "default") 
    525 ;                                (japanese-jisx0208 . "default") 
    526 ;                                (katakana-jisx0201 . "default"))) 
    527 ; 
    528 ;(set-default-font "default-fontset") 
    529  
    530410;;;;; 
    531411;;;;; 
     
    539419    (if bdfatt 
    540420        (progn 
    541           (cond ((symbolp encoding) 
    542                  (setq bdfatt (append (list 
    543                                        (cons 'encoder encoding) 
    544                                        (cons 'encoding-type 0)) 
    545                                       bdfatt))) 
    546                 ((numberp encoding) 
    547                  (setq bdfatt (cons (cons 'encoding-type encoding) 
    548                                     bdfatt)))) 
     421          (if encoding 
     422              (setq bdfatt (cons (cons 'encoding encoding) 
     423                                 bdfatt))) 
    549424          (w32-add-font fontname bdfatt) 
    550425          (w32-change-font-logfont fontname 0