]> code.delx.au - gnu-emacs/blobdiff - lisp/international/fontset.el
; Merge from origin/emacs-25
[gnu-emacs] / lisp / international / fontset.el
index 324d615c58137c139d4391812fb7d1a5fa43d0d1..612c0a08ad7db51d5e656e9e02fbef284f886fb6 100644 (file)
@@ -1,6 +1,6 @@
 ;;; fontset.el --- commands for handling fontset
 
-;; Copyright (C) 1997-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2016 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 ;;   2005, 2006, 2007, 2008, 2009, 2010, 2011
 ;;   National Institute of Advanced Industrial Science and Technology (AIST)
        (cyrillic #x42F)
        (armenian #x531)
        (hebrew #x5D0)
+       (vai #xA500)
        (arabic #x628)
        (syriac #x710)
        (thaana #x78C)
        (phaistos-disc #x101D0)
        (lycian #x10280)
        (carian #x102A0)
-       (olt-italic #x10300)
+       (old-italic #x10300)
        (ugaritic #x10380)
+       (old-permic #x10350)
        (old-persian #x103A0)
        (deseret #x10400)
        (shavian #x10450)
        (osmanya #x10480)
+        (osage #x104B0)
+       (elbasan #x10500)
+       (caucasian-albanian #x10530)
+       (linear-a #x10600)
        (cypriot-syllabary #x10800)
+       (palmyrene #x10860)
+       (nabataean #x10880)
        (phoenician #x10900)
        (lydian #x10920)
        (kharoshthi #x10A00)
+       (manichaean #x10AC0)
+       (mahajani #x11150)
+       (sinhala-archaic-number #x111E1)
+       (khojki #x11200)
+       (khudawadi #x112B0)
+       (grantha #x11305)
+        (newa #x11400)
+       (tirhuta #x11481)
+       (siddham #x11580)
+       (modi #x11600)
+       (takri #x11680)
+       (warang-citi #x118A1)
+       (pau-cin-hau #x11AC0)
+        (bhaiksuki #x11C00)
+        (marchen #x11C72)
        (cuneiform #x12000)
        (cuneiform-numbers-and-punctuation #x12400)
+       (mro #x16A40)
+       (bassa-vah #x16AD0)
+       (pahawh-hmong #x16B11)
+        (tangut #x17000)
+        (tangut-components #x18800)
+       (duployan-shorthand #x1BC20)
        (byzantine-musical-symbol #x1D000)
        (musical-symbol #x1D100)
        (ancient-greek-musical-notation #x1D200)
        (tai-xuan-jing-symbol #x1D300)
        (counting-rod-numeral #x1D360)
+       (mende-kikakui #x1E810)
+        (adlam #x1E900)
        (mahjong-tile #x1F000)
        (domino-tile #x1F030)))
 
 (defvar otf-script-alist)
 
+;; The below was synchronized with the latest Feb 25, 2016 version of
+;; https://www.microsoft.com/typography/otspec/scripttags.htm.
 (setq otf-script-alist
-      '((arab . arabic)
+      '((adlm . adlam)
+        (ahom . ahom)
+        (hluw . anatolian)
+        (arab . arabic)
+       (armi . aramaic)
        (armn . armenian)
+       (avst . avestan)
        (bali . balinese)
+       (bamu . bamum)
+        (bass . bassa-vah)
+       (batk . batak)
+       (bng2 . bengali)
        (beng . bengali)
+        (bhks . bhaiksuki)
        (bopo . bopomofo)
+       (brah . brahmi)
        (brai . braille)
        (bugi . buginese)
        (buhd . buhid)
        (byzm . byzantine-musical-symbol)
        (cans . canadian-aboriginal)
+       (cari . carian)
+        (aghb . caucasian-albanian)
+       (cakm . chakma)
+       (cham . cham)
        (cher . cherokee)
        (copt . coptic)
        (xsux . cuneiform)
-       (cyrl . cyrillic)
        (cprt . cypriot)
+       (cyrl . cyrillic)
        (dsrt . deseret)
        (deva . devanagari)
+       (dev2 . devanagari)
+        (dupl . duployan-shorthand)
+       (egyp . egyptian)
+        (elba . elbasan)
        (ethi . ethiopic)
        (geor . georgian)
        (glag . glagolitic)
        (goth . gothic)
+        (gran . grantha)
        (grek . greek)
        (gujr . gujarati)
+       (gjr2 . gujarati)
        (guru . gurmukhi)
+       (gur2 . gurmukhi)
        (hani . han)
        (hang . hangul)
+       (jamo . hangul)
        (hano . hanunoo)
+        (hatr . hatran)
        (hebr . hebrew)
-       (kana . kana)
+       (phli . inscriptional-pahlavi)
+       (prti . inscriptional-parthian)
+       (java . javanese)
+       (kthi . kaithi)
+       (kana . kana)   ; Hiragana
        (knda . kannada)
+       (knd2 . kannada)
+       (kali . kayah-li)
        (khar . kharoshthi)
        (khmr . khmer)
+        (khoj . khojki)
+        (sind . khudawadi)
        (lao\  . lao)
        (latn . latin)
+       (lepc . lepcha)
        (limb . limbu)
+       (lina . linear_a)
        (linb . linear_b)
+        (lisu . lisu)
+        (lyci . lycian)
+        (lydi . lydian)
+        (mahj . mahajani)
+        (marc . marchen)
        (mlym . malayalam)
+       (mlm2 . malayalam)
+       (mand . mandaic)
+        (mani . manichaean)
        (math . mathematical)
+       (mtei . meetei-mayek)
+        (mend . mende-kikakui)
+       (merc . meroitic)
+       (mero . meroitic)
+        (plrd . miao)
+        (modi . modi)
        (mong . mongolian)
+        (mroo . mro)
+        (mult . multani)
        (musc . musical-symbol)
+       (mym2 . burmese)
        (mymr . burmese)
+        (nbat . nabataean)
+        (newa . newa)
        (nko\  . nko)
        (ogam . ogham)
+       (olck . ol-chiki)
        (ital . old_italic)
        (xpeo . old_persian)
+        (narb . old-north-arabian)
+        (perm . old-permic)
+       (sarb . old-south-arabian)
+       (orkh . old-turkic)
        (orya . oriya)
+       (ory2 . oriya)
+        (osge . osage)
        (osma . osmanya)
+        (hmng . pahawh-hmong)
+        (palm . palmyrene)
+        (pauc . pau-cin-hau)
        (phag . phags-pa)
+        (phli . inscriptional-pahlavi)
        (phnx . phoenician)
+        (phlp . psalter-pahlavi)
+        (prti . inscriptional-parthian)
+       (rjng . rejang)
        (runr . runic)
+       (samr . samaritan)
+       (saur . saurashtra)
+       (shrd . sharada)
        (shaw . shavian)
+        (sidd . siddham)
+        (sgnw . sutton-sign-writing)
        (sinh . sinhala)
+       (sora . sora-sompeng)
+       (sund . sundanese)
        (sylo . syloti_nagri)
        (syrc . syriac)
        (tglg . tagalog)
        (tagb . tagbanwa)
-       (taml . tamil)
        (tale . tai_le)
+       (talu . tai-lue)
+       (lana . tai-tham)
+       (tavt . tai-viet)
+       (takr . takri)
+       (taml . tamil)
+       (tml2 . tamil)
+        (tang . tangut)
        (telu . telugu)
+       (tel2 . telugu)
        (thaa . thaana)
        (thai . thai)
        (tibt . tibetan)
        (tfng . tifinagh)
+        (tirh . tirhuta)
        (ugar . ugaritic)
+       (vai\  . vai)
+        (wara . warang-citi)
        (yi\ \   . yi)))
 
 ;; Set standard fontname specification of characters in the default
 
 (eval-when-compile
 
-;; Build data to initialize the default fontset at compile time to
+;; Build data to initialize the default fontset at compile time to
 ;; avoid loading charsets that won't be necessary at runtime.
 
 ;; The value is (CJK-REGISTRY-VECTOR TARGET-SPEC ...), where
            (nil . "TIS620*")
            (nil . "ISO8859-11"))
 
-     (devanagari ,(font-spec :registry "iso10646-1" :otf '(deva nil (rphf)))
+     (devanagari ,(font-spec :registry "iso10646-1" :otf '(dev2 nil (rphf)))
+                 ,(font-spec :registry "iso10646-1" :otf '(deva nil (rphf)))
                 (nil . "iso10646.indian-1"))
-     (bengali ,(font-spec :registry "iso10646-1" :otf '(beng nil (rphf))))
-     (gurmukhi ,(font-spec :registry "iso10646-1" :otf '(guru nil (blwf))))
-     (gujarati ,(font-spec :registry "iso10646-1" :otf '(gujr nil (rphf))))
-     (oriya ,(font-spec :registry "iso10646-1" :otf '(orya nil (rphf))))
-     (tamil ,(font-spec :registry "iso10646-1" :otf '(taml nil (akhn))))
-     (telugu ,(font-spec :registry "iso10646-1" :otf '(telu nil (blwf))))
-     (kannada ,(font-spec :registry "iso10646-1" :otf '(knda nil (rphf))))
+     (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))))
      (sinhala ,(font-spec :registry "iso10646-1" :otf '(sinh nil (akhn))))
-     (malayalam ,(font-spec :registry "iso10646-1" :otf '(mlym nil (akhn))))
+     (malayalam ,(font-spec :registry "iso10646-1" :otf '(mlm2 nil (akhn)))
+                ,(font-spec :registry "iso10646-1" :otf '(mlym nil (akhn))))
 
-     (burmese ,(font-spec :registry "iso10646-1" :otf '(mymr nil nil))
+     (burmese ,(font-spec :registry "iso10646-1" :otf '(mym2 nil nil))
+              ,(font-spec :registry "iso10646-1" :otf '(mymr nil nil))
              ,(font-spec :registry "iso10646-1" :script 'burmese))
 
      (lao ,(font-spec :registry "iso10646-1" :otf '(lao\  nil nil (mark)))
                    phaistos-disc
                    lycian
                    carian
-                   olt-italic
+                   old-italic
                    ugaritic
                    old-persian
                    deseret
      (cons (car math-subgroup) (nth 1 math-subgroup))
      (font-spec :registry "iso10646-1" :script (nth 2 math-subgroup))))
 
+  ;; 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.
+  (dolist (symbol-subgroup
+           '((#x2000 . #x2012) ;; General Punctuation
+             (#x2015 . #x2017)
+             #x201F
+             (#x2023 . #x202F)
+             (#x2031 . #x2038)
+             (#x203B . #x206F)
+             (#x2070 . #x209F) ;; Superscripts and Subscripts
+             (#x20B6 . #x20CF) ;; Currency Symbols
+             (#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)
+             (#x2400 . #x243F) ;; Control Pictures
+             (#x2440 . #x245F) ;; Optical Char Recognition
+             (#x2460 . #x24FF) ;; Enclosed Alphanumerics
+             (#x25A0 . #x25FF) ;; Geometric Shapes
+             (#x2600 . #x265F) ;; Miscellaneous Symbols
+             (#x2661 . #x2662)
+             #x2664
+             (#x2667 . #x2669)
+             (#x266C . #x26FF)
+             (#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
+             (#x102E0 . #x102FF)       ;; Coptic Epact Numbers
+             (#x1D000 . #x1D0FF)       ;; Byzantine Musical Symbols
+             (#x1D200 . #x1D24F)       ;; Ancient Greek Musical Notation
+             (#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
+             (#x1F800 . #x1F8FF)))     ;; Supplemental Arrows-C
+    (set-fontset-font "fontset-default" symbol-subgroup "Symbola" nil 'prepend))
+  ;; Box Drawing and Block Elements
+  (set-fontset-font "fontset-default" '(#x2500 . #x259F)
+                    "FreeMono" nil 'prepend)
+
+  ;; Since standard-fontset-spec on X uses fixed-medium font, which
+  ;; gets mapped to a iso8859-1 variant, we would like to prefer its
+  ;; 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))
+
   ;; Append CJK fonts for characters other than han, kana, cjk-misc.
   ;; Append fonts for scripts whose name is also a charset name.
   (let* ((data (build-default-fontset-data))
@@ -1042,7 +1259,7 @@ to map charsets to scripts.")
                                         &optional _style-variant _noerror)
   "Create a fontset from fontset specification string FONTSET-SPEC.
 FONTSET-SPEC is a string of the format:
-       FONTSET-NAME,SCRIPT-NAME0:FONT-NAME0,SCRIPT-NAME1:FONT-NAME1, ...
+       FONTSET-NAME[,SCRIPT-NAME0:FONT-NAME0,SCRIPT-NAME1:FONT-NAME1] ...
 Any number of SPACE, TAB, and NEWLINE can be put before and after commas.
 
 When a frame uses the fontset as the `font' parameter, the frame's