トップページphp
169コメント60KB

XML+XSLTの切り札Cocoonについて語ろう!

■ このスレッドは過去ログ倉庫に格納されています
0001nobodyさん02/10/22 23:25ID:3vYtKYtk
ないようなので作りました。
Cocoonについて質問・雑談・情報交換などをまたーりと行いましょう。

0033nobodyさん02/11/02 07:48ID:R7fz2/93
>>31
cocoon2 のfontsの説明 http://xml.apache.org/fop/fonts.html
に有るが、次のようにする。(unix の説明は、上を見て)

1)msmincho.xml(fontの設定ファイル)は次のコマンドで作成する:

java -cp fop.jar org.apache.fop.fonts.apps.TTFReader -ttcname "MS Mincho" %windir%\\Fonts\\msmincho.ttc msmincho.ttc.xml
java -cp fop.jar org.apache.fop.fonts.apps.TTFReader -ttcname "MS Gothic" %windir%\\Fonts\\msgothic.ttc msgothic.ttc.xml

2)userconfig.xml を作る。
<configuration>

<fonts>
<font metrics-file="d:/fop-fonts/msmincho.ttf.xml" kerning="yes"
embed-file="C:/WINNT/Fonts/msmincho.ttc">
<font-triplet name="MS-Mincho" style="normal" weight="normal"/>
<font-triplet name="MS-Mincho" style="normal" weight="bold"/>
<font-triplet name="MS-Mincho" style="italic" weight="normal"/>
<font-triplet name="MS-Mincho" style="italic" weight="bold"/>
<font-triplet name="MSMincho" style="normal" weight="normal"/>
<font-triplet name="MSMincho" style="normal" weight="bold"/>
<font-triplet name="MSMincho" style="italic" weight="normal"/>
<font-triplet name="MSMincho" style="italic" weight="bold"/>
</font>
<続く>
003433続き02/11/02 07:49ID:R7fz2/93
<font metrics-file="d:/fop-fonts/msgothic.ttf.xml" kerning="yes"
embed-file="C:/WINNT/Fonts/msgothic.ttc">
<font-triplet name="MS-Gothic" style="normal" weight="normal"/>
<font-triplet name="MS-Gothic" style="normal" weight="bold"/>
<font-triplet name="MS-Gothic" style="italic" weight="normal"/>
<font-triplet name="MS-Gothic" style="italic" weight="bold"/>
<font-triplet name="MSGothic" style="normal" weight="normal"/>
<font-triplet name="MSGothic" style="normal" weight="bold"/>
<font-triplet name="MSGothic" style="italic" weight="normal"/>
<font-triplet name="MSGothic" style="italic" weight="bold"/>
</font>
</fonts>
</configuration>
------------------------userconfig.xml 終わり
003533続きの次02/11/02 07:50ID:R7fz2/93
userconfig.xml は、conf/userconfig.xml を入れ替えても良いが、
font metric file と同じ場所に置いておいたほうが使いやすいかも。
fop 単独でコマンドラインから使うときは、
-c D:\fopfonts\msgothic.ttc.xml のパラメータを忘れずにつける。

cocoon で使うときは、自分の sitemap に次のように入れる。
3) sitemap のFOPSerializer に、user-config 追加
%TOMCAT_HOME%\webapps\cocoon\sitemap.xmapの182行目あたりを次のように変更する
変更前:
<map:serializer mime-type="application/pdf" name="fo2pdf"
src="org.apache.cocoon.serialization.FOPSerializer"/>

変更後:
<map:serializer name="fo2pdf"
src="org.apache.cocoon.serialization.FOPSerializer"
mime-type="application/pdf">
<user-config src="D:/fopfonts/userconfig.xml"/>
</map:serializer>
■ このスレッドは過去ログ倉庫に格納されています