AntennaHouse / pdf5-ml

Antenna House PDF5-ML DITA-OT Plug-in
23 stars 9 forks source link

特定の全角記号が半角文字フォントでPDFに変換される #175

Closed tmaeda3 closed 3 years ago

tmaeda3 commented 3 years ago

ja_style_custom.xmlに次のように半角と全角フォントを指定し、 <variable name="General_Serif_Font">Calibri, MS gothic</variable> 次の全角文字をPDFに出力すると <p>◎</p><p>●</p><p>○</p> 「◎」はMS gothicに変換されますが、「●」と「○」はCalibriに変換されてしまいます。 「●」と「○」をMS gothicに変換する方法を教えてください。

ToshihikoMakita commented 3 years ago

スクリプトを設定するなど、試しているのですがうまく行きません.Calibriを適用したいUnicodeの範囲を教えてもらえますか?Calibriを適用する範囲から、

U+25CF = "●" U+25CB = "○"

が入っているUnicode range(Geometric Shapes U+25A0~U+25FF)を除外すればよいと思うのですが?

参照URL

https://www.antenna.co.jp/AHF/help/v70/ahf-font.html#font-configration-file

のfont-entry/@unicode-range

以上

ToshihikoMakita commented 3 years ago

Calibriが選択されてしまう範囲からGeometric Shapes U+25A0~U+25FFを「除外したい」のですが、Formatterのfont-config.xmlは、font-entry/@unicode-rangeで「対象とする範囲を指定する」ことしかできないので、Calibriの適用したい(当てたい)Unicode rangeをお伺いしたいのです.

2020-08-31

tmaeda3 commented 3 years ago

Calibriは英数字が中心なので、次の文字コード域だけを使えば十分かと思います。

[U+0000-007F] 基本ラテン文字 (Basic Latin) [U+0080-00FF] ラテン1補助 (Latin-1 Supplement)

font-config.xmlへの記述例をお願いします。

ToshihikoMakita commented 3 years ago

すみません.こんな具合に書いてみたんですがまだCalibriが当たってしまいます.

<?xml version="1.0" encoding="UTF-8" ?>
<!-- DOCTYPE font-config SYSTEM "font-config.dtd" -->
<font-config>
  <!-- add your font folder here -->
  <acc-folder/>
  <font-folder path="@@USERWINFONTS@@"/>
  <font-folder path="C:\Windows\Fonts">
    <font-entry file="calibri.ttf" unicode-range="U+0020-00FF"/>
    <font-entry file="calibrib.ttf" unicode-range="U+0020-00FF"/>
    <font-entry file="calibrii.ttf" unicode-range="U+0020-00FF"/>
    <font-entry file="calibrili.ttf" unicode-range="U+0020-00FF"/>
    <font-entry file="calibriz.ttf" unicode-range="U+0020-00FF"/>
  </font-folder>
</font-config>

知っている人に聞いている最中です.

ToshihikoMakita commented 3 years ago

わかりました.font-config.xmlに上記のような設定を行うと同時に、Formatterの設定ファイルに以下を指定する必要があります.font-settings/@font-selection-mode="5"です.

<?xml version="1.0"?><!-- AH Formatter V7.0 MR3 (7,0,4,45923) for Windows (x64) Copyright (c) 1999-2020 Antenna House, Inc. -->
<formatter-config>
    <formatter-settings ... />
    <font-settings font-selection-mode="5" ...>
         ...
    </font-settings>
    ...
</formatter-config>

テスト用のFOと結果のPDFを付けておきます.

test.zip

tmaeda3 commented 3 years ago

ご指示通りに設定した後、GUIで [組版]-[オプション設定読み込み] を行い、FOファイルを開いたら期待通りのフォントに変換されました。 PCをサインアウト→サインインしてもコマンドラインでは以前のフォントに変換されますが、再起動する必要があるのでしょうか?

ToshihikoMakita commented 3 years ago

GUIは再起動する必要があります.Formatterの設定なのでPCのサインアウト→サインインは不要のはずです.

tmaeda3 commented 3 years ago

念のためPCをリブートしましたが、antコマンドでpdfを作成するとフォントが以前のままです。ほかに設定するパラメーターがあるのでしょうか?

ToshihikoMakita commented 3 years ago

antでFormatterの設定ファイルを指定しておりますでしょうか?

-Dahf.opt=[Formatterの設定ファイルへのパス]

GUIで設定した font-selection-mode="5" をこちらの設定ファイルにもつけておく必要があります.

ご確認ください.

tmaeda3 commented 3 years ago

フォントが正しく出力できるようになりました。 いつもサポートいただき、ありがとうございます。

ToshihikoMakita commented 3 years ago

ではクローズとさせていただきます.