Skip to contentSkip to conversation

Rework font configuration

PATCH New Luca Ceresoli 3 participants 7 messages Jan 22, 2011 – Feb 6, 2011

lore
Share & tools
lore
#0 lore raw

cover Rework font configuration

This small patch series reworks and extends font configuration and installation in buildroot.

The improvements recently discussed with Thomas and Daniel about the font install directory are implemented in patch 2.

Luca

#1 lore raw

PATCH 1/4 Move fonts into a dedicated submenu

---
 package/Config.in                            |    3 ++-
 package/fonts/Config.in                      |    5 +++++
 package/fonts/fonts.mk                       |    1 +
 package/{ => fonts}/liberation/Config.in     |    0
 package/{ => fonts}/liberation/liberation.mk |    0
 5 files changed, 8 insertions(+), 1 deletions(-)
 create mode 100644 package/fonts/Config.in
 create mode 100644 package/fonts/fonts.mk
 rename package/{ => fonts}/liberation/Config.in (100%)
 rename package/{ => fonts}/liberation/liberation.mk (100%)
package/Config.in +2 -1
index 48f245c..3ec9109 100644
@@ -120,8 +120,9 @@ comment "other GUIs"
 source "package/qt/Config.in"
 source "package/x11r7/Config.in"
 
+source package/fonts/Config.in
+
 comment "X libraries and helper libraries"
-source "package/liberation/Config.in"
 source "package/libsexy/Config.in"
 
 comment "X Window managers"
