fontset.el 49.6 KB
Newer Older
1
;;; fontset.el --- commands for handling fontset
Karl Heuer's avatar
Karl Heuer committed
2

Paul Eggert's avatar
Paul Eggert committed
3
;; Copyright (C) 1997-2019 Free Software Foundation, Inc.
Kenichi Handa's avatar
Kenichi Handa committed
4
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
5
;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
Kenichi Handa's avatar
Kenichi Handa committed
6 7
;;   National Institute of Advanced Industrial Science and Technology (AIST)
;;   Registration Number H14PRO021
8
;; Copyright (C) 2003, 2006
Kenichi Handa's avatar
Kenichi Handa committed
9 10
;;   National Institute of Advanced Industrial Science and Technology (AIST)
;;   Registration Number H13PRO009
Karl Heuer's avatar
Karl Heuer committed
11

Dave Love's avatar
Dave Love committed
12
;; Keywords: mule, i18n, fontset
Karl Heuer's avatar
Karl Heuer committed
13 14 15

;; This file is part of GNU Emacs.

16
;; GNU Emacs is free software: you can redistribute it and/or modify
Karl Heuer's avatar
Karl Heuer committed
17
;; it under the terms of the GNU General Public License as published by
18 19
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
Karl Heuer's avatar
Karl Heuer committed
20 21 22 23 24 25 26

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
27
;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
Karl Heuer's avatar
Karl Heuer committed
28

29 30
;;; Commentary:

Karl Heuer's avatar
Karl Heuer committed
31 32
;;; Code:

33 34 35
;; Setup font-encoding-alist for all known encodings.

(setq font-encoding-alist
36 37
      (mapcar (lambda (arg)
		(cons (purecopy (car arg)) (cdr arg)))
38 39 40 41 42 43 44 45 46 47 48 49 50 51
      '(("iso8859-1$" . iso-8859-1)
	("iso8859-2$" . iso-8859-2)
	("iso8859-3$" . iso-8859-3)
	("iso8859-4$" . iso-8859-4)
	("iso8859-5$" . iso-8859-5)
	("iso8859-6$" . iso-8859-6)
	("iso8859-7$" . iso-8859-7)
	("iso8859-8$" . iso-8859-8)
	("iso8859-9$" . iso-8859-9)
	("iso8859-10$" . iso-8859-10)
	("iso8859-11$" . iso-8859-11)
	("iso8859-13$" . iso-8859-13)
	("iso8859-14$" . iso-8859-14)
	("iso8859-15$" . iso-8859-15)
52
	("iso8859-16$" . iso-8859-16)
53
	("ascii-0$" . ascii)
54
	("gb2312.1980" . chinese-gb2312)
55
	("gbk" . chinese-gbk)
56 57 58 59
        ;; GB18030 needs the characters encoded by gb18030, but a
        ;; gb18030 font doesn't necessarily support all of the GB18030
        ;; characters.
	("gb18030" . (gb18030 . unicode))
60 61 62 63
	("jisx0208.1978" . japanese-jisx0208-1978)
	("jisx0208" . japanese-jisx0208)
	("jisx0201" . jisx0201)
	("jisx0212" . japanese-jisx0212)
64
	("ksx1001" . korean-ksc5601)
65 66 67 68 69 70 71 72
	("ksc5601.1987" . korean-ksc5601)
	("cns11643.1992.*1" . chinese-cns11643-1)
	("cns11643.1992.*2" . chinese-cns11643-2)
	("cns11643.1992.*3" . chinese-cns11643-3)
	("cns11643.1992.*4" . chinese-cns11643-4)
	("cns11643.1992.*5" . chinese-cns11643-5)
	("cns11643.1992.*6" . chinese-cns11643-6)
	("cns11643.1992.*7" . chinese-cns11643-7)
73 74 75 76 77 78 79
	("cns11643.92p1-0" . chinese-cns11643-1)
	("cns11643.92p2-0" . chinese-cns11643-2)
	("cns11643.92p3-0" . chinese-cns11643-3)
	("cns11643.92p4-0" . chinese-cns11643-4)
	("cns11643.92p5-0" . chinese-cns11643-5)
	("cns11643.92p6-0" . chinese-cns11643-6)
	("cns11643.92p7-0" . chinese-cns11643-7)
80 81
	("big5" . big5)
	("viscii" . viscii)
82
	("tis620" . tis620-2533)
83
	("microsoft-cp1251" . windows-1251)
84
	("koi8-r" . koi8-r)
85 86 87 88 89 90 91 92
	("jisx0213.2000-1" . japanese-jisx0213-1)
	("jisx0213.2000-2" . japanese-jisx0213-2)
	("jisx0213.2004-1" . japanese-jisx0213.2004-1)
	("iso10646-1$" . (unicode-bmp . nil))
	("iso10646.indian-1" . (unicode-bmp . nil))
	("unicode-bmp" . (unicode-bmp . nil))
	("abobe-symbol" . symbol)
	("sisheng_cwnn" . chinese-sisheng)
93 94 95 96
	("mulearabic-0" . arabic-digit)
	("mulearabic-1" . arabic-1-column)
	("mulearabic-2" . arabic-2-column)
	("muleipa" . ipa)
Kenichi Handa's avatar
Kenichi Handa committed
97
	("ethiopic-unicode" . (unicode-bmp . ethiopic))
98
	("is13194-devanagari" . indian-is13194)
Kenichi Handa's avatar
Kenichi Handa committed
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
	("Devanagari-CDAC" . devanagari-cdac)
 	("Sanskrit-CDAC" . sanskrit-cdac)
 	("Bengali-CDAC" . bengali-cdac)
 	("Assamese-CDAC" . assamese-cdac)
 	("Punjabi-CDAC" . punjabi-cdac)
 	("Gujarati-CDAC" . gujarati-cdac)
 	("Oriya-CDAC" . oriya-cdac)
 	("Tamil-CDAC" . tamil-cdac)
 	("Telugu-CDAC" . telugu-cdac)
 	("Kannada-CDAC" . kannada-cdac)
 	("Malayalam-CDAC" . malayalam-cdac)
	("Devanagari-Akruti" . devanagari-akruti)
	("Bengali-Akruti" . bengali-akruti)
	("Punjabi-Akruti" . punjabi-akruti)
	("Gujarati-Akruti" . gujarati-akruti)
	("Oriya-Akruti" . oriya-akruti)
	("Tamil-Akruti" . tamil-akruti)
	("Telugu-Akruti" . telugu-akruti)
	("Kannada-Akruti" . kannada-akruti)
	("Malayalam-Akruti" . malayalam-akruti)
119 120 121 122
	("muleindian-2" . indian-2-column)
	("muleindian-1" . indian-1-column)
	("mulelao-1" . mule-lao)
	("muletibetan-2" . tibetan)
123
	("muletibetan-0" . tibetan)
124
	("muletibetan-1" . tibetan-1-column))))
