AntennaHouse / pdf5-ml

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

Enhancement Request: Please add an option to set font-config file #180

Closed AndeeZee closed 3 years ago

AndeeZee commented 3 years ago

Hello! When using Antenna House Formatter for different projects, I need to keep the fonts separate per project and transformation process. So it would be great to have an option to set AHF70_FONT_CONFIGFILE / AHF70_64_FONT_CONFIGFILE respectively. Maybe an additional commandline-parameter to the ahfcmd.exe would help to avoid "fiddling" around with different environment variables for different versions of formatter.

Thank you, Andy

AndeeZee commented 3 years ago

Hello again! Or can you tell me please, how to add my enhancement request to a custom plugin, which extends it, so that a variable ends up in a target like this:

<target name="transform.fo2pdf.option.and.multivol" if="option.and.multivol">
    <exec executable="${ahf.dir}/${ahf.cmd}" logerror="true" failonerror="true">
        <arg value="-d"/>
        <arg value="${prmInputFile}"/>
        <arg value="-o"/>
        <arg value="${prmOutputFile}"/>
        <arg value="-p"/>
        <arg value="@PDF"/>
        <arg value="-extlevel"/>
        <arg value="4"/>
        <arg value="-i"/>
        <arg value="${ahf.opt}"/>
        <arg value="-multivol"/>
        <env key="AHF70_64_FONT_CONFIGFILE" value="${ahf.font.config}"/>
    </exec>
</target>

For now, I put everything in the base plugin (com.antennahouse.pdf5.ml), which is of course not the intention, but I'm lost in integrating it to the jp.acme-corporation.pdf.ml plugin, so that I can redefine these targets with the new parameter.

Any help is appreciated. Thank you, Andy

ToshihikoMakita commented 3 years ago

Thank you for your suggestion. I will ask my professional colleague whether is is possible to change font-folder per AH Formatter invoking.

ToshihikoMakita commented 3 years ago

I have analyzed how to include your requirement and found that changing font-config.xml per invoking is not general request. So I will implement this function by build file extension. Do you have any suggestions?

ToshihikoMakita commented 3 years ago

I've implemented build extension in the "test-font-config" branch. Could you test this function by installing attached extension plug-in?

com.antennahouse.pdf5.ml.font-config.change.zip

  1. Clone 'test-font-config' branch.
  2. Unzip the archive and copy it [DITA-OT]/plugins folder.
  3. In the [DITA-OT] directory, type "bin/dita --install" command.
  4. Invoke DITA-OT by dita command specifying --ahf.font.config.file=[font-config.xml path].

The default font-config.xml environment variable is "AHF70_64_FONT_CONFIGFILE". You can change by specifying --ah.font.config.env=[font-config.xml environment variable name]

If you have any questions, please do not hesitate to ask me.

AndeeZee commented 3 years ago

Hello! Thank you very much for the super fast response and solution! I tested it in my environment and I can confirm, that this works. You can close this issue, once this is merged into the master. Thank you very much, Andy