/[emacs]/emacs/lisp/international/fontset.el
ViewVC logotype

Diff of /emacs/lisp/international/fontset.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.53.2.13 by handa, Wed Oct 30 01:20:15 2002 UTC revision 1.53.2.14 by fx, Thu Oct 31 22:01:58 2002 UTC
# Line 4  Line 4 
4  ;; Licensed to the Free Software Foundation.  ;; Licensed to the Free Software Foundation.
5  ;; Copyright (C) 2001 Free Software Foundation, Inc.  ;; Copyright (C) 2001 Free Software Foundation, Inc.
6    
7  ;; Keywords: mule, multilingual, fontset  ;; Keywords: mule, i18n, fontset
8    
9  ;; This file is part of GNU Emacs.  ;; This file is part of GNU Emacs.
10    
# Line 68  Line 68 
68          ("ethiopic-unicode" . ethiopic)          ("ethiopic-unicode" . ethiopic)
69          ("is13194-devanagari" . indian-is13194)          ("is13194-devanagari" . indian-is13194)
70          ("devanagari-cdac" . devanagari-glyph)          ("devanagari-cdac" . devanagari-glyph)
71    ;; These would be necessary for supporting the complete set of Indian
72    ;; scripts.  See also mule-conf.el.
73    ;;      ("sanskrit-cdac" . sanskrit-glyph)
74    ;;      ("bengali-cdac" . bengali-glyph)
75    ;;      ("assamese-cdac" . assamese-glyph)
76    ;;      ("punjabi-cdac" . punjabi-glyph)
77    ;;      ("gujarati-cdac" . gujarati-glyph)
78    ;;      ("oriya-cdac" . oriya-glyph)
79    ;;      ("tamil-cdac" . tamil-glyph)
80    ;;      ("telugu-cdac" . telugu-glyph)
81    ;;      ("kannada-cdac" . kannada-glyph)
82    ;;      ("malayalam-cdac" . malayalam-glyph)
83          ("muleindian-2" . indian-2-column)          ("muleindian-2" . indian-2-column)
84          ("muleindian-1" . indian-1-column)          ("muleindian-1" . indian-1-column)
85          ("mulelao-1" . mule-lao)          ("mulelao-1" . mule-lao)
# Line 111  Line 123 
123            (nil . "ISO8859-10")            (nil . "ISO8859-10")
124            (nil . "ISO8859-13")            (nil . "ISO8859-13")
125            (nil . "ISO8859-14")            (nil . "ISO8859-14")
126              (nil . "ISO8859-15")
127            (nil . "VISCII1.1-1"))            (nil . "VISCII1.1-1"))
128    
129     (thai (nil . "TIS620*")     (thai (nil . "TIS620*")
# Line 186  Line 199 
199     (indian-is13194 (nil . "is13194-devanagari"))     (indian-is13194 (nil . "is13194-devanagari"))
200     (indian-1-column ("*" . "muleindian-2"))     (indian-1-column ("*" . "muleindian-2"))
201     (devanagari-glyph ("altsys-dv_ttsurekh" . "devanagari-cdac"))     (devanagari-glyph ("altsys-dv_ttsurekh" . "devanagari-cdac"))
202    ;; These would be necessary for supporting the complete set of Indian
203    ;; scripts.
204       ;; fixme: family name
205    ;;    (sanskrit-glyph ("*" . "sanskrit-cdac"))
206    ;;    (bengali-glyph ("*" . "bengali-cdac"))
207    ;;    (assamese-glyph ("*" . "assamese-cdac"))
208    ;;    (punjabi-glyph ("*" . "punjabi-cdac"))
209    ;;    (gujarati-glyph ("*" . "gujarati-cdac"))
210    ;;    (oriya-glyph ("*" . "oriya-cdac"))
211    ;;    (tamil-glyph ("*" . "tamil-cdac"))
212    ;;    (telugu-glyph ("*" . "telugu-cdac"))
213    ;;    (kannada-glyph ("*" . "kannada-cdac"))
214     (malayalam-glyph ("altsys-ml_ttkarthika" . "malayalam-cdac"))     (malayalam-glyph ("altsys-ml_ttkarthika" . "malayalam-cdac"))
215     (ipa (nil . "MuleIPA-1"))     (ipa (nil . "MuleIPA-1"))
216     ))     ))
217    
218  ;; Append Unicode fonts.  ;; Append Unicode fonts.
219  ;; This may find fonts of more varients (bold, italic) but don't cover  ;; This may find fonts with more variants (bold, italic) but which don't cover
220  ;; many characters.  ;; many characters.
221  (set-fontset-font "fontset-default" '(#x00A0 . #xFFFF)  (set-fontset-font "fontset-default" '(#x00A0 . #xFFFF)
222                    '(nil . "iso10646-1") nil 'append)                    '(nil . "iso10646-1") nil 'append)
223  ;; These may find fonts that covers many characters but less varients.  ;; These may find fonts that cover many characters but with fewer variants.
224  (set-fontset-font "fontset-default" '(#x00A0 . #xFFFF)  (set-fontset-font "fontset-default" '(#x00A0 . #xFFFF)
225                    '("gnu-unifont" . "iso10646-1") nil 'append)                    '("gnu-unifont" . "iso10646-1") nil 'append)
226  (set-fontset-font "fontset-default" '(#x00A0 . #xFFFF)  (set-fontset-font "fontset-default" '(#x00A0 . #xFFFF)
227                    '("mutt-clearlyu" . "iso10646-1") nil 'append)                    '("mutt-clearlyu" . "iso10646-1") nil 'append)
228    
229    ;; These are the registered registries/encodings from
230    ;; ftp://ftp.x.org/pub/DOCS/registry 2001/06/01
231    
232    ;; Name                                            Reference
233    ;; ----                                            ---------
234    ;; "DEC"                                           [27]
235    ;;         registry prefix
236    ;; "DEC.CNS11643.1986-2"                           [53]
237    ;;         CNS11643 2-plane using the encoding
238    ;;         suggested in that standard
239    ;; "DEC.DTSCS.1990-2"                              [54]
240    ;;         DEC Taiwan Supplemental Character Set
241    ;; "fujitsu.u90x01.1991-0"                         [87]
242    ;; "fujitsu.u90x03.1991-0"                         [87]
243    ;; "GB2312.1980-0"                                 [39],[12]
244    ;;         China (PRC) Hanzi, GL encoding
245    ;; "GB2312.1980-1"                                 [39]
246    ;;         (deprecated)
247    ;;         China (PRC) Hanzi, GR encoding
248    ;; "HP-Arabic8"                                    [36]
249    ;;         HPARABIC8 8-bit character set
250    ;; "HP-East8"                                      [36]
251    ;;         HPEAST8 8-bit character set
252    ;; "HP-Greek8"                                     [36]
253    ;;         HPGREEK8 8-bit character set
254    ;; "HP-Hebrew8"                                    [36]
255    ;;         HPHEBREW8 8-bit character set
256    ;; "HP-Japanese15"                                 [36]
257    ;;         HPJAPAN15 15-bit characer set,
258    ;;         modified from industry defacto
259    ;;         standard Shift-JIS
260    ;; "HP-Kana8"                                      [36]
261    ;;         HPKANA8 8-bit character set
262    ;; "HP-Korean15"                                   [36]
263    ;;         HPKOREAN15 15-bit character set
264    ;; "HP-Roman8"                                     [36]
265    ;;         HPROMAN8 8-bit character set
266    ;; "HP-SChinese15"                                 [36]
267    ;;         HPSCHINA15 15-bit character set for
268    ;;         support of Simplified Chinese
269    ;; "HP-TChinese15"                                 [36]
270    ;;         HPTCHINA15 15-bit character set for
271    ;;         support of Traditional Chinese
272    ;; "HP-Turkish8"                                   [36]
273    ;;         HPTURKISH8 8-bit character set
274    ;; "IPSYS"                                         [59]
275    ;;         registry prefix
276    ;; "IPSYS.IE-1"                                    [59]
277    ;; "ISO2022"<REG>"-"<ENC>                          [44]
278    ;; "ISO646.1991-IRV"                               [107]
279    ;;         ISO 646 International Reference Version
280    ;; "ISO8859-1"                                     [15],[12]
281    ;;         ISO Latin alphabet No. 1
282    ;; "ISO8859-2"                                     [15],[12]
283    ;;         ISO Latin alphabet No. 2
284    ;; "ISO8859-3"                                     [15],[12]
285    ;;         ISO Latin alphabet No. 3
286    ;; "ISO8859-4"                                     [15],[12]
287    ;;         ISO Latin alphabet No. 4
288    ;; "ISO8859-5"                                     [15],[12]
289    ;;         ISO Latin/Cyrillic alphabet
290    ;; "ISO8859-6"                                     [15],[12]
291    ;;         ISO Latin/Arabic alphabet
292    ;; "ISO8859-7"                                     [15],[12]
293    ;;         ISO Latin/Greek alphabet
294    ;; "ISO8859-8"                                     [15],[12]
295    ;;         ISO Latin/Hebrew alphabet
296    ;; "ISO8859-9"                                     [15],[12]
297    ;;         ISO Latin alphabet No. 5
298    ;; "ISO8859-10"                                    [15],[12]
299    ;;         ISO Latin alphabet No. 6
300    ;; "ISO8859-13"                                    [15],[12]
301    ;;         ISO Latin alphabet No. 7
302    ;; "ISO8859-14"                                    [15],[12]
303    ;;         ISO Latin alphabet No. 8
304    ;; "ISO8859-15"                                    [15],[12]
305    ;;         ISO Latin alphabet No. 9
306    ;; "FCD8859-15"                                    [7]
307    ;;         (deprecated)
308    ;;         ISO Latin alphabet No. 9, Final Committee Draft
309    ;; "ISO10646-1"                                    [133]
310    ;;         Unicode Universal Multiple-Octet Coded Character Set
311    ;; "ISO10646-MES"                                  [133]
312    ;;         (deprecated)
313    ;;         Unicode Minimum European Subset
314    ;; "JISX0201.1976-0"                               [38],[12]
315    ;;         8-Bit Alphanumeric-Katakana Code
316    ;; "JISX0208.1983-0"                               [40],[12]
317    ;;         Japanese Graphic Character Set,
318    ;;         GL encoding
319    ;; "JISX0208.1990-0"                               [71]
320    ;;         Japanese Graphic Character Set,
321    ;;         GL encoding
322    ;; "JISX0208.1983-1"                               [40]
323    ;;         (deprecated)
324    ;;         Japanese Graphic Character Set,
325    ;;         GR encoding
326    ;; "JISX0212.1990-0"                               [72]
327    ;;         Supplementary Japanese Graphic Character Set,
328    ;;         GL encoding
329    ;; "KOI8-R"                                        [119]
330    ;;         Cyrillic alphabet
331    ;; "KSC5601.1987-0"                                [41],[12]
332    ;;         Korean Graphic Character Set,
333    ;;         GL encoding
334    ;; "KSC5601.1987-1"                                [41]
335    ;;         (deprecated)
336    ;;         Korean Graphic Character Set,
337    ;;         GR encoding
338    ;; "omron_CNS11643-0"                              [45]
339    ;; "omron_CNS11643-1"                              [45]
340    ;; "omron_BIG5-0"                                  [45]
341    ;; "omron_BIG5-1"                                  [45]
342    ;; "wn.tamil.1993"                                 [103]
343    
 ;; Set arguments in `font-encoding-alist' (which see).  
344  (defun set-font-encoding (pattern charset)  (defun set-font-encoding (pattern charset)
345      "Set arguments in `font-encoding-alist' (which see)."
346    (let ((slot (assoc pattern font-encoding-alist)))    (let ((slot (assoc pattern font-encoding-alist)))
347      (if slot      (if slot
348          (setcdr slot charset)          (setcdr slot charset)
# Line 252  Line 391 
391    
392  ;; Regular expression matching against a fontname which conforms to  ;; Regular expression matching against a fontname which conforms to
393  ;; XLFD (X Logical Font Description).  All fields in XLFD from FOUNDRY  ;; XLFD (X Logical Font Description).  All fields in XLFD from FOUNDRY
394  ;; to ADSTYLE, REGSITRY, and ENCODING should be not be omitted (but  ;; to ADSTYLE, REGISTRY, and ENCODING should be not be omitted (but
395  ;; can be a wild card) to be matched.  ;; can be a wild card) to be matched.
396  (defconst xlfd-style-regexp  (defconst xlfd-style-regexp
397    "^\    "^\
# Line 269  Line 408 
408          ))          ))
409    
410  (defun x-decompose-font-name (pattern)  (defun x-decompose-font-name (pattern)
411    "Decompose PATTERN into XLFD's fields and return vector of the fields.    "Decompose PATTERN into XLFD fields and return vector of the fields.
412  The length of the vector is 12.  The length of the vector is 12.
413    
414  If PATTERN doesn't conform to XLFD, try to get a full XLFD name from  If PATTERN doesn't conform to XLFD, try to get a full XLFD name from
# Line 322  PATTERN.  If no full XLFD name is gotten Line 461  PATTERN.  If no full XLFD name is gotten
461    
462              ;; Set each element of xlfd-fields to proper strings.              ;; Set each element of xlfd-fields to proper strings.
463              (if (string-match pattern fontname)              (if (string-match pattern fontname)
464                  ;; The regular expression PATTERN matchs the full XLFD                  ;; The regular expression PATTERN matches the full XLFD
465                  ;; name.  Set elements that correspond to a wild card                  ;; name.  Set elements that correspond to a wild card
466                  ;; in PATTERN to nil, set the other elements to the                  ;; in PATTERN to nil, set the other elements to the
467                  ;; exact strings in PATTERN.                  ;; exact strings in PATTERN.
# Line 339  PATTERN.  If no full XLFD name is gotten Line 478  PATTERN.  If no full XLFD name is gotten
478                              (setq i (1+ i)))                              (setq i (1+ i)))
479                          (setq l (cdr (cdr l)))))))                          (setq l (cdr (cdr l)))))))
480                ;; Set each element of xlfd-fields to the exact string                ;; Set each element of xlfd-fields to the exact string
481                ;; in the corresonding fields in full XLFD name.                ;; in the corresponding fields in full XLFD name.
482                (dotimes (i 12)                (dotimes (i 12)
483                  (aset xlfd-fields i (cdr (aref xlfd-fields i)))))                  (aset xlfd-fields i (cdr (aref xlfd-fields i)))))
484              xlfd-fields)))))              xlfd-fields)))))
485    
486  (defun x-compose-font-name (fields &optional reduce)  (defun x-compose-font-name (fields &optional reduce)
487    "Compose X's fontname from FIELDS.    "Compose X fontname from FIELDS.
488  FIELDS is a vector of XLFD fields, the length 12.  FIELDS is a vector of XLFD fields, the length 12.
489  If a field is nil, wild-card letter `*' is embedded.  If a field is nil, wild-card letter `*' is embedded.
490  Optional argument REDUCE is always ignored.  It exists just for  Optional argument REDUCE is always ignored.  It exists just for
# Line 432  with \"fontset\" in `<CHARSET_REGISTRY> Line 571  with \"fontset\" in `<CHARSET_REGISTRY>
571         (string= (match-string (1+ xlfd-regexp-registry-subnum) fontset)         (string= (match-string (1+ xlfd-regexp-registry-subnum) fontset)
572                  "fontset")))                  "fontset")))
573    
 ;; Return a list to be appended to `x-fixed-font-alist' when  
 ;; `mouse-set-font' is called.  
