]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4991: Add installing optional URW++ fonts
authorMasamichi Hosoda <trueroad@trueroad.jp>
Fri, 28 Oct 2016 13:53:25 +0000 (22:53 +0900)
committerMasamichi Hosoda <trueroad@trueroad.jp>
Thu, 17 Nov 2016 13:30:03 +0000 (22:30 +0900)
LilyPond default fonts (TeX Gyre) do not have Greek and Cyrillic glyphs.
Newest URW 35 fonts (June 2016) have them.
http://git.ghostscript.com/?p=urw-core35-fonts.git;a=commit;h=79bcdfb34fbce12b592cce389fa7a19da6b5b018

This commit realizes the followings.

. configure script finds the following 12 OTF files.
. If they are found, `make install` installs them.
  (Both TeX Gyre and URW fons are installed
   under the lilypond fonts directory.)
. Even if they are not found, configure script does not raise error.
  (Only TeX Gyre fonts are installed.)

C059-BdIta.otf
C059-Bold.otf
C059-Italic.otf
C059-Roman.otf

NimbusMonoPS-Bold.otf
NimbusMonoPS-BoldItalic.otf
NimbusMonoPS-Italic.otf
NimbusMonoPS-Regular.otf

NimbusSans-Bold.otf
NimbusSans-BoldOblique.otf
NimbusSans-Oblique.otf
NimbusSans-Regular.otf

GNUmakefile.in
config.make.in
configure.ac
mf/GNUmakefile

