Skip to content

Commit

Permalink
Make build framework more standalone.
Browse files Browse the repository at this point in the history
  • Loading branch information
petterreinholdtsen committed Jul 9, 2012
1 parent 86ad16c commit 199ab50
Show file tree
Hide file tree
Showing 5 changed files with 161 additions and 8 deletions.
9 changes: 2 additions & 7 deletions Makefile
Expand Up @@ -13,17 +13,12 @@ name = freeculture
DEBIAN_EDU_DOC_TITLE=Free Culture
export

#include ../common/Makefile.common

DBLATEX = dblatex -T db2latex --backend=xetex --xsl-user=../common/user_param.xsl --xsl-user=../common/xetex_param.xsl -p ../common/pdf.xsl --param=lingua=zh-tw
DBLATEX = dblatex -T db2latex --backend=xetex --xsl-user=data/user_param.xsl --xsl-user=data/xetex_param.xsl -p data/pdf.xsl --param=lingua=nb

all: pdf

update-translation: freeculture.pot
freeculture.nb.po: freeculture.pot
po4a --no-translations --msgmerge-opt --no-location po4a.cfg
msgcat --no-location -o $(name).pot $(name).pot

freeculture.nb.po: update-translation

freeculture.nb.xml: freeculture.nb.po freeculture.xml
po4a --translate-only freeculture.nb.xml po4a.cfg
Expand Down
20 changes: 20 additions & 0 deletions data/pdf.xsl
@@ -0,0 +1,20 @@
<?xml version='1.0' encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>

<!-- The TOC links in the titles, and in blue. -->
<xsl:param name="latex.hyperparam">linktocpage,colorlinks,linkcolor=blue,pdfstartview=FitH</xsl:param>
<xsl:param name="callout.linkends.hot">0</xsl:param>

<!-- Put the dblatex logo -->
<!-- xsl:param name="doc.publisher.show">1</xsl:param -->

<!-- List the examples and equations too, no tables -->
<xsl:param name="doc.lot.show">figure,example</xsl:param>

<xsl:param name="imagedata.default.scale">maxwidth=15.5cm,maxheight=12cm</xsl:param>
<xsl:param name="draft.mode">no</xsl:param>
<xsl:param name="draft.watermark">0</xsl:param>
<xsl:param name="doc.collab.show">0</xsl:param>


</xsl:stylesheet>
21 changes: 21 additions & 0 deletions data/user_param.xsl
@@ -0,0 +1,21 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>

<!--############################################################################
XSLT Stylesheet DocBook -> LaTeX
############################################################################ -->

<xsl:param name="draft.mode">maybe</xsl:param>
<xsl:param name="glossterm.auto.link">1</xsl:param>
<xsl:param name="latex.encoding">utf8</xsl:param>
<xsl:param name="latex.unicode.use">1</xsl:param>
<xsl:param name="monoseq.hyphenation">nohyphen</xsl:param>
<xsl:template match="book|article" mode="docinfo">
<!-- Apply default settings -->
<xsl:apply-imports/>
<!--
<xsl:text>\input{</xsl:text>po4a/hyphenation.<xsl:value-of select="$lingua"/><xsl:text>.tex}</xsl:text>
-->
</xsl:template>
</xsl:stylesheet>

117 changes: 117 additions & 0 deletions data/xetex_param.xsl
@@ -0,0 +1,117 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
<!-- vim: set sts=2 ai expandtab: -->

<!--############################################################################
XSLT Stylesheet DocBook -> LaTeX
############################################################################ -->

<xsl:param name="xetex.font">
<!-- Western centric Adobe PostScript looks-alike: gsfonts -->
<xsl:text>\setmainfont{Nimbus Roman No9 L}&#10;</xsl:text>
<xsl:text>\setsansfont{Nimbus Sans L}&#10;</xsl:text>
<xsl:text>\setmonofont{Nimbus Mono L}&#10;</xsl:text>
<xsl:text>\usepackage{xeCJK}&#10;</xsl:text>
<xsl:choose>
<xsl:when test="$lingua = 'zh-cn'">
<!-- zh_CN centric: ttf-arphic-gbsn00lp, ttf-wqy-zenhei -->
<xsl:text>\setCJKmainfont{AR PL SungtiL GB}&#10;</xsl:text>
<xsl:text>\setCJKsansfont{WenQuanYi Zen Hei}&#10;</xsl:text>
<xsl:text>\setCJKmonofont{WenQuanYi Zen Hei Mono}&#10;</xsl:text>
</xsl:when>
<xsl:when test="$lingua = 'zh-tw'">
<!-- zh_TW centric: ttf-arphic-bsmi00lp, ttf-wqy-zenhei -->
<xsl:text>\setCJKmainfont{AR PL Mingti2L Big5}&#10;</xsl:text>
<xsl:text>\setCJKsansfont{WenQuanYi Zen Hei}&#10;</xsl:text>
<xsl:text>\setCJKmonofont{WenQuanYi Zen Hei Mono}&#10;</xsl:text>
</xsl:when>
<xsl:when test="$lingua = 'ja'">
<!-- ja centric: otf-ipafont-mincho otf-ipafont-gothic -->
<xsl:text>\setCJKmainfont{IPAMincho}&#10;</xsl:text>
<xsl:text>\setCJKsansfont{IPAPGothic}&#10;</xsl:text>
<xsl:text>\setCJKmonofont{IPAGothic}&#10;</xsl:text>
</xsl:when>
<xsl:when test="$lingua = 'ko'">
<!-- ko centric: ttf-unfonts-core -->
<xsl:text>\setCJKmainfont{UnBatang}&#10;</xsl:text>
<xsl:text>\setCJKsansfont{UnDotum}&#10;</xsl:text>
<xsl:text>\setCJKmonofont{UnDotum}&#10;</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:param>