125

126 127
(defvar font-encoding-charset-alist)

Kenichi Handa's avatar
Kenichi Handa committed
128 129 130 131 132 133 134 135 136 137 138 139 140 141
(setq font-encoding-charset-alist
      '((latin-iso8859-1 . iso-8859-1)
	(latin-iso8859-2 . iso-8859-2)
	(latin-iso8859-3 . iso-8859-3)
	(latin-iso8859-4 . iso-8859-4)
	(latin-iso8859-9 . iso-8859-9)
	(latin-iso8859-10 . iso-8859-10)
	(latin-iso8859-13 . iso-8859-13)
	(latin-iso8859-14 . iso-8859-14)
	(latin-iso8859-15 . iso-8859-15)
	(latin-iso8859-16 . iso-8859-16)
	(cyrillic-iso8859-5 . iso-8859-5)
	(greek-iso8859-7 . iso-8859-7)
	(arabic-iso8859-6 . iso-8859-6)
142
	(thai-tis620 . tis620-2533)
Kenichi Handa's avatar
Kenichi Handa committed
143 144 145 146 147 148 149 150
	(latin-jisx0201 . jisx0201)
	(katakana-jisx0201 . jisx0201)
	(chinese-big5-1 . big5)
	(chinese-big5-2 . big5)
	(vietnamese-viscii-lower . viscii)
	(vietnamese-viscii-upper . viscii)
	(tibetan . unicode-bmp)))

