]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4441 / 4: Define default fonts in fontconfig configuration file
authorMasamichi Hosoda <trueroad@trueroad.jp>
Fri, 12 Jun 2015 08:17:56 +0000 (17:17 +0900)
committerMasamichi Hosoda <trueroad@trueroad.jp>
Wed, 17 Jun 2015 10:47:10 +0000 (19:47 +0900)
This commit defines LilyPond default fonts
in local fontconfig configuration file.
And, LilyPond uses them.

It is possible to combine multiple fonts
with different character sets and glyphs each other.

e.g. Following fonts can be combined.
Latin glyphs: from a font without Cyrillic glyphs
Cyrillic glyphs: from another font with Cyrillic glyphs

mf/lilypond-fonts.conf.in
scm/font.scm

index 43e52c85780fe1e5ed28437715ba86e182744a32..3cd59becadcd7c317125d64c44ec06fd9881a263 100644 (file)
@@ -1,4 +1,40 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
 <fontconfig>
+
+  <!-- Define LilyPond default fonts -->
+
+  <alias binding="strong">
+    <family>LilyPond Serif</family>
+    <prefer>
+      <family>Century Schoolbook L</family>
+      <family>DejaVu Serif</family>
+    </prefer>
+    <default>
+      <family>serif</family>
+    </default>
+  </alias>
+
+  <alias binding="strong">
+    <family>LilyPond Sans Serif</family>
+    <prefer>
+      <family>Nimbus Sans L</family>
+      <family>DejaVu Sans</family>
+    </prefer>
+    <default>
+      <family>sans-serif</family>
+    </default>
+  </alias>
+
+  <alias binding="strong">
+    <family>LilyPond Monospace</family>
+    <prefer>
+      <family>Nimbus Mono L</family>
+      <family>DejaVu Sans Mono</family>
+    </prefer>
+    <default>
+      <family>monospace</family>
+    </default>
+  </alias>
+
 </fontconfig>
index 0582a492a1e18dec33db1c2533e3133b3f16740f..82f6d489901782ef4038977e2c6350827d9941fe 100644 (file)
@@ -252,9 +252,9 @@ used.  This is used to select the proper design size for the text fonts.
 (define*-public (set-global-fonts #:key 
   (music "emmentaler")
   (brace "emmentaler")
-  (roman "Century Schoolbook L")
-  (sans "Nimbus Sans L")
-  (typewriter "Nimbus Mono L")
+  (roman "LilyPond Serif")
+  (sans "LilyPond Sans Serif")
+  (typewriter "LilyPond Monospace")
   (factor 1))
   (let ((n (make-font-tree-node 'font-encoding 'fetaMusic)))
     (add-music-fonts n 'feta music brace feta-design-size-mapping factor)
@@ -273,9 +273,9 @@ used.  This is used to select the proper design size for the text fonts.
 
 (define-public (make-century-schoolbook-tree factor)
   (make-pango-font-tree
-   "Century Schoolbook L"
-   "Nimbus Sans L"
-   "Nimbus Mono L"
+   "LilyPond Serif"
+   "LilyPond Sans Serif"
+   "LilyPond Monospace"
    factor))
 
 (define-public all-text-font-encodings