Attached Files |
0001-Use-more-sources-to-locate-font-files.patch [^] (2,357 bytes) 2013-06-26 09:43 [Show Content] [Hide Content]From 8d15504c8f53a6a52790795a25f98a8f9bfaead4 Mon Sep 17 00:00:00 2001
From: Akinori MUSHA <knu@idaemons.org>
Date: Wed, 10 Oct 2012 21:19:35 +0900
Subject: [PATCH] Use more sources to locate font files.
Use fontconfig if available and search /usr/*/lib/X11/fonts also.
This adds support for a wider range of operating systems including
*BSD.
---
crawl-ref/source/Makefile | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/crawl-ref/source/Makefile b/crawl-ref/source/Makefile
index 9268503..a75810e 100644
--- a/crawl-ref/source/Makefile
+++ b/crawl-ref/source/Makefile
@@ -863,10 +863,12 @@ ifdef PROPORTIONAL_FONT
INSTALL_FONTS += $(PROPORTIONAL_FONT)
endif
else
- SYS_PROPORTIONAL_FONT = $(shell dir=/usr/share/fonts; [ -d $$dir ] && find $$dir -iname $(OUR_PROPORTIONAL_FONT)|head -n 1)
- ifeq (,$(SYS_PROPORTIONAL_FONT))
- SYS_PROPORTIONAL_FONT = $(shell dir=/usr/local/share/fonts ; [ -d $$dir ] && find $$dir -iname $(OUR_PROPORTIONAL_FONT)|head -n 1)
- endif
+ SYS_PROPORTIONAL_FONT = $(shell name=$(OUR_PROPORTIONAL_FONT);\
+ {\
+ fc-list | sed 's/: .*//' | grep -Fi "/$$name";\
+ for dir in /usr/share/fonts /usr/local/share/fonts /usr/*/lib/X11/fonts;\
+ do [ -d $$dir ] && echo $$dir; done;\
+ } 2>/dev/null | xargs -I% find % -type f -iname $$name -print | head -n1)
ifneq (,$(SYS_PROPORTIONAL_FONT))
ifeq (,$(COPY_FONTS))
DEFINES += -DPROPORTIONAL_FONT=\"$(SYS_PROPORTIONAL_FONT)\"
@@ -886,10 +888,12 @@ ifdef MONOSPACED_FONT
INSTALL_FONTS += $(MONOSPACED_FONT)
endif
else
- SYS_MONOSPACED_FONT = $(shell dir=/usr/share/fonts; [ -d $$dir ] && find $$dir -iname $(OUR_MONOSPACED_FONT)|head -n 1)
- ifeq (,$(SYS_MONOSPACED_FONT))
- SYS_MONOSPACED_FONT = $(shell dir=/usr/local/share/fonts; [ -d $$dir ] && find $$dir -iname $(OUR_MONOSPACED_FONT)|head -n 1)
- endif
+ SYS_MONOSPACED_FONT = $(shell name=$(OUR_MONOSPACED_FONT);\
+ {\
+ fc-list | sed 's/: .*//' | grep -Fi "/$$name";\
+ for dir in /usr/share/fonts /usr/local/share/fonts /usr/*/lib/X11/fonts;\
+ do [ -d $$dir ] && echo $$dir; done;\
+ } 2>/dev/null | xargs -I% find % -type f -iname $$name -print | head -n1)
ifneq (,$(SYS_MONOSPACED_FONT))
ifeq (,$(COPY_FONTS))
DEFINES += -DMONOSPACED_FONT=\"$(SYS_MONOSPACED_FONT)\"
--
1.8.3.1
|