151
(setq script-representative-chars
152 153
      '((latin ?A ?Z ?a ?z #x00C0 #x0100 #x0180 #x1e00)
	(phonetic #x250 #x283)
154
	(greek #x3A9)
155 156 157 158
	(coptic #x3E2)
	(cyrillic #x42F)
	(armenian #x531)
	(hebrew #x5D0)
159
	(vai #xA500)
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
	(arabic #x628)
	(syriac #x710)
	(thaana #x78C)
	(devanagari #x915)
	(bengali #x995)
	(gurmukhi #xA15)
	(gujarati #xA95)
	(oriya #xB15)
	(tamil #xB95)
	(telugu #xC15)
	(kannada #xC95)
	(malayalam #xD15)
	(sinhala #xD95)
	(thai #xE17)
	(lao #xEA5)
	(tibetan #xF40)
Kenichi Handa's avatar
Kenichi Handa committed
176
	(burmese #x1000)
177 178 179 180 181 182 183 184
	(georgian #x10D3)
	(ethiopic #x1208)
	(cherokee #x13B6)
	(canadian-aboriginal #x14C0)
	(ogham #x168F)
	(runic #x16A0)
	(khmer #x1780)
	(mongolian #x1826)
185
	(symbol . [#x201C #x2200 #x2500])
186 187 188 189 190 191 192 193
	(braille #x2800)
	(ideographic-description #x2FF0)
	(cjk-misc #x300E)
	(kana #x304B)
	(bopomofo #x3105)
	(kanbun #x319D)
	(han #x5B57)
	(yi #xA288)
194 195
	(cham #xAA00)
	(tai-viet #xAA80)
196 197 198 199 200 201 202 203
	(hangul #xAC00)
	(linear-b #x10000)
	(aegean-number #x10100)
	(ancient-greek-number #x10140)
	(ancient-symbol #x10190)
	(phaistos-disc #x101D0)
	(lycian #x10280)
	(carian #x102A0)
204
	(old-italic #x10300)
205
	(ugaritic #x10380)
206
	(old-permic #x10350)
207 208 209 210
	(old-persian #x103A0)
	(deseret #x10400)
	(shavian #x10450)
	(osmanya #x10480)
211
        (osage #x104B0)
212 213 214
	(elbasan #x10500)
	(caucasian-albanian #x10530)
	(linear-a #x10600)
215
	(cypriot-syllabary #x10800)
216 217
	(palmyrene #x10860)
	(nabataean #x10880)
218 219 220
	(phoenician #x10900)
	(lydian #x10920)
	(kharoshthi #x10A00)
221
	(manichaean #x10AC0)
222 223 224
        (hanifi-rohingya #x10D00)
        (old-sogdian #x10F00)
        (sogdian #x10F30)
Eli Zaretskii's avatar
Eli Zaretskii committed
225
        (elymaic #x10fe0)
226 227 228 229 230
	(mahajani #x11150)
	(sinhala-archaic-number #x111E1)
	(khojki #x11200)
	(khudawadi #x112B0)
	(grantha #x11305)
231
        (newa #x11400)
232 233 234 235
	(tirhuta #x11481)
	(siddham #x11580)
	(modi #x11600)
	(takri #x11680)
236
        (dogra #x11800)
237
	(warang-citi #x118A1)
Eli Zaretskii's avatar
Eli Zaretskii committed
238
        (nandinagari #x119a0)
239 240
        (zanabazar-square #x11A00)
        (soyombo #x11A50)
241
	(pau-cin-hau #x11AC0)
242 243
        (bhaiksuki #x11C00)
        (marchen #x11C72)
244
        (masaram-gondi #x11D00)
245 246
        (gunjala-gondi #x11D60)
        (makasar #x11EE0)
247 248
	(cuneiform #x12000)
	(cuneiform-numbers-and-punctuation #x12400)
249
	(egyptian #x13000)
250 251 252
	(mro #x16A40)
	(bassa-vah #x16AD0)
	(pahawh-hmong #x16B11)
253
        (medefaidrin #x16E40)
254 255
        (tangut #x17000)
        (tangut-components #x18800)
256
        (nushu #x1B170)
257
	(duployan-shorthand #x1BC20)
258 259 260 261 262
	(byzantine-musical-symbol #x1D000)
	(musical-symbol #x1D100)
	(ancient-greek-musical-notation #x1D200)
	(tai-xuan-jing-symbol #x1D300)
	(counting-rod-numeral #x1D360)
Eli Zaretskii's avatar
Eli Zaretskii committed
263 264
        (nyiakeng-puachue-hmong #x1e100)
        (wancho #x1e2c0)
265
	(mende-kikakui #x1E810)
266
        (adlam #x1E900)
Eli Zaretskii's avatar
Eli Zaretskii committed
267 268
        (indic-siyaq-number #x1ec71)
        (ottoman-siyaq-number #x1ed01)
269 270
	(mahjong-tile #x1F000)
	(domino-tile #x1F030)))
271

272 273
(defvar otf-script-alist)

Eli Zaretskii's avatar
Eli Zaretskii committed
274 275
;; The below was synchronized with the latest Aug 16, 2018 version of
;; https://docs.microsoft.com/en-us/typography/opentype/spec/scripttags
Kenichi Handa's avatar
Kenichi Handa committed
276
(setq otf-script-alist
277 278 279 280
      '((adlm . adlam)
        (ahom . ahom)
        (hluw . anatolian)
        (arab . arabic)
281
	(armi . aramaic)
Kenichi Handa's avatar
Kenichi Handa committed
282
	(armn . armenian)
283
	(avst . avestan)
Kenichi Handa's avatar
Kenichi Handa committed
284
	(bali . balinese)
285
	(bamu . bamum)
286
        (bass . bassa-vah)
287 288
	(batk . batak)
	(bng2 . bengali)
Kenichi Handa's avatar
Kenichi Handa committed
289
	(beng . bengali)
290
        (bhks . bhaiksuki)
Kenichi Handa's avatar
Kenichi Handa committed
291
	(bopo . bopomofo)
292
	(brah . brahmi)
293
	(brai . braille)
Kenichi Handa's avatar
Kenichi Handa committed
294 295
	(bugi . buginese)
	(buhd . buhid)
296
	(byzm . byzantine-musical-symbol)
Kenichi Handa's avatar
Kenichi Handa committed
297
	(cans . canadian-aboriginal)
298
	(cari . carian)
299
        (aghb . caucasian-albanian)
300 301
	(cakm . chakma)
	(cham . cham)
Kenichi Handa's avatar
Kenichi Handa committed
302 303 304 305
	(cher . cherokee)
	(copt . coptic)
	(xsux . cuneiform)
	(cprt . cypriot)
306
	(cyrl . cyrillic)
Kenichi Handa's avatar
Kenichi Handa committed
307 308
	(dsrt . deseret)
	(deva . devanagari)
309
	(dev2 . devanagari)
Eli Zaretskii's avatar
Eli Zaretskii committed
310
        (dogr . dogra)
311
        (dupl . duployan-shorthand)
312
	(egyp . egyptian)
313
        (elba . elbasan)
Kenichi Handa's avatar
Kenichi Handa committed
314 315 316 317
	(ethi . ethiopic)
	(geor . georgian)
	(glag . glagolitic)
	(goth . gothic)
318
        (gran . grantha)
Kenichi Handa's avatar
Kenichi Handa committed
319 320
	(grek . greek)
	(gujr . gujarati)
321
	(gjr2 . gujarati)
Eli Zaretskii's avatar
Eli Zaretskii committed
322
        (gong . gunjala-gondi)
Kenichi Handa's avatar
Kenichi Handa committed
323
	(guru . gurmukhi)
324
	(gur2 . gurmukhi)
Kenichi Handa's avatar
Kenichi Handa committed
325 326
	(hani . han)
	(hang . hangul)
327
	(jamo . hangul)
Eli Zaretskii's avatar
Eli Zaretskii committed
328
        (rohg . hanifi-rohingya)
Kenichi Handa's avatar
Kenichi Handa committed
329
	(hano . hanunoo)
330
        (hatr . hatran)
Kenichi Handa's avatar
Kenichi Handa committed
331
	(hebr . hebrew)
332
        (hung . old-hungarian)
333 334 335 336
	(phli . inscriptional-pahlavi)
	(prti . inscriptional-parthian)
	(java . javanese)
	(kthi . kaithi)
Kenichi Handa's avatar
Kenichi Handa committed
337
	(knda . kannada)
338
	(knd2 . kannada)
Eli Zaretskii's avatar
Eli Zaretskii committed
339
	(kana . kana)	; Hiragana
340
	(kali . kayah-li)
Kenichi Handa's avatar
Kenichi Handa committed
341 342
	(khar . kharoshthi)
	(khmr . khmer)
343 344
        (khoj . khojki)
        (sind . khudawadi)
345
	(lao\  . lao)
Kenichi Handa's avatar
Kenichi Handa committed
346
	(latn . latin)
347
	(lepc . lepcha)
Kenichi Handa's avatar
Kenichi Handa committed
348
	(limb . limbu)
349
	(lina . linear_a)
Kenichi Handa's avatar
Kenichi Handa committed
350
	(linb . linear_b)
351 352 353
        (lisu . lisu)
        (lyci . lycian)
        (lydi . lydian)
354
        (mahj . mahajani)
Eli Zaretskii's avatar
Eli Zaretskii committed
355
        (maka . makasar)
356
        (marc . marchen)
Kenichi Handa's avatar
Kenichi Handa committed
357
	(mlym . malayalam)
358 359
	(mlm2 . malayalam)
	(mand . mandaic)
360
        (mani . manichaean)
Eli Zaretskii's avatar
Eli Zaretskii committed
361
        (gonm . masaram-gondi)
362
	(math . mathematical)
Eli Zaretskii's avatar
Eli Zaretskii committed
363
        (medf . medefaidrin)
364
	(mtei . meetei-mayek)
365
        (mend . mende-kikakui)
366 367
	(merc . meroitic)
	(mero . meroitic)
368 369
        (plrd . miao)
        (modi . modi)
Kenichi Handa's avatar
Kenichi Handa committed
370
	(mong . mongolian)
371 372
        (mroo . mro)
        (mult . multani)
373
	(musc . musical-symbol)
374
	(mym2 . burmese)
Kenichi Handa's avatar
Kenichi Handa committed
375
	(mymr . burmese)
376 377
        (nbat . nabataean)
        (newa . newa)
378
	(nko\  . nko)
Eli Zaretskii's avatar
Eli Zaretskii committed
379
        (nshu . nushu)
Kenichi Handa's avatar
Kenichi Handa committed
380
	(ogam . ogham)
381
	(olck . ol-chiki)
Kenichi Handa's avatar
Kenichi Handa committed
382 383
	(ital . old_italic)
	(xpeo . old_persian)
384 385
        (narb . old-north-arabian)
        (perm . old-permic)
Eli Zaretskii's avatar
Eli Zaretskii committed
386
        (sogo . old-sogdian)
387 388
	(sarb . old-south-arabian)
	(orkh . old-turkic)
Kenichi Handa's avatar
Kenichi Handa committed
389
	(orya . oriya)
390
	(ory2 . oriya)
391
        (osge . osage)
Kenichi Handa's avatar
Kenichi Handa committed
392
	(osma . osmanya)
393 394 395
        (hmng . pahawh-hmong)
        (palm . palmyrene)
        (pauc . pau-cin-hau)
Kenichi Handa's avatar
Kenichi Handa committed
396
	(phag . phags-pa)
397
        (phli . inscriptional-pahlavi)
Kenichi Handa's avatar
Kenichi Handa committed
398
	(phnx . phoenician)
399 400
        (phlp . psalter-pahlavi)
        (prti . inscriptional-parthian)
401
	(rjng . rejang)
Kenichi Handa's avatar
Kenichi Handa committed
402
	(runr . runic)
403 404 405
	(samr . samaritan)
	(saur . saurashtra)
	(shrd . sharada)
Kenichi Handa's avatar
Kenichi Handa committed
406
	(shaw . shavian)
407 408
        (sidd . siddham)
        (sgnw . sutton-sign-writing)
Kenichi Handa's avatar
Kenichi Handa committed
409
	(sinh . sinhala)
Eli Zaretskii's avatar
Eli Zaretskii committed
410
        (sogd . sogdian)
411
	(sora . sora-sompeng)
Eli Zaretskii's avatar
Eli Zaretskii committed
412
        (soyo . soyombo)
413
	(sund . sundanese)
Kenichi Handa's avatar
Kenichi Handa committed
414 415 416 417 418
	(sylo . syloti_nagri)
	(syrc . syriac)
	(tglg . tagalog)
	(tagb . tagbanwa)
	(tale . tai_le)
419 420 421 422 423 424
	(talu . tai-lue)
	(lana . tai-tham)
	(tavt . tai-viet)
	(takr . takri)
	(taml . tamil)
	(tml2 . tamil)
425
        (tang . tangut)
Kenichi Handa's avatar
Kenichi Handa committed
426
	(telu . telugu)
427
	(tel2 . telugu)
Kenichi Handa's avatar
Kenichi Handa committed
428 429 430 431
	(thaa . thaana)
	(thai . thai)
	(tibt . tibetan)
	(tfng . tifinagh)
432
        (tirh . tirhuta)
Kenichi Handa's avatar
Kenichi Handa committed
433
	(ugar . ugaritic)
434
	(vai\  . vai)
435
        (wara . warang-citi)
Eli Zaretskii's avatar
Eli Zaretskii committed
436 437
	(yi\ \   . yi)
        (zanb . zanabazar-square)))
Kenichi Handa's avatar
Kenichi Handa committed
438

439
;; Set standard fontname specification of characters in the default
440 441 442
;; fontset to find an appropriate font for each script/charset.  The
;; specification has the form ((SCRIPT FONT-SPEC ...) ...), where
;; FONT-SPEC is:
443 444 445
;;	a cons (FAMILY . REGISTRY),
;;	or a string FONT-NAME,
;;	or an object created by `font-spec'.
Kenichi Handa's avatar
Kenichi Handa committed
446
;;
Juanma Barranquero's avatar
Juanma Barranquero committed
447
;; FAMILY may be nil, in which case, the corresponding name of
448 449 450 451 452 453
;; default face is used.  If REGISTRY contains a character `-', the
;; string before that is embedded in `CHARSET_REGISTRY' field, and the
;; string after that is embedded in `CHARSET_ENCODING' field.  If it
;; does not contain `-', the whole string is embedded in
;; `CHARSET_REGISTRY' field, and a wild card character `*' is embedded
;; in `CHARSET_ENCODING' field.
454 455 456 457
;;
;; SCRIPT is a symbol that appears as an element of the char table
;; `char-script-table'.  SCRIPT may be a charset specifying the range
;; of characters.
458

459 460 461 462
(declare-function new-fontset "fontset.c" (name fontlist))
(declare-function set-fontset-font "fontset.c"
		  (name target font-spec &optional frame add))

463 464
(eval-when-compile

465
;; Build data to initialize the default fontset at compile time to
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507
;; avoid loading charsets that won't be necessary at runtime.

;; The value is (CJK-REGISTRY-VECTOR TARGET-SPEC ...), where
;; CJK-REGISTRY-VECTOR is ["JISX0208.1983-0" "GB2312.1980-0" ...],
;; TARGET-SPEC is (TARGET . BITMASK) or (TARGET SPEC ...),
;; TARGET is CHAR or (FROM-CHAR . TO-CHAR),
;; BITMASK is a bitmask of indices to CJK-REGISTRY-VECTOR,
;; SPEC is a list of arguments to font-spec.

(defmacro build-default-fontset-data ()
  (let* (;;       CHARSET-REGISTRY  CHARSET            FROM-CODE TO-CODE
	 (cjk '(("JISX0208.1983-0" japanese-jisx0208  #x2121    #x287E)
		("GB2312.1980-0"   chinese-gb2312     #x2121    #x297E)
		("BIG5-0"          big5               #xA140    #xA3FE)
		("CNS11643.1992-1" chinese-cns11643-1 #x2121    #x427E)
		("KSC5601.1987-0"  korean-ksc5601     #x2121    #x2C7E)))
	 (scripts '((tibetan
		     (:registry "iso10646-1" :otf (tibt nil (ccmp blws abvs)))
		     (:family "mtib" :registry "iso10646-1")
		     (:registry "muletibetan-2"))
		    (ethiopic
		     (:registry "iso10646-1" :script ethiopic)
		     (:registry "ethiopic-unicode"))
		    (phonetic
		     (:registry "iso10646-1" :script phonetic)
		     (:registry "MuleIPA-1")
		     (:registry "iso10646-1"))))
	 (cjk-table (make-char-table nil))
	 (script-coverage
	  #'(lambda (script)
	      (let ((coverage))
		(map-char-table
		 #'(lambda (range val)
		     (when (eq val script)
		       (if (consp range)
			   (setq range (cons (car range) (cdr range))))
		       (push range coverage)))
		 char-script-table)
		coverage)))
	 (data (list (vconcat (mapcar 'car cjk))))
	 (i 0))
    (dolist (elt cjk)
508
      (let ((mask (ash 1 i)))
509
	(map-charset-chars
510
	 #'(lambda (range _arg)
511 512 513
	     (let ((from (car range)) (to (cdr range)))
	       (if (< to #x110000)
		   (while (<= from to)
514 515 516 517
		     (or (memq (aref char-script-table from)
			       '(kana hangul han cjk-misc))
			 (aset cjk-table from
			       (logior (or (aref cjk-table from) 0) mask)))
518 519 520 521 522 523 524 525 526 527 528 529 530 531 532
		     (setq from (1+ from))))))
	 (nth 1 elt) nil (nth 2 elt) (nth 3 elt)))
      (setq i (1+ i)))
    (map-char-table
     #'(lambda (range val)
	 (if (consp range)
	     (setq range (cons (car range) (cdr range))))
	 (push (cons range val) data))
     cjk-table)
    (dolist (script scripts)
      (dolist (range (funcall script-coverage (car script)))
	(push (cons range (cdr script)) data)))
    `(quote ,(nreverse data))))
)

533 534
(defun setup-default-fontset ()
  "Setup the default fontset."
Kenichi Handa's avatar
Kenichi Handa committed
535 536
  (new-fontset
   "fontset-default"
537
   `(;; for each script
Kenichi Handa's avatar
Kenichi Handa committed
538 539 540 541 542 543 544 545 546
     (latin (nil . "ISO8859-1")
	    (nil . "ISO8859-2")
	    (nil . "ISO8859-3")
	    (nil . "ISO8859-4")
	    (nil . "ISO8859-9")
	    (nil . "ISO8859-10")
	    (nil . "ISO8859-13")
	    (nil . "ISO8859-14")
	    (nil . "ISO8859-15")
547
	    (nil . "ISO8859-16")
548
	    (nil . "VISCII1.1-1")
549
	    ,(font-spec :registry "iso10646-1" :script 'latin))
Kenichi Handa's avatar
Kenichi Handa committed
550

551 552
     (thai  ,(font-spec :registry "iso10646-1" :otf '(thai nil nil (mark)))
	    ,(font-spec :registry "iso10646-1" :script 'thai)
Kenichi Handa's avatar
Kenichi Handa committed
553 554
	    (nil . "TIS620*")
	    (nil . "ISO8859-11"))
Kenichi Handa's avatar
Kenichi Handa committed
555

556 557
     (devanagari ,(font-spec :registry "iso10646-1" :otf '(dev2 nil (rphf)))
                 ,(font-spec :registry "iso10646-1" :otf '(deva nil (rphf)))
558
		 (nil . "iso10646.indian-1"))
559 560 561 562 563 564 565 566 567 568 569 570 571 572
     (bengali ,(font-spec :registry "iso10646-1" :otf '(bng2 nil (rphf)))
              ,(font-spec :registry "iso10646-1" :otf '(beng nil (rphf))))
     (gurmukhi ,(font-spec :registry "iso10646-1" :otf '(gur2 nil (blwf)))
               ,(font-spec :registry "iso10646-1" :otf '(guru nil (blwf))))
     (gujarati ,(font-spec :registry "iso10646-1" :otf '(gjr2 nil (rphf)))
               ,(font-spec :registry "iso10646-1" :otf '(gujr nil (rphf))))
     (oriya ,(font-spec :registry "iso10646-1" :otf '(ory2 nil (rphf)))
            ,(font-spec :registry "iso10646-1" :otf '(orya nil (rphf))))
     (tamil ,(font-spec :registry "iso10646-1" :otf '(tml2 nil (akhn)))
            ,(font-spec :registry "iso10646-1" :otf '(taml nil (akhn))))
     (telugu ,(font-spec :registry "iso10646-1" :otf '(tel2 nil (blwf)))
             ,(font-spec :registry "iso10646-1" :otf '(telu nil (blwf))))
     (kannada ,(font-spec :registry "iso10646-1" :otf '(knd2 nil (rphf)))
              ,(font-spec :registry "iso10646-1" :otf '(knda nil (rphf))))
Kenichi Handa's avatar
Kenichi Handa committed
573
     (sinhala ,(font-spec :registry "iso10646-1" :otf '(sinh nil (akhn))))
574 575
     (malayalam ,(font-spec :registry "iso10646-1" :otf '(mlm2 nil (akhn)))
                ,(font-spec :registry "iso10646-1" :otf '(mlym nil (akhn))))
Kenichi Handa's avatar
Kenichi Handa committed
576

577 578
     (burmese ,(font-spec :registry "iso10646-1" :otf '(mym2 nil nil))
              ,(font-spec :registry "iso10646-1" :otf '(mymr nil nil))
Kenichi Handa's avatar
Kenichi Handa committed
579
	      ,(font-spec :registry "iso10646-1" :script 'burmese))
Kenichi Handa's avatar
Kenichi Handa committed
580

581
     (lao ,(font-spec :registry "iso10646-1" :otf '(lao\  nil nil (mark)))
582
	  ,(font-spec :registry "iso10646-1" :script 'lao)
Kenichi Handa's avatar
Kenichi Handa committed
583
	  (nil . "MuleLao-1"))
Kenichi Handa's avatar
Kenichi Handa committed
584

585 586
     (tai-viet ("TaiViet" . "iso10646-1"))

Kenichi Handa's avatar
Kenichi Handa committed
587 588
     (greek ,(font-spec :registry "iso10646-1" :script 'greek)
	    (nil . "ISO8859-7"))
Kenichi Handa's avatar
Kenichi Handa committed
589

Kenichi Handa's avatar
Kenichi Handa committed
590 591
     (cyrillic ,(font-spec :registry "iso10646-1" :script 'cyrillic)
	       (nil . "ISO8859-5")
592 593
	       (nil . "microsoft-cp1251")
	       (nil . "koi8-r"))
Kenichi Handa's avatar
Kenichi Handa committed
594

Kenichi Handa's avatar
Kenichi Handa committed
595
     (arabic ,(font-spec :registry "iso10646-1"
Kenichi Handa's avatar
Kenichi Handa committed
596
			 :otf '(arab nil (init medi fina liga)))
Kenichi Handa's avatar
Kenichi Handa committed
597
	     (nil . "MuleArabic-0")
Kenichi Handa's avatar
Kenichi Handa committed
598 599 600 601
	     (nil . "MuleArabic-1")
	     (nil . "MuleArabic-2")
	     (nil . "ISO8859-6"))

Kenichi Handa's avatar
Kenichi Handa committed
602 603 604 605 606
     (hebrew ,(font-spec :registry "iso10646-1" :script 'hebrew)
	     (nil . "ISO8859-8"))

     (khmer ,(font-spec :registry "iso10646-1" :otf '(khmr nil (pres))))

607
     (kana (nil . "JISX0208*")
Kenichi Handa's avatar
Kenichi Handa committed
608 609
	   (nil . "GB2312.1980-0")
	   (nil . "KSC5601.1987*")
610 611
	   (nil . "JISX0201*")
	   (nil . "JISX0213.2000-1")
612 613
	   (nil . "JISX0213.2004-1")
	   ,(font-spec :registry "iso10646-1" :script 'kana))
Kenichi Handa's avatar
Kenichi Handa committed
614

615 616
     (bopomofo ,(font-spec :registry "iso10646-1" :script 'bopomofo)
	       (nil . "sisheng_cwnn-0"))
Kenichi Handa's avatar
Kenichi Handa committed
617

618
     (han (nil . "GB2312.1980-0")
Kenichi Handa's avatar
Kenichi Handa committed
619 620 621 622 623 624 625 626 627 628 629 630
	  (nil . "JISX0208*")
	  (nil . "JISX0212*")
	  (nil . "big5*")
	  (nil . "KSC5601.1987*")
	  (nil . "CNS11643.1992-1")
	  (nil . "CNS11643.1992-2")
	  (nil . "CNS11643.1992-3")
	  (nil . "CNS11643.1992-4")
	  (nil . "CNS11643.1992-5")
	  (nil . "CNS11643.1992-6")
	  (nil . "CNS11643.1992-7")
	  (nil . "gbk-0")
631
	  (nil . "gb18030")
Kenichi Handa's avatar
Kenichi Handa committed
632
	  (nil . "JISX0213.2000-1")
633
	  (nil . "JISX0213.2000-2")
634 635 636
	  (nil . "JISX0213.2004-1")
	  ,(font-spec :registry "iso10646-1" :lang 'ja)
	  ,(font-spec :registry "iso10646-1" :lang 'zh))
Kenichi Handa's avatar
Kenichi Handa committed
637

638
     (cjk-misc (nil . "GB2312.1980-0")
Kenichi Handa's avatar
Kenichi Handa committed
639 640 641 642 643 644 645 646 647 648 649 650
	       (nil . "JISX0208*")
	       (nil . "JISX0212*")
	       (nil . "big5*")
	       (nil . "KSC5601.1987*")
	       (nil . "CNS11643.1992-1")
	       (nil . "CNS11643.1992-2")
	       (nil . "CNS11643.1992-3")
	       (nil . "CNS11643.1992-4")
	       (nil . "CNS11643.1992-5")
	       (nil . "CNS11643.1992-6")
	       (nil . "CNS11643.1992-7")
	       (nil . "gbk-0")
651
	       (nil . "gb18030")
Kenichi Handa's avatar
Kenichi Handa committed
652
	       (nil . "JISX0213.2000-1")
653
	       (nil . "JISX0213.2000-2")
654 655
	       ,(font-spec :registry "iso10646-1" :lang 'ja)
	       ,(font-spec :registry "iso10646-1" :lang 'zh))
Kenichi Handa's avatar
Kenichi Handa committed
656

657
     (hangul (nil . "KSC5601.1987-0")
658
	     ,(font-spec :registry "iso10646-1" :lang 'ko))
Kenichi Handa's avatar
Kenichi Handa committed
659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688

     ;; for each charset
     (ascii (nil . "ISO8859-1"))
     (arabic-digit ("*" . "MuleArabic-0"))
     (arabic-1-column ("*" . "MuleArabic-1"))
     (arabic-2-column ("*" . "MuleArabic-2"))
     (indian-is13194 (nil . "is13194-devanagari"))
     (indian-1-column ("*" . "muleindian-2"))
     ;; Indian CDAC
     (devanagari-cdac (nil . "Devanagari-CDAC"))
     (sanskrit-cdac (nil . "Sanskrit-CDAC"))
     (bengali-cdac (nil . "Bengali-CDAC"))
     (assamese-cdac (nil . "Assamese-CDAC"))
     (punjabi-cdac (nil . "Punjabi-CDAC"))
     (gujarati-cdac (nil . "Gujarati-CDAC"))
     (oriya-cdac (nil . "Oriya-CDAC"))
     (tamil-cdac (nil . "Tamil-CDAC"))
     (telugu-cdac (nil . "Telugu-CDAC"))
     (kannada-cdac (nil . "Kannada-CDAC"))
     (malayalam-cdac (nil . "Malayalam-CDAC"))
     ;; Indian AKRUTI
     (devanagari-akruti (nil . "Devanagari-Akruti"))
     (bengali-akruti (nil . "Bengali-Akruti"))
     (punjabi-akruti (nil . "Punjabi-Akruti"))
     (gujarati-akruti (nil . "Gujarati-Akruti"))
     (oriya-akruti (nil . "Oriya-Akruti"))
     (tamil-akruti (nil . "Tamil-Akruti"))
     (telugu-akruti (nil . "Telugu-Akruti"))
     (kannada-akruti (nil . "Kannada-Akruti"))
     (malayalam-akruti (nil . "Malayalam-Akruti"))
689 690 691

     ;; Fallback fonts
     (nil (nil . "gb2312.1980")
692 693
	  (nil . "gbk-0")
	  (nil . "gb18030")
694 695
	  (nil . "jisx0208")
	  (nil . "ksc5601.1987")
696 697 698 699 700 701 702
	  (nil . "CNS11643.1992-1")
	  (nil . "CNS11643.1992-2")
	  (nil . "CNS11643.1992-3")
	  (nil . "CNS11643.1992-4")
	  (nil . "CNS11643.1992-5")
	  (nil . "CNS11643.1992-6")
	  (nil . "CNS11643.1992-7")
703 704 705 706
	  (nil . "big5")
	  (nil . "jisx0213.2000-1")
	  (nil . "jisx0213.2004-1")
	  (nil . "jisx0212"))
Kenichi Handa's avatar
Kenichi Handa committed
707 708
     ))

709 710 711 712
  ;; For simple scripts
  (dolist (script '(phonetic
		    armenian
		    thaana
713
		    syriac
714 715 716 717 718 719 720 721
		    georgian
		    cherokee
		    canadian-aboriginal
		    ogham
		    runic
		    symbol
		    braille
		    yi
722
		    tai-viet
723
		    aegean-number
724 725 726 727 728
		    ancient-greek-number
		    ancient-symbol
		    phaistos-disc
		    lycian
		    carian
729
		    old-italic
730 731 732 733 734
		    ugaritic
		    old-persian
		    deseret
		    shavian
		    osmanya
735
		    osage
736 737 738 739
		    cypriot-syllabary
		    phoenician
		    lydian
		    kharoshthi
740 741 742
		    manichaean
		    elymaic
		    makasar
743
		    cuneiform-numbers-and-punctuation
744 745
		    cuneiform
		    egyptian
746 747 748
		    bassa-vah
		    pahawh-hmong
		    medefaidrin
749 750 751 752 753
		    byzantine-musical-symbol
		    musical-symbol
		    ancient-greek-musical-notation
		    tai-xuan-jing-symbol
		    counting-rod-numeral
754
		    adlam
755 756 757
		    mahjong-tile
		    domino-tile))
    (set-fontset-font "fontset-default"
758 759
		      script (font-spec :registry "iso10646-1" :script script)
		      nil 'append))
760

761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791
  ;; Special settings for `MATHEMATICAL (U+1D400..U+1D7FF)'.
  (dolist (math-subgroup '((#x1D400 #x1D433 mathematical-bold)
			   (#x1D434 #x1D467 mathematical-italic)
			   (#x1D468 #x1D49B mathematical-bold-italic)
			   (#x1D49C #x1D4CF mathematical-script)
			   (#x1D4D0 #x1D503 mathematical-bold-script)
			   (#x1D504 #x1D537 mathematical-fraktur)
			   (#x1D538 #x1D56B mathematical-double-struck)
			   (#x1D56C #x1D59F mathematical-bold-fraktur)
			   (#x1D5A0 #x1D5D3 mathematical-sans-serif)
			   (#x1D5D4 #x1D607 mathematical-sans-serif-bold)
			   (#x1D608 #x1D63B mathematical-sans-serif-italic)
			   (#x1D63C #x1D66F mathematical-sans-serif-bold-italic)
			   (#x1D670 #x1D6A3 mathematical-monospace)
			   (#x1D6A4 #x1D6A5 mathematical-italic)
			   (#x1D6A8 #x1D6E1 mathematical-bold)
			   (#x1D6E2 #x1D71B mathematical-italic)
			   (#x1D71C #x1D755 mathematical-bold-italic)
			   (#x1D756 #x1D78F mathematical-sans-serif-bold)
			   (#x1D790 #x1D7C9 mathematical-sans-serif-bold-italic)
			   (#x1D7CA #x1D7D7 mathematical-bold)
			   (#x1D7D8 #x1D7E1 mathematical-double-struck)
			   (#x1D7E2 #x1D7EB mathematical-sans-serif)
			   (#x1D7EC #x1D7F5 mathematical-sans-serif-bold)
			   (#x1D7F6 #x1D7FF mathematical-monospace)))
    (let ((slot (assq (nth 2 math-subgroup) script-representative-chars)))
      (if slot
	  (if (vectorp (cdr slot))
	      (setcdr slot (vconcat (cdr slot) (vector (car math-subgroup))))
	    (setcdr slot (vector (cadr slot) (car math-subgroup))))
	(setq slot (list (nth 2 math-subgroup) (car math-subgroup)))
792
	(nconc script-representative-chars (list slot))))
793 794 795 796 797
    (set-fontset-font
     "fontset-default"
     (cons (car math-subgroup) (nth 1 math-subgroup))
     (font-spec :registry "iso10646-1" :script (nth 2 math-subgroup))))

798 799 800 801 802
  ;; Special setup for various symbols and punctuation characters
  ;; covered well by Symbola, excluding those covered well by popular
  ;; Unicode fonts.  We exclude the latter because users don't like us
  ;; invading on their font setups where they have good support from
  ;; other fonts.
803
  (dolist (symbol-subgroup
804 805 806 807 808 809
           '((#x2000 . #x2012)	;; General Punctuation
             (#x2015 . #x2017)
             #x201F
             (#x2023 . #x202F)
             (#x2031 . #x2038)
             (#x203B . #x206F)
810
             (#x2070 . #x209F)	;; Superscripts and Subscripts
Eli Zaretskii's avatar
Eli Zaretskii committed
811
             (#x20B6 . #x20CF)	;; Currency Symbols
812 813 814 815 816 817 818 819 820 821 822 823 824 825
             (#x2100 . #x2121)	;; Letterlike Symbols
             (#x2123 . #x214F)
             (#x2150 . #x215A)	;; Number Forms
             (#x215F . #x218F)
             (#x2194 . #x21FF)	;; Arrows
             (#x2200 . #x2211)	;; Mathematical Operators
             (#x2213 . #x2247)
             (#x2249 . #x225F)
             (#x2261 . #x2263)
             (#x2266 . #x22FF)
             (#x2300 . #x2301)	;; Miscellaneous Technical
             (#x2303 . #x230F)
             (#x2311 . #x231F)
             (#x2322 . #x23FF)
826 827 828 829
             (#x2400 . #x243F)	;; Control Pictures
             (#x2440 . #x245F)	;; Optical Char Recognition
             (#x2460 . #x24FF)	;; Enclosed Alphanumerics
             (#x25A0 . #x25FF)	;; Geometric Shapes
830 831 832 833 834
             (#x2600 . #x265F)	;; Miscellaneous Symbols
             (#x2661 . #x2662)
             #x2664
             (#x2667 . #x2669)
             (#x266C . #x26FF)
835 836 837 838 839 840 841 842 843 844 845
             (#x2700 . #x27bF)	;; Dingbats
             (#x27C0 . #x27EF)	;; Misc Mathematical Symbols-A
             (#x27F0 . #x27FF)	;; Supplemental Arrows-A
             (#x2900 . #x297F)	;; Supplemental Arrows-B
             (#x2980 . #x29FF)	;; Misc Mathematical Symbols-B
             (#x2A00 . #x2AFF)	;; Suppl. Math Operators
             (#x2B00 . #x2BFF)	;; Misc Symbols and Arrows
             (#x2E00 . #x2E7F)	;; Supplemental Punctuation
             (#x4DC0 . #x4DFF)	;; Yijing Hexagram Symbols
             (#xFE10 . #xFE1F)	;; Vertical Forms
             (#x10100 . #x1013F)	;; Aegean Numbers
846 847
             (#x10190 . #x101CF)	;; Ancient Symbols
             (#x101D0 . #x101FF)	;; Phaistos Disc
848
             (#x102E0 . #x102FF)	;; Coptic Epact Numbers
Paul Eggert's avatar
Paul Eggert committed
849
             (#x1D000 . #x1D0FF)	;; Byzantine Musical Symbols
850
             (#x1D200 . #x1D24F)	;; Ancient Greek Musical Notation
851 852 853 854 855
             (#x1D2E0 . #x1D2FF)	;; Mayan Numerals
             (#x1D300 . #x1D35F)	;; Tai Xuan Jing Symbols
             (#x1D360 . #x1D37F)	;; Counting Rod Numerals
             (#x1F000 . #x1F02F)	;; Mahjong Tiles
             (#x1F030 . #x1F09F)	;; Domino Tiles
856 857 858 859 860 861 862 863
             (#x1F0A0 . #x1F0FF)	;; Playing Cards
             (#x1F100 . #x1F1FF)	;; Enclosed Alphanumeric Suppl
             (#x1F300 . #x1F5FF)	;; Misc Symbols and Pictographs
             (#x1F600 . #x1F64F)	;; Emoticons
             (#x1F650 . #x1F67F)	;; Ornamental Dingbats
             (#x1F680 . #x1F6FF)	;; Transport and Map Symbols
             (#x1F700 . #x1F77F)	;; Alchemical Symbols
             (#x1F780 . #x1F7FF)	;; Geometric Shapes Extended
864
             (#x1F800 . #x1F8FF)	;; Supplemental Arrows-C
865 866
             (#x1F900 . #x1F9FF)	;; Supplemental Symbols and Pictographs
             (#x1FA00 . #x1FA6F)))	;; Chess Symbols
867 868
    (set-fontset-font "fontset-default" symbol-subgroup
                      '("Symbola" . "iso10646-1") nil 'prepend))
869
  ;; Box Drawing and Block Elements
870
  (set-fontset-font "fontset-default" '(#x2500 . #x259F)
871
                    '("FreeMono" . "iso10646-1") nil 'prepend)
872

873
  ;; Since standard-fontset-spec on X uses fixed-medium font, which
874
  ;; gets mapped to an iso8859-1 variant, we would like to prefer its
875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897
  ;; iso10646-1 variant for symbols, where the coverage is known to be
  ;; good.
  (dolist (symbol-subgroup
			 '((#x2000 . #x206F)   ;; General Punctuation
			   (#x2070 . #x209F)   ;; Superscripts and Subscripts
			   (#x20A0 . #x20CF)   ;; Currency Symbols
			   (#x2150 . #x218F)   ;; Number Forms
			   (#x2190 . #x21FF)   ;; Arrows
			   (#x2200 . #x22FF)   ;; Mathematical Operators
			   (#x2300 . #x23FF)   ;; Miscellaneous Technical
			   (#x2400 . #x243F)   ;; Control Pictures
			   (#x2440 . #x245F)   ;; Optical Char Recognition
			   (#x2460 . #x24FF)   ;; Enclosed Alphanumerics
                           (#x2500 . #x257F)   ;; Box Drawing
                           (#x2580 . #x259F)   ;; Block Elements
			   (#x25A0 . #x25FF)   ;; Geometric Shapes
			   (#x2600 . #x2689)   ;; Miscellaneous Symbols
			   (#x2700 . #x27bF)   ;; Dingbats
			   (#x27F5 . #x27FF))) ;; Supplemental Arrows-A
    (set-fontset-font "fontset-default" symbol-subgroup
                      "-*-fixed-medium-*-*-*-*-*-*-*-*-*-iso10646-1"
                      nil 'prepend))

898
  ;; Append CJK fonts for characters other than han, kana, cjk-misc.
899 900 901 902 903 904 905 906
  ;; Append fonts for scripts whose name is also a charset name.
  (let* ((data (build-default-fontset-data))
	 (registries (car data)))
    (dolist (target-spec (cdr data))
      (let ((target (car target-spec))
	    (spec (cdr target-spec)))
	(if (integerp spec)
	    (dotimes (i (length registries))
907
	      (if (> (logand spec (ash 1 i)) 0)
908 909 910 911 912 913
		  (set-fontset-font "fontset-default" target
				    (cons nil (aref registries i))
				    nil 'append)))
	(dolist (args spec)
	  (set-fontset-font "fontset-default" target
			    (apply 'font-spec args) nil 'append))))))
914

Kenichi Handa's avatar
Kenichi Handa committed
915 916 917
  ;; Append Unicode fonts.
  ;; This may find fonts with more variants (bold, italic) but which
  ;; don't cover many characters.
918
  (set-fontset-font "fontset-default" nil
919
		    '(nil . "iso10646-1") nil 'prepend)
Kenichi Handa's avatar
Kenichi Handa committed
920 921
  ;; These may find fonts that cover many characters but with fewer
  ;; variants.
922
  (set-fontset-font "fontset-default" nil
923
		    '("gnu-unifont" . "iso10646-1") nil 'prepend)
924
  (set-fontset-font "fontset-default" nil
925
		    '("mutt-clearlyu" . "iso10646-1") nil 'prepend)
926 927
  (set-fontset-font "fontset-default" '(#x20000 . #x2FFFF)
		    '(nil . "unicode-sip"))
928

929 930 931 932 933
  (set-fontset-font "fontset-default" '(#xE000 . #xF8FF)
		    '(nil . "iso10646-1"))
  ;; Don't try the fallback fonts even if no suitable font was found
  ;; by the above font-spec.
  (set-fontset-font "fontset-default" '(#xE000 . #xF8FF) nil nil 'append))