Make font selection be based on the definition of SERIES. The appropiate fontdir...
[project-aon.git] / common / epub / Makefile.common
index eda9023..e133f2a 100644 (file)
@@ -13,6 +13,56 @@ RELXSLDIR := $(AONROOTDIR)/common/xsl
 EPUBSCRIPT := $(RELSCRIPT)/gbtoepub.pl
 COVERIMAGE := $(AONROOTDIR)/$(BLANG)/jpeg/$(SERIES)/$(BASENAME)/skins/ebook/cover.jpg
 
+# -------------------------------- BEGIN FONT SELECTION -----------------------------------------------------------
+# Location of the font files, this is adjustable here in order to make it possible to run
+# the build scripts as not all developers might have the Souvernir fonts.
+
+# Option 1 (to be used for the Lone wolf and Grey star series) - Souvenir font 
+# ---------------------------------------------------------------------------
+# Use this when buidling Lone Wolf books, using Souvenir fonts and make sure
+# the font is available in the directory you configure here.  Note that the
+# fontfiles are *not* available in Project Aon's SVN repository as they are not
+# under a free license. For more information see /common/fonts/README.txt
+#
+# If using this configure, please make sure the following fonts are available in this directory:
+# SouvenirStd-DemiItalic.otf  SouvenirStd-Demi.otf  SouvenirStd-LightItalic.otf  SouvenirStd-Light.otf
+
+ifeq ($(SERIES), lw)
+FONTDIR := $(AONROOTDIR)/../fontfiles/
+endif
+ifeq ($(SERIES), gs)
+FONTDIR := $(AONROOTDIR)/../fontfiles/
+endif
+
+# Option 2 (to be used for Freway Warrior series builds) - Carlito font 
+# ---------------------------------------------------------------------
+# Use this when running builds of the Freeway Warrior series using the Carlito
+# fonts.  This will build the documents using the fonts available in the SVN
+# repository which (at the time of this writting) are the Carlito font, which
+# is distributed with an Open Font license.
+
+ifeq ($(SERIES), fw)
+FONTDIR := $(AONROOTDIR)/common/fonts/
+endif
+# --------------------------------- END FONT SELECTION -----------------------------------------------------------
+
+ifndef FONTDIR
+$(info FONTDIR is not defined,  defauling to AONROOTDIR/common/fonts/)
+FONTDIR := $(AONROOTDIR)/common/fonts/
+endif
+
+# Sanity checks before going further
+ifndef SERIES
+$(error WARNING: Book series is not defined, please define variable 'SERIES')
+endif
+ifndef BLANG
+$(error WARNING: Book language is not defined, please define variable 'BLANG')
+endif
+ifndef BASENAME
+$(error WARNING: Book basic name is not defined, please define variable 'BASENAME')
+endif
+
+
 EPUB=$(BASENAME).epub
 MOBI=$(BASENAME).mobi
 PDB=$(BASENAME).pdb
@@ -40,7 +90,7 @@ XSLFILES=$(RELXSLDIR)/epub-opf-metadata.xsl $(RELXSLDIR)/epub-xhtml.xsl  \
 # Generate the ePub file from the XML file
 epub: $(EPUB)
 $(AONROOTDIR)/$(BLANG)/epub/$(SERIES)/$(BASENAME)/$(EPUB): $(XMLFILE) $(EPUBSCRIPT) $(XSLFILES)
-       cd $(AONROOTDIR) && perl $(EPUBSCRIPT) --language=$(BLANG) --font-files=$(AONROOTDIR)/common/fonts/ $(BASENAME) 
+       cd $(AONROOTDIR) && perl $(EPUBSCRIPT) --language=$(BLANG) --font-files=$(FONTDIR) $(BASENAME) 
 
 $(EPUB): $(AONROOTDIR)/$(BLANG)/epub/$(SERIES)/$(BASENAME)/$(EPUB)
        cp -p $(AONROOTDIR)/$(BLANG)/epub/$(SERIES)/$(BASENAME)/$(EPUB) .