package/fonts/Config.in new file +5 -0
new file mode 100644
index 0000000..61072ad
@@ -0,0 +1,5 @@
+menu "Fonts"
+
+source "package/fonts/liberation/Config.in"
+
+endmenu
package/fonts/fonts.mk new file +1 -0
new file mode 100644
index 0000000..f0447af
@@ -0,0 +1 @@
+include package/fonts/*/*.mk
package/fonts/liberation/Config.in renamed from package/liberation/Config.in +0 -0
similarity index 100%
rename from package/liberation/Config.in
rename to package/fonts/liberation/Config.in
package/fonts/liberation/liberation.mk renamed from package/liberation/liberation.mk +0 -0
similarity index 100%
rename from package/liberation/liberation.mk
rename to package/fonts/liberation/liberation.mk
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/4 Configurable font install layout and directory

In reply to Luca Ceresoli
---
 package/fonts/Config.in                |   33 ++++++++++++++++++++++++++++++++
 package/fonts/liberation/liberation.mk |    9 ++++++-
 2 files changed, 40 insertions(+), 2 deletions(-)
package/fonts/Config.in +33 -0
index 61072ad..11497a5 100644
@@ -1,5 +1,38 @@
 menu "Fonts"
 
+choice
+	prompt "Font install layout"
+	default BR2_FONT_LAYOUT_FLAT if (BR2_PACKAGE_QT || BR2_PACKAGE_FREETYPE)
+	default BR2_FONT_LAYOUT_SUBDIRS
+	help
+	  Select where do you want buildroot to install fonts.
+
+	  Installing fonts in subdirectories is the standard layout, but
+	  some applications and libraries are unable to find fonts that are
+	  installed this way.
+	  If you need such applications or libraries, choose the flat install
+	  layout.
+
+config BR2_FONT_LAYOUT_SUBDIRS
+	bool "In subdirectories"
+	help
+	  Install each font family in a separate subdirectory.
+
+config BR2_FONT_LAYOUT_FLAT
+	bool "Flat"
+	help
+	  Install all fonts in the same directory.
+endchoice
+
+config BR2_FONT_LAYOUT_BASEDIR
+	string "Font install directory"
+	default "/usr/share/fonts"
+	help
+	  Directory where fonts must be installed.
+
+	  Depending on the font install layout chosen, fonts will be installed
+	  here or in a subdirectory for each family.
+
 source "package/fonts/liberation/Config.in"
 
 endmenu
package/fonts/liberation/liberation.mk +7 -2
index 89987d6..6efa54b 100644
@@ -7,7 +7,11 @@ LIBERATION_VERSION = 1.06.0.20100721
 LIBERATION_SITE = http://www.fedorahosted.org/releases/l/i/liberation-fonts
 LIBERATION_SOURCE = liberation-fonts-ttf-$(LIBERATION_VERSION).tar.gz
 
-LIBERATION_TARGET_DIR = $(TARGET_DIR)/usr/share/fonts/liberation
+LIBERATION_TARGET_DIR = $(TARGET_DIR)/$(call qstrip,$(BR2_FONT_LAYOUT_BASEDIR))
+
+ifeq ($(BR2_FONT_LAYOUT_SUBDIRS),y)
+LIBERATION_TARGET_DIR = $(LIBERATION_TARGET_DIR)/liberation
+endif
 
 define LIBERATION_INSTALL_TARGET_CMDS
 	mkdir -p $(LIBERATION_TARGET_DIR)
@@ -15,7 +19,8 @@ define LIBERATION_INSTALL_TARGET_CMDS
 endef
 
 define LIBERATION_CLEAN_CMDS
-	rm -rf $(LIBERATION_TARGET_DIR)
+	rm -rf $(LIBERATION_TARGET_DIR)/Liberation*.ttf
+	rmdir $(LIBERATION_TARGET_DIR) || true # remove dir if empty
 endef
 
 $(eval $(call GENTARGETS,package,liberation))
Signature · 1 line
1.7.1
#3 lore raw

PATCH 3/4 dejavu: add new package

In reply to Luca Ceresoli
---
 package/fonts/Config.in        |    1 +
 package/fonts/dejavu/Config.in |   76 ++++++++++++++++++++++++++++
 package/fonts/dejavu/dejavu.mk |  106 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 183 insertions(+), 0 deletions(-)
 create mode 100644 package/fonts/dejavu/Config.in
 create mode 100644 package/fonts/dejavu/dejavu.mk
package/fonts/Config.in +1 -0
index 11497a5..f07d443 100644
@@ -34,5 +34,6 @@ config BR2_FONT_LAYOUT_BASEDIR
 	  here or in a subdirectory for each family.
 
 source "package/fonts/liberation/Config.in"
+source "package/fonts/dejavu/Config.in"
 
 endmenu
package/fonts/dejavu/Config.in new file +76 -0

76 lines not on this page · raw message

package/fonts/dejavu/dejavu.mk new file +106 -0

106 lines not on this page · raw message

Signature · 1 line
1.7.1
#4 lore raw

PATCH 4/4 qt: optionally skip installation of bundled TrueType fonts

In reply to Luca Ceresoli
---
 package/qt/Config.in |   12 ++++++++++++
 package/qt/qt.mk     |    2 ++
 2 files changed, 14 insertions(+), 0 deletions(-)
package/qt/Config.in +12 -0
index e5fe325..ef37352 100644
@@ -152,6 +152,18 @@ config BR2_PACKAGE_QT_SYSTEMFREETYPE
 	  See http://www.freetype.org/
 endchoice
 
+if !BR2_PACKAGE_QT_NOFREETYPE
+
+config BR2_PACKAGE_QT_BUNDLED_TTF
+	bool "Install TTF fonts bundled with Qt"
+	default y
+	help
+	  Qt is distributed with a selection of opensource TrueType fonts.
+	  Say yes if you want to install those fonts, no if you want to install
+	  a different selection of TrueType fonts.
+
+endif # !BR2_PACKAGE_QT_NOFREETYPE
+
 config BR2_PACKAGE_QT_GIF
 	bool "Enable GIF support"
 	help
package/qt/qt.mk +2 -0
index 6eb31bc..ddee4fa 100644
@@ -545,8 +545,10 @@ ifneq ($(QT_FONTS),)
 	cp -dpf $(QT_FONTS) $(TARGET_DIR)/usr/lib/fonts
 endif
 ifneq ($(BR2_PACKAGE_QT_NOFREETYPE),y)
+ifeq ($(BR2_PACKAGE_QT_BUNDLED_TTF),y)
 	cp -dpf $(STAGING_DIR)/usr/lib/fonts/*.ttf $(TARGET_DIR)/usr/lib/fonts
 endif
+endif
 	# Install image plugins if they are built
 	$(call QT_INSTALL_PLUGINS,imageformats)
 ifeq ($(BR2_PACKAGE_QT_SHARED),y)
Signature · 1 line
1.7.1
#5 lore raw

cover Rework font configuration

In reply to Luca Ceresoli

Hi all,

Quoted 8 lines · Luca Ceresoli

This small patch series reworks and extends font configuration and installation in buildroot.

The improvements recently discussed with Thomas and Daniel about the font install directory are implemented in patch 2.

Luca

I haven't received any comments about this patchset.
Given it was the result of a discussion in the ml, I suppose it has just not been noticed, rather than being not interesting.

A general question: is sending a patchset to the ml the correct way to propose an improvement, or should I also add an entry in the bug tracker?

Thanks,
Luca

#6 lore raw

cover Rework font configuration

Den 6 februari 2011 16:13 skrev Luca Ceresoli <[email protected]>:

Quoted 4 lines

Luca Ceresoli wrote:
I haven't received any comments about this patchset.
Given it was the result of a discussion in the ml, I suppose it has just not been noticed, rather than being not interesting.

I was going to test it as and hopefully give it my Signed-of-by as soon as I'm done with my current project at work, but too bad it has been delayed and I'm working very hard with it right now. Hopefully I will be able to test it within the following weeks.

Quoted 2 lines

A general question: is sending a patchset to the ml the correct way to propose an improvement, or should I also add an entry in the bug tracker?

Send to this ML is definitely the right way to contribute. I guess what Peter is waiting for is some thumbs-up from people relaying on the fonts. He's also doing all BR maintenance on his spare time so he might as well just not have had time to look into it yet.