From: Masamichi Hosoda Date: Fri, 28 Oct 2016 13:53:25 +0000 (+0900) Subject: Issue 4991: Add installing optional URW++ fonts X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=855e8e36a0c75aa75076fabe19aa292a6902ec96;p=lilypond.git Issue 4991: Add installing optional URW++ fonts 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 --- diff --git a/GNUmakefile.in b/GNUmakefile.in index abc7ecaf6a..76f4515be9 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -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 . && \ diff --git a/config.make.in b/config.make.in index c681d76199..d376a59f48 100644 --- a/config.make.in +++ b/config.make.in @@ -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 diff --git a/configure.ac b/configure.ac index d341125c21..19ffd18bf3 100644 --- a/configure.ac +++ b/configure.ac @@ -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++]) diff --git a/mf/GNUmakefile b/mf/GNUmakefile index 4860f65f6e..6a6475965e 100644 --- a/mf/GNUmakefile +++ b/mf/GNUmakefile @@ -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)