574  (defun generate-fontset-menu ()  (defun generate-fontset-menu ()
575      "Return list to be appended to `x-fixed-font-alist'.
576    Done when `mouse-set-font' is called."
577    (let (l)    (let (l)
578      (dolist (fontset (fontset-list))      (dolist (fontset (fontset-list))
579        (or (string-match "fontset-default$" fontset)        (or (string-match "fontset-default$" fontset)
# Line 554  which case, the corresponding script is Line 693  which case, the corresponding script is
693          (name (match-string 0 fontset-spec))          (name (match-string 0 fontset-spec))
694          xlfd-fields script fontlist ascii-font)          xlfd-fields script fontlist ascii-font)
695      (if (query-fontset name)      (if (query-fontset name)
696          (or noerror          (or noerror
697              (error "Fontset \"%s\" already exists" name))              (error "Fontset \"%s\" already exists" name))
698        (setq xlfd-fields (x-decompose-font-name name))        (setq xlfd-fields (x-decompose-font-name name))
699        (or xlfd-fields        (or xlfd-fields
# Line 598  which case, the corresponding script is Line 737  which case, the corresponding script is
737    "Create a fontset from an ASCII font FONT.    "Create a fontset from an ASCII font FONT.
738    
739  Optional 1st arg RESOLVED-FONT is a resolved name of FONT.  If  Optional 1st arg RESOLVED-FONT is a resolved name of FONT.  If
740  omitted, x-resolve-font-name is called to get the resolved name.  At  omitted, `x-resolve-font-name' is called to get the resolved name.  At
741  this time, if FONT is not available, error is signaled.  this time, if FONT is not available, an error is signaled.
742    
743  Optional 2nd arg FONTSET-NAME is a string to be used in  Optional 2nd arg FONTSET-NAME is a string to be used in
744  `<CHARSET_ENCODING>' fields of a new fontset name.  If it is omitted,  `<CHARSET_ENCODING>' fields of a new fontset name.  If it is omitted,

Legend:
Removed from v.1.53.2.13  
changed lines
  Added in v.1.53.2.14

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26