PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: Custom Fonts
   PostPosted: 24 Jul 2009, 03:25 
We are using pd4ml.useTTF( fontsDir, true ); in the java class, we are also including '<pd4ml:usettf from="/Users/koda/workspace/koda/vendor/extras/fonts"/>' 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


  Subject: Re: Custom Fonts
   PostPosted: 24 Jul 2009, 10:54 
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"


  Subject: Re: Custom Fonts
   PostPosted: 24 Jul 2009, 18:29 
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.


  Subject: Re: Custom Fonts
   PostPosted: 24 Jul 2009, 19:18 
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


  Subject: Re: Custom Fonts
   PostPosted: 26 Jul 2009, 14:38 
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:\windows\fonts, 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.


  Subject: Re: Custom Fonts
   PostPosted: 18 Jul 2014, 10:50 
on Win8.1 in cmd:
Code:
I:\xampp\htdocs\pd4ml\probe>java -Xmx512m  -Djava.awt.headless=true -cp I:\xampp\htdocs\pd4ml\pd4ml_demo.jar  Pd4Cmd "file:123.html" -ttf I:\xampp\htdocs\pd4ml\fonts  800 A4  -debug -out pd4ml.pdf
version: PD4ML 385fx6 Pro (eval)
not yet in cache: file:I:\xampp\htdocs\pd4ml\fonts/pd4fonts.properties
'times' is not in pd4fonts.properties file
reject TTF lookup for: 'times'
not yet in cache: file:I:\xampp\htdocs\pd4ml\fonts/times.ttf
read 'times new roman' from file:I:\xampp\htdocs\pd4ml\fonts/times.ttf
'times bold' is not in pd4fonts.properties file
reject TTF lookup for: 'times bold'
not yet in cache: file:I:\xampp\htdocs\pd4ml\fonts/timesbd.ttf
read 'times new roman bold' from file:I:\xampp\htdocs\pd4ml\fonts/timesbd.ttf
...


I:\xampp\htdocs\pd4ml\fonts/pd4fonts.properties
or
I:\xampp\htdocs\pd4ml\fonts/times.ttf
is the right path in windows system?


  Subject: Re: Custom Fonts
   PostPosted: 13 Jul 2016, 05:46 
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.


  Subject: Re: Custom Fonts
   PostPosted: 08 Aug 2016, 15:32 
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.



[Reply]     [ 8 posts ] 

cron
Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share