Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #26232

    We are using pd4ml.useTTF( fontsDir, true ); in the java class, we are also including ‘‘ in the top of our HTML, and yet it does not seem to be including our custom TTF.

    Do you have any tips for debugging this? or what else we should look for?

    Koda

    #27408

    The debug tactics is quite simple: switch debug output on with pd4ml.enableDebugInfo() and check what it dumps to STDOUT. It should be traces that it successfully loaded pd4fonts.properties (by the way, did you generated the file as required?) and the referenced font files.

    TTF embedding feature has one requirements to TTF file format: the custom TTFs must be UNICODE-compatible (as almost any modern TTF font).

    If for some reasons it rejects your TTFs, you may play with TTF file format using free FontForge utility (you may change TTF file options in “Save TTF” dialog). It is built for UNIX/Linux platform, but also runs on Win32 in Cygwin environment. Just google for a preconfigured FontForge + Cygwin with the following keyword: “fontforge-mingw_2008_11_21

    #27409

    When we use the command line to generate the pd4fonts.properties file it returns a pd4brower.properties file instead. So we copied an example fonts properties file and changed it as per our font files and names.

    Here is what we typed from the command line…

    java -jar pd4ml.jar -configure.fonts /path/to/my/fonts/

    and that spits out a pd4browser.properties file.

    Here’s a copy of our simple pd4fonts.properties file…

    #this is an autogenerated file. please remove manually any references to copyrighted fonts
    #Wed Sep 13 13:59:25 CEST 2006
    Comic Sans MS=Comic Sans MS.ttf
    Minion=minion.ttf

    We haven’t tried the debug option yet, I figured I’d post this information first. I will try and see what the debug spits out in a bit. If there’s anything that jumps out that’s incorrect here that might save me some time.

    #27410

    Thanks for the help, we managed to get it working.

    We still don’t know why the command to generate the pd4fonts.properties file wasn’t working. We had an issue with that file and once we fixed it the loading of the fonts worked.

    Thank you for the suggestion of the debugging, that’s what lead us to find the error.

    Cheers

    #27411

    @koda-dev wrote:

    When we use the command line to generate the pd4fonts.properties file it returns a pd4brower.properties file instead.

    During the first run of PD4Browser (java -jar pd4ml(_demo).jar) in any mode, it generates default application properties file pd4brower.properties

    You run PD4Browser the first time to generate TTF properties. So it produces two .properties files. One is in the current directory (./pd4brower.properties), another one is in the font files directory (/path/to/my/fonts/pd4fonts.properties)

    The fact of two simultaneous .properties files output may be confusing. Also if you generate the properties file for c:windowsfonts, the resulting file exists, but it is not visible with windows explorer (in the folder the explorer in the fonts-only view mode). But the file may be easily opened with any text editor, for instance.

    Obviously we need to clarify the topics more detailed in the documentation.

    #27412

    on Win8.1 in cmd:
    I:xampphtdocspd4mlprobe>java -Xmx512m -Djava.awt.headless=true -cp I:xampphtdocspd4mlpd4ml_demo.jar Pd4Cmd "file:123.html" -ttf I:xampphtdocspd4mlfonts 800 A4 -debug -out pd4ml.pdf<br /> version: PD4ML 385fx6 Pro (eval)<br /> not yet in cache: file:I:xampphtdocspd4mlfonts/pd4fonts.properties<br /> 'times' is not in pd4fonts.properties file<br /> reject TTF lookup for: 'times'<br /> not yet in cache: file:I:xampphtdocspd4mlfonts/times.ttf<br /> read 'times new roman' from file:I:xampphtdocspd4mlfonts/times.ttf<br /> 'times bold' is not in pd4fonts.properties file<br /> reject TTF lookup for: 'times bold'<br /> not yet in cache: file:I:xampphtdocspd4mlfonts/timesbd.ttf<br /> read 'times new roman bold' from file:I:xampphtdocspd4mlfonts/timesbd.ttf<br /> ...

    I:xampphtdocspd4mlfonts/pd4fonts.properties
    or
    I:xampphtdocspd4mlfonts/times.ttf
    is the right path in windows system?

    #27413

    Please share the pd4fonts.properties file example. In my case also it is not generated pd4fonts.properties file. Instead of generating pd4fonts.properties it gives UI called PD4ML Converter. Please help me to generate the pd4fonts.properties and while mean pls share the working pd4fonts.properties file. Then i can manually create it and place it in font folder.

    #27414

    A usual reason, that it does not generate pd4fonts.properties is insufficient permissions.

    For example the command has to index all system font and to generate c:/windows/fonts/pd4fonts.properties :

    java -jar pd4ml.jar -configure.fonts c:/windows/fonts

    but it does not, as by default (in modern Win versions) it has no permissions to write to c:/windows/fonts

    A solution is to generate the properties file somewhere else:

    java -jar pd4ml.jar -configure.fonts c:/windows/fonts c:/workspace/fontmap/

    The second parameter defined a destination folder or new file name for generated pd4fonts.properties. The .properties will refer to c:/windows/fonts as the actual TTF location.

    In your application pass “c:/workspace/fontmap/” as useTTF() parameter.

Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.