</xsl:stylesheet>

<!--
= Asian font basics =
== Sanserif ==
simplified Chinese: 黑体 hēi tǐ
ttf-wqy-zenhei (zh_CN centric)
WenQuanYi Zen Hei,文泉驛正黑,文泉驿正黑
WenQuanYi Zen Hei Sharp,文泉驛點陣正黑,文泉驿点阵正黑
WenQuanYi Zen Hei Mono,文泉驛等寬正黑,文泉驿等宽正黑
traditional Chinese: 黑體 hēi tǐ
Japanese: ゴシック kaku goshikku, gothic
otf-ipafont-gothic (ja centric)
IPAGothic,IPAゴシック
IPAPGothic,IPA Pゴシック
== Serif ==
中国大陆一般称:宋体;台湾香港一般称:明體
simplified Chinese: 宋体/(明体), Sòngtǐ
ttf-arphic-gbsn00lp (zh_CN centric)
AR PL SungtiL GB
traditional Chinese: (宋體)/明體, Sòngtǐ
ttf-arphic-bsmi00lp (zh_TW centric)
AR PL Mingti2L Big5
(Missing some character in output...)
ttf-arphic-uming (zh_TW centric)
AR PL UMing
= "AR PL Mingti2L Big5" and "AR PL SungtiL GB" + extra in Taiwan-style
(BUild failure happened thus not used)
Japanese: 明朝体, Minchōtai
otf-ipafont-mincho (ja centric)
IPAMincho,IPA明朝:style=Regular
IPAPMincho,IPA P明朝:style=Regular
Korean: Hangul: 명조체; Hanja: 明朝體; Revised Romanization: Myeongjoche
== Script () ==
simplified Chinese: 楷书; kǎishū
ttf-arphic-gkai00mp (zh_CN centric)
AR PL KaitiM GB
traditional Chinese: 楷書; kǎishū
ttf-arphic-bkai00mp (zh_TW centric)
AR PL KaitiM Big5
ttf-arphic-ukai (zh_TW centric)
AR PL UKai
= AR PL KaitiM Big5" + "AR PL KaitiM GB" + extra in Taiwan-style
Japanese: 楷書, kaisho (教科書体)
Korean:
ttf-baekmuk 1st most popular which contains 4 font families.
latex-cjk-xcjk suggest this
/usr/share/fonts/truetype/baekmuk/dotum.ttf
/usr/share/fonts/truetype/baekmuk/hline.ttf
/usr/share/fonts/truetype/baekmuk/gulim.ttf
/usr/share/fonts/truetype/baekmuk/batang.ttf
Baekmuk Batang,백묵 바탕:style=Regular ... serif
Baekmuk Dotum,백묵 돋움:style=Regular ... san-serif medium (print?)
Baekmuk Gulim,백묵 굴림:style=Regular ... san-serif thin (screen?)
Baekmuk Headline,백묵 헤드라인:style=Regular ... bold san-serif (best screen small)
ttf-unfonts-core 2nd popular and increasing
made from the HLaTeX's PostScript fonts
UnBatang, UnDotum, Ungraphic, Unpilgi, and UnGungseo
UnBatang ... serif
UnDotum ... san-serif
UnGungseo ... Kai/kaisho
latex-cjk-xcjk uses UnBatang as example
ttf-alee 3rd most popular many fonts by alee
ttf-nanum Myeongjo and Gothic Korean font families/screen font
ttf-nanum-coding Korean fixed width font family
encoding names:
* GB2312, GBK or GB18030: Simplified Chinese
* Big5: Traditional Chinese
-->

2 changes: 1 addition & 1 deletion po4a.cfg
@@ -1,4 +1,4 @@
[po_directory] .

[type: docbook] freeculture.xml $lang:$lang.xml \
opt:"-o untranslated='<listitem>' -M UTF-8 -k 5"
opt:"-o untranslated='<listitem>' -M UTF-8 -k 1"

0 comments on commit 199ab50

Please sign in to comment.