<project name="fop.docbook" basedir="." default="all">
	<!--
	===========================================================================
	==
	== Apache FOP フォント定義 ビルドファイル
	==
	== 目的:日本語フォントはデフォルトで登録されていないので、
	==      フォント定義ファイルの作成などの処理を行う。
	==
	== copyright (c) exacteye.com allright reserved.
	==
	===========================================================================
	-->
	<property environment="env"/>
	<property name="font.path" value="${env.SystemRoot}/fonts"/>
	<property name="lib.dir" value="${basedir}/lib"/>
	<property name="fop.home" value="${basedir}/fop-0.20.5"/>
	<property name="fop.conf.dir" value="${fop.home}/conf"/>
	
	<path id="fop.class.path">
		<pathelement location="${fop.home}/build/fop.jar"/>
		<pathelement location="${fop.home}/lib/xercesImpl-2.2.1.jar"/>
		<pathelement location="${lib.dir}/xalan.jar"/>
		<!--
		このjar ファイルのバージョンが古かったのでFileNotExceptionが
		発生していた。
		<pathelement location="${fop.home}/lib/xalan-2.4.1.jar"/>
		-->
	</path>

	<target name="all">
		<!--
		<antcall target="getMinchoFontName"/>
		<antcall target="getGothicFontName"/>
		-->
		<antcall target="confMSGothic"/>
		<antcall target="confMSPGothic"/>
		<antcall target="confMSUIGothic"/>
		<antcall target="confMSMincho"/>
		<antcall target="confMSPMincho"/>
		
	</target>

	<!-- MS ゴシック体 -->
	<target name="confMSGothic">
		<java
			classname="org.apache.fop.fonts.apps.TTFReader">
			<arg line="-ttcname &quot;MS Gothic&quot; ${font.path}/msgothic.ttc ${fop.conf.dir}/msgothic.xml"/>
			<classpath refid="fop.class.path"/>
		</java>
	</target>

	<!-- MS Pゴシック体 -->
	<target name="confMSPGothic">
		<java
			classname="org.apache.fop.fonts.apps.TTFReader">
			<arg line="-ttcname &quot;MS PGothic&quot; ${font.path}/msgothic.ttc ${fop.conf.dir}/mspgothic.xml"/>
			<classpath refid="fop.class.path"/>
		</java>
	</target>

	<!-- MS UI ゴシック体 -->
	<target name="confMSUIGothic">
		<java
			classname="org.apache.fop.fonts.apps.TTFReader">
			<arg line="-ttcname &quot;MS UI Gothic&quot; ${font.path}/msgothic.ttc ${fop.conf.dir}/msuigothic.xml"/>
			<classpath refid="fop.class.path"/>
		</java>
	</target>
	
	<!-- MS 明朝体 -->
	<target name="confMSMincho">
		<java
			classname="org.apache.fop.fonts.apps.TTFReader">
			<arg line="-ttcname &quot;MS Mincho&quot; ${font.path}/msmincho.ttc ${fop.conf.dir}/msmincho.xml"/>
			<classpath refid="fop.class.path"/>
		</java>
	</target>

	<!-- MS P明朝体-->
	<target name="confMSPMincho">
		<java
			classname="org.apache.fop.fonts.apps.TTFReader">
			<arg line="-ttcname &quot;MS PMincho&quot; ${font.path}/msmincho.ttc ${fop.conf.dir}/mspmincho.xml"/>
			<classpath refid="fop.class.path"/>
		</java>
	</target>
	
	<!--
	=====================================================================
	==
	== わざとエラーを出しTTCファイルに含まれるフォント名を判別する
	== 調査用
	==
	=====================================================================
	-->
	<!-- ＭＳ明朝体 -->
	<target name="getMinchoFontName">
		<echo message="-------------------------------------------------"/>
		<echo message="msmicho.ttcに含まれるフォント名の確認"/>
		<echo message="-------------------------------------------------"/>
		<java 
			classname="org.apache.fop.fonts.apps.TTFReader"
			args="${font.path}/msmincho.ttc test.xml" 
			>
			<classpath refid="fop.class.path"/>			
		</java>		
	</target>

	<!-- ＭＳゴシック体 -->
	<target name="getGothicFontName">
		<echo message="-------------------------------------------------"/>
		<echo message="msgothic.ttcに含まれるフォント名の確認"/>
		<echo message="-------------------------------------------------"/>
		<java 
			classname="org.apache.fop.fonts.apps.TTFReader"
			args="${font.path}/msgothic.ttc test.xml" 
			>
			<classpath refid="fop.class.path"/>			
		</java>		
	</target>


</project>