index abc7ecaf6aba1eea6416582c9a590ec2690296b1..76f4515be93f6034c4fd0966788a8ff512afb9b3 100644 (file)
@@ -260,6 +260,8 @@ $(tree-share-prefix)/mf-link-tree: $(tree-share-prefix)/lilypond-force
                cd $(tree-share-prefix)/fonts/otf && \
                ln -s ../../../../../../mf/$(outconfbase)/*.otf . && \
                $(foreach i,$(addprefix $(TEXGYRE_DIR)/,$(TEXGYRE_FILES)), \
+                       ln -s $i . && ) true && \
+               $(foreach i,$(addprefix $(URWOTF_DIR)/,$(URWOTF_FILES)), \
                        ln -s $i . && ) true
        -cd $(tree-share-prefix)/fonts && \
                ln -s ../../../../../mf/$(outconfbase)/fonts.conf . && \
index c681d761990ce0fe7cfa696a53c0ea1e1e12ed4f..d376a59f481c18a385d8b9703617d94ab8aa4662 100644 (file)
@@ -92,6 +92,8 @@ vimdir = $(lilypond_datadir)/vim
 
 TEXGYRE_DIR = @TEXGYRE_DIR@
 TEXGYRE_FILES = @TEXGYRE_FILES@
+URWOTF_DIR = @URWOTF_DIR@
+URWOTF_FILES = @URWOTF_FILES@
 
 ################################################################
 ## PROGRAMS
index d341125c21136c8a202bb43fcd6bd39270c084d6..19ffd18bf31663cda5177993589e8f7d6edcb405 100644 (file)
@@ -38,6 +38,12 @@ AC_ARG_WITH(texgyre-dir,
     [TEXGYRE_DIR=$withval],
     [TEXGYRE_DIR=""])
 
+AC_ARG_WITH(urwotf-dir,
+    [AS_HELP_STRING([--with-urwotf-dir=DIR],
+                   [location of URW++ OTF fonts.])],
+    [URWOTF_DIR=$withval],
+    [URWOTF_DIR=""])
+
 reloc_b=no
 AC_ARG_ENABLE(relocation,
     [AS_HELP_STRING([--enable-relocation],
@@ -103,6 +109,48 @@ if test "$TEXGYRE_DIR" = "" -o "$MISSING_TEXGYRE_FILES" != ""; then
 else
   AC_MSG_RESULT(yes)
 fi
+AC_MSG_CHECKING([for URW++ OTF files])
+AC_SUBST(URWOTF_DIR)
+AC_SUBST(URWOTF_FILES)
+if test "$URWOTF_DIR" = ""; then
+  if test "$FCLIST" != ""; then
+    URWOTF_FILE=`$FCLIST "C059:fontformat=CFF" file | head -n 1`
+    if test "$URWOTF_FILE" != ""; then
+      URWOTF_FILE=`echo $URWOTF_FILE | sed 's/\(:.*\)$//g'`
+      URWOTF_FILE=`$PYTHON "$srcdir/scripts/auxiliar/readlink.py" $URWOTF_FILE`
+      URWOTF_DIR=`AS_DIRNAME($URWOTF_FILE)`
+    fi
+  fi
+fi
+if test "$URWOTF_DIR" != "" ;  then
+  for f in C059-BdIta.otf C059-Bold.otf \
+           C059-Italic.otf C059-Roman.otf \
+           NimbusMonoPS-Bold.otf NimbusMonoPS-BoldItalic.otf \
+           NimbusMonoPS-Italic.otf NimbusMonoPS-Regular.otf \
+           NimbusSans-Bold.otf NimbusSans-BoldOblique.otf \
+           NimbusSans-Oblique.otf NimbusSans-Regular.otf; do
+    if test ! -f "$URWOTF_DIR/$f"; then
+      MISSING_URWOTF_FILES="$MISSING_URWOTF_FILES $f"
+    else
+      URWOTF_FILES="$URWOTF_FILES $f"
+    fi
+  done
+fi
+if test "$URWOTF_DIR" = "" -o "$MISSING_URWOTF_FILES" != ""; then
+  AC_MSG_RESULT(no)
+  STEPMAKE_ADD_ENTRY(OPTIONAL,URW++ OTF fonts)
+  if test "$URWOTF_DIR" = ""; then
+    if test "$FCLIST" = ""; then
+      STEPMAKE_ADD_ENTRY(OPTIONAL,'(install the fc-list utility from FontConfig, or use --with-urwotf-dir)')
+    else
+      STEPMAKE_ADD_ENTRY(OPTIONAL,"(download OTF files from 'http://git.ghostscript.com/?p=urw-core35-fonts.git;a=commit;h=79bcdfb34fbce12b592cce389fa7a19da6b5b018' and put them under '~/.local/share/fonts' etc., or use --with-urwotf-dir)")
+    fi
+  else
+    STEPMAKE_ADD_ENTRY(OPTIONAL,'(these files are missing: $MISSING_URWOTF_FILES)')
+  fi
+else
+  AC_MSG_RESULT(yes)
+fi
 
 AC_LANG([C++])
 
index 4860f65f6e61a6203d4b21fa33773a11ce83117c..6a6475965e3e21f9d0be0502a02e19d738b67f41 100644 (file)
@@ -36,6 +36,7 @@ SVG_FILES = $(OTF_FILES:%.otf=%.svg)
 WOFF_FILES = $(OTF_FILES:%.otf=%.woff)
 
 TEXGYRE_OTFS = $(addprefix $(TEXGYRE_DIR)/,$(TEXGYRE_FILES))
+URWOTF_OTFS = $(addprefix $(URWOTF_DIR)/,$(URWOTF_FILES))
 
 LILYPOND_FONTS_CONF = $(outdir)/00-lilypond-fonts.conf \
                      $(outdir)/99-lilypond-fonts.conf
@@ -87,7 +88,8 @@ INSTALLATION_OUT_SUFFIXES = 1 2 3
 
 INSTALLATION_OUT_DIR1 = $(local_lilypond_datadir)/fonts/otf
 INSTALLATION_OUT_FILES1 = $(OTF_FILES) \
-                         $(TEXGYRE_OTFS)
+                         $(TEXGYRE_OTFS) \
+                         $(URWOTF_OTFS)
 
 INSTALLATION_OUT_DIR2 = $(local_lilypond_datadir)/fonts/svg
 INSTALLATION_OUT_FILES2 = $(SVG_FILES) $(WOFF_FILES)