summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorप्रविण सातपुते <psatpute@redhat.com>2012-03-15 14:04:23 (GMT)
committerप्रविण सातपुते <psatpute@redhat.com>2012-03-15 14:04:23 (GMT)
commit5c6d3b6801acd8999d50a7ebe16c1db3e52f6833 (patch)
treee18e2c2eeb52eb5662584d56a31482018d4801fa
parent86fda57f244623f4df5cc193ff1b8fbce4ee56a6 (diff)
downloadliberation-fonts-5c6d3b6801acd8999d50a7ebe16c1db3e52f6833.zip
liberation-fonts-5c6d3b6801acd8999d50a7ebe16c1db3e52f6833.tar.gz
liberation-fonts-5c6d3b6801acd8999d50a7ebe16c1db3e52f6833.tar.xz
Makefile restructure and support for web font format
-rw-r--r--README82
-rw-r--r--releases/liberation-fonts-0.1.tar.gzbin641432 -> 0 bytes
-rw-r--r--releases/liberation-fonts-0.2.tar.gzbin648223 -> 0 bytes
-rw-r--r--releases/liberation-fonts-1.0.tar.gzbin1164646 -> 0 bytes
-rw-r--r--releases/liberation-fonts-1.02.tar.gzbin1164857 -> 0 bytes
-rw-r--r--releases/liberation-fonts-1.03.tar.gzbin1165152 -> 0 bytes
-rw-r--r--releases/liberation-fonts-1.04.tar.gzbin1011820 -> 0 bytes
-rw-r--r--releases/liberation-fonts-1.05.3.20100510.tar.gzbin2908870 -> 0 bytes
-rw-r--r--releases/liberation-fonts-1.05.tar.gzbin2254706 -> 0 bytes
-rw-r--r--source/ChangeLog1
-rw-r--r--source/Makefile147
-rw-r--r--source/scripts/fontexport.pe21
12 files changed, 135 insertions, 116 deletions
diff --git a/README b/README
deleted file mode 100644
index 89acc9f..0000000
--- a/README
+++ /dev/null
@@ -1,82 +0,0 @@
- 1. What's this?
- =================
-
- The Liberation Fonts is font collection which aims to provide document
- layout compatibility as usage of Times New Roman, Arial, Courier New.
-
-
- 2. Requirements
- =================
-
- * fontforge is installed.
- (http://fontforge.sourceforge.net)
-
-
- 3. Install
- ============
-
- 3.1 Decompress tarball
-
- You can extract the files by following command:
-
- $ tar zxvf liberation-fonts-[VERSION].tar.gz
-
- 3.2 Build from the source
-
- Change into directory liberation-fonts-[VERSION]/ and build from sources by
- following commands:
-
- $ cd liberation-fonts-[VERSION]
- $ make
-
- The built font files will be available in 'build' directory.
-
- 3.3 Install to system
-
- For Fedora, you could manually install the fonts by copying the TTFs to
- ~/.fonts for user wide usage, or to /usr/share/fonts/truetype/liberation
- for system-wide availability. Then, run "fc-cache" to let that cached.
-
- For other distributions, please check out corresponding documentation.
-
-
- 4. Usage
- ==========
-
- Simply select preferred liberation font in applications and start using.
-
-
- 5. License
- ============
-
- This font set had been released under GNU Public License version 2
- ("GPLv2") with exceptions.
-
- Please read file "COPYING" for GPLv2 license.
-
- Please read file "License.txt" for details of exceptions.
-
-
- 6. For Maintainers
- ====================
-
- Before packaging a new release based on a new source tarball, you have to
- update the version suffix in the Makefile:
-
- VER = [VERSION]
-
- Make sure that the defined version corresponds to the font software metadata
- which you can check with ftinfo/otfinfo or fontforge itself. It is highly
- recommended that file 'ChangeLog' is updated to reflect changes.
-
- Create a tarball with the following command:
-
- $ make dist
-
- The new versioned tarball will be available in the dist/ folder as
- 'liberation-fonts-[NEW_VERSION].tar.gz'.
-
- 7. Credits
- ============
-
- Please read file "AUTHORS" for list of contributors.
diff --git a/releases/liberation-fonts-0.1.tar.gz b/releases/liberation-fonts-0.1.tar.gz
deleted file mode 100644
index 53bcc8c..0000000
--- a/releases/liberation-fonts-0.1.tar.gz
+++ /dev/null
Binary files differ
diff --git a/releases/liberation-fonts-0.2.tar.gz b/releases/liberation-fonts-0.2.tar.gz
deleted file mode 100644
index a90b48d..0000000
--- a/releases/liberation-fonts-0.2.tar.gz
+++ /dev/null
Binary files differ
diff --git a/releases/liberation-fonts-1.0.tar.gz b/releases/liberation-fonts-1.0.tar.gz
deleted file mode 100644
index 4fa4a15..0000000
--- a/releases/liberation-fonts-1.0.tar.gz
+++ /dev/null
Binary files differ
diff --git a/releases/liberation-fonts-1.02.tar.gz b/releases/liberation-fonts-1.02.tar.gz
deleted file mode 100644
index f2e8646..0000000
--- a/releases/liberation-fonts-1.02.tar.gz
+++ /dev/null
Binary files differ
diff --git a/releases/liberation-fonts-1.03.tar.gz b/releases/liberation-fonts-1.03.tar.gz
deleted file mode 100644
index 4dd7a6d..0000000
--- a/releases/liberation-fonts-1.03.tar.gz
+++ /dev/null
Binary files differ
diff --git a/releases/liberation-fonts-1.04.tar.gz b/releases/liberation-fonts-1.04.tar.gz
deleted file mode 100644
index a30fd91..0000000
--- a/releases/liberation-fonts-1.04.tar.gz
+++ /dev/null
Binary files differ
diff --git a/releases/liberation-fonts-1.05.3.20100510.tar.gz b/releases/liberation-fonts-1.05.3.20100510.tar.gz
deleted file mode 100644
index cf7d49a..0000000
--- a/releases/liberation-fonts-1.05.3.20100510.tar.gz
+++ /dev/null
Binary files differ
diff --git a/releases/liberation-fonts-1.05.tar.gz b/releases/liberation-fonts-1.05.tar.gz
deleted file mode 100644
index 5522c1d..0000000
--- a/releases/liberation-fonts-1.05.tar.gz
+++ /dev/null
Binary files differ
diff --git a/source/ChangeLog b/source/ChangeLog
index 9666d0d..ea36ef5 100644
--- a/source/ChangeLog
+++ b/source/ChangeLog
@@ -1,5 +1,6 @@
- corrected shape of U+040D #799384
+- Makefile restructure patch from Jan Pokorny <jpokorny@redhat.com>
* Thu Feb 09 2012 Pravin Satpute <psatpute@redhat.com> 1.07.2
- removed hint instruction from LiberationMono-Italic cent sing, rhbz #753572
diff --git a/source/Makefile b/source/Makefile
index f80020b..544a1ae 100644
--- a/source/Makefile
+++ b/source/Makefile
@@ -1,41 +1,120 @@
-VER = 1.07.2
-#VER = 1.06.0.$(shell date +%Y%m%d)
-FONTFORGE = fontforge
+# common targets:
+# <no target>, build, ttf-dir: create dedicated dir with TTF files
+# ttf: create export dir with TTF files, track changes
+# 4web: dtto for TTF, WOFF, SVG, and EOT
-TMPDIR := $(shell mktemp -d)
-SFDFILES := src/LiberationMono-Bold.sfd src/LiberationMono-BoldItalic.sfd src/LiberationMono-Italic.sfd src/LiberationMono-Regular.sfd src/LiberationSans-Bold.sfd src/LiberationSans-BoldItalic.sfd src/LiberationSans-Italic.sfd src/LiberationSans-Regular.sfd src/LiberationSerif-Bold.sfd src/LiberationSerif-BoldItalic.sfd src/LiberationSerif-Italic.sfd src/LiberationSerif-Regular.sfd src/LiberationSansNarrow-Regular.sfd src/LiberationSansNarrow-Bold.sfd src/LiberationSansNarrow-Italic.sfd src/LiberationSansNarrow-BoldItalic.sfd
-SCRIPTS := scripts/sfd2ttf.pe scripts/ttf2sfd.pe
-MISCFILES := AUTHORS ChangeLog COPYING License.txt README TODO
+FONTFORGE = fontforge
+FONTLINT = fontlint
-all: build
+# TTF->EOT converters in fallback order
+# the first one is canonical choice used in the release process
+MKEOT = mkeot
+# URLs to be used for root string within EOT file;
+# defaults to "libre roots" that allow usage on any common web page
+MKEOT_URLS = http:// https:// file://
+TTF2EOT = ttf2eot
+ifneq ($(strip $(shell which $(MKEOT) 2>/dev/null)),)
+ make_eot = $(MKEOT) $(1) $(MKEOT_URLS) > $(2)
+else
+ ifneq ($(strip $(shell which $(TTF2EOT) 2>/dev/null)),)
+ make_eot = $(TTF2EOT) $(1) > $(2)
+ else
+ make_eot = $(error No tool for TTF->EOT conversion: $(MKEOT), $(TTF2EOT))
+ endif
+endif
-build:
- $(foreach sfdfile, $(SFDFILES), $(FONTFORGE) -script ./scripts/sfd2ttf.pe $(sfdfile);)
- mkdir -p liberation-fonts-ttf-$(VER)/
- mv src/*.ttf liberation-fonts-ttf-$(VER)/
+EXPORTSCRIPT = scripts/fontexport.pe
+SCRIPTS = $(EXPORTSCRIPT) scripts/sfd2ttf.pe scripts/ttf2sfd.pe
+MISCFILES = AUTHORS ChangeLog COPYING License.txt README TODO
+SRCDIR = src
+EXPORTDIR = export
+CHECK_PREFIX = check
-dist: dist-sfd dist-ttf
+VER = 1.07.2
+NAME = Liberation
+VARIANTS = \
+ Mono-Regular Mono-Bold Mono-Italic Mono-BoldItalic \
+ Sans-Regular Sans-Bold Sans-Italic Sans-BoldItalic \
+ Serif-Regular Serif-Bold Serif-Italic Serif-BoldItalic \
+ SansNarrow-Regular SansNarrow-Bold SansNarrow-Italic SansNarrow-BoldItalic
+DISTPREFIX := liberation-fonts-$(VER)
+DISTPREFIX_TTF := liberation-fonts-ttf-$(VER)
+SFDFILES := $(addprefix $(SRCDIR)/$(NAME), $(VARIANTS:=.sfd))
+TTFFILES := $(addprefix $(EXPORTDIR)/$(NAME), $(VARIANTS:=.ttf))
+
+# keeping backward compatibility for "build"
+all build: ttf-dir
+
+$(EXPORTDIR):
+ mkdir -p $@
+
+# TrueType/OpenType Font, general usage
+# - ttf cares about source file changes, using shared EXPORTDIR
+# - ttf-dir should be a bit more efficient, creating dedicated dir for TTF
+FORMATS = ttf
+ttf-dir:: $(SFDFILES)
+ $(FONTFORGE) -script $(EXPORTSCRIPT) -ttf $^
+ mkdir -p $(DISTPREFIX_TTF)
+ mv $(addsuffix .ttf,$(basename $^)) $(DISTPREFIX_TTF)
+
+# web sites usage
+# Web Open Font Format (WOFF); for all modern browsers (W3C recommendation)
+FORMATS += woff
+# SVG Font; only for WebKit and Presto based browsers (Firefox "avoids" it)
+FORMATS += svg
+# Embedded OpenType (EOT); MSIE only [extra recipe, FontForge can't create EOT]
+FORMATS += eot
+eot:: $(addprefix $(EXPORTDIR)/$(NAME), $(VARIANTS:=.eot))
+ @echo
+$(EXPORTDIR)/%.eot: $(EXPORTDIR)/%.ttf | $(EXPORTDIR)
+ $(call make_eot,$<,$@)
+4web: ttf woff svg eot
+
+# XXX: declare other formats here if needed (TeX, etc.)
+
+# default for formats without extra recipes defined above (e.g., not "eot"):
+# summary per-format target + single file export for these declared formats
+define FORMAT_template =
+$(1):: $$(addprefix $$(EXPORTDIR)/$$(NAME), $$(VARIANTS:=.$(1)))
+ @echo
+$$(EXPORTDIR)/%.$(1):: $$(SRCDIR)/%.sfd | $$(EXPORTDIR)
+ $$(FONTFORGE) -script $$(EXPORTSCRIPT) -$$(lastword $$(subst ., ,$$@)) $$< 2>/dev/null
+ mv $$(SRCDIR)/$$(notdir $$@) $$(EXPORTDIR)
+endef
+$(foreach format,$(FORMATS),$(eval $(call FORMAT_template,$(format))))
+
+dist: clean-dist dist-sfd dist-ttf
dist-src: dist-sfd
-dist-sfd:
- mkdir -p $(TMPDIR)/liberation-fonts-$(VER)/{src,scripts}
- cp ../README ./
- cp Makefile $(MISCFILES) $(TMPDIR)/liberation-fonts-$(VER)/
- cp $(SFDFILES) $(TMPDIR)/liberation-fonts-$(VER)/src/
- cp $(SCRIPTS) $(TMPDIR)/liberation-fonts-$(VER)/scripts/
- tar Cczvf $(TMPDIR)/ liberation-fonts-$(VER).tar.gz \
- liberation-fonts-$(VER)/
-
-dist-ttf: clean-ttf build
- cp $(MISCFILES) liberation-fonts-ttf-$(VER)/
- tar czvf liberation-fonts-ttf-$(VER).tar.gz liberation-fonts-ttf-$(VER)/
-# zip -j liberation-fonts-ttf-$(VER).zip liberation-fonts-ttf-$(VER)/*
- rm -rf liberation-fonts-ttf-$(VER)
-clean: clean-ttf clean-src
-
-clean-ttf:
- rm -rf liberation-fonts-*
-
-clean-src:
- rm -f *.tar.gz
+dist-sfd:: $(SFDFILES)
+ tempdir=$$(mktemp -d) \
+ && mkdir -p $${tempdir}/$(DISTPREFIX)/{src,scripts} \
+ && cp Makefile $(MISCFILES) $${tempdir}/$(DISTPREFIX) \
+ && cp $(SFDFILES) $${tempdir}/$(DISTPREFIX)/src \
+ && cp $(SCRIPTS) $${tempdir}/$(DISTPREFIX)/scripts \
+ && tar Cczvhf $${tempdir} $(DISTPREFIX).tar.gz $(DISTPREFIX) \
+ || echo 'Problem encountered ($@)'; rm -rf -- $${tempdir}
+dist-ttf: ttf
+ tempdir=$$(mktemp -d) \
+ && mkdir -p $${tempdir}/$(DISTPREFIX_TTF) \
+ && cp $(MISCFILES) $(TTFFILES) $${tempdir}/$(DISTPREFIX_TTF) \
+ && tar Cczvhf $${tempdir} $(DISTPREFIX_TTF).tar.gz $(DISTPREFIX_TTF) \
+ || echo 'Problem encountered ($@)'; rm -rf -- $${tempdir}
+# substitute tar line with this if needed:
+# && zip -j $(DISTPREFIX_TTF).zip $(MISCFILES) $(TTFFILES) \
+
+check:
+ log="$(CHECK_PREFIX)_$$(git describe --dirty --always 2>/dev/null||date +%Y%m%d)" \
+ && for sfd in $(SFDFILES); do \
+ $(FONTLINT) $${sfd} 2>/dev/null | tee -a $${log}; echo; \
+ done
+
+clean: clean-dist
+ rm -rf -- $(DISTPREFIX)* $(DISTPREFIX_TTF)*
+ rm -rf -- $(EXPORTDIR)
+ rm -f -- $(CHECK_PREFIX)_*
+clean-dist:
+ rm -f -- *.tar.gz *.zip
+
+.PHONY: all build ttf-dir ttf dist dist-src dist-sfd dist-ttf 4web $(FORMATS) check clean clean-dist
diff --git a/source/scripts/fontexport.pe b/source/scripts/fontexport.pe
new file mode 100644
index 0000000..343f808
--- /dev/null
+++ b/source/scripts/fontexport.pe
@@ -0,0 +1,21 @@
+# FontForge script to export font file(s) in selectable format
+# TODO: 0x800 fmflags only for TTF?
+
+if ($argc <= 1)
+ Print("usage: script [-<format>] file1 ...")
+ Print("(default format is ttf)")
+ return(1)
+endif
+
+format = "ttf"
+if (Strstr($1, "-") == 0)
+ format = Strsub($1, 1)
+ shift
+endif
+while ($argc > 1)
+ Print("Generating " + format + " from " + $1)
+ Open($1)
+ Generate($1:r + "." + format, "", 0x800)
+ Close()
+ shift
+endloop