Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedded TrueType font in PCL does not print!

Status
Not open for further replies.

BPWPCL

Programmer
Dec 3, 2007
5
DE
Hi all,

I generated a PCL file containing an embedded TrueType font (Arial) via my own Java program.
The file displays fine in RedTitan escapeE and does not give me any errors there.

However, when sending the PCL file directly to a HP printer (HP Laserjet M5035 MFP) or various Lexmark printers (They all claim to be PCL5 printers), the text does not appear. I just get a blank page.

What could be the problem here?

Thanks for your help

BPWPCL
 
If you can do a 'print to file' of your generated print stream, and send it to me, I can do some analysis on it and let you know if I find anything untoward.

Send it to d_a_n_s_d_a_d_@_b_t_i_n_t_e_r_n_e_t_._c_o_m (remove the '_' characters from this).
 
Hey,

thanks for the help offered.
I sent you an email.

Watch out for something from "@web.de"

BPWPCL
 
I've replied to your e-mail with an analysis of your print stream, which indicates that the font header is not formatted correctly.

In particular, the checksum character is given as 0x00 (which is rather unlikely), and the last segment has an invalid identifier, although there may be other faults as well.
 
Thanks again for your analysis.

Those issues you've brought up are definitely a problem with the generated file.

I had a look at the font header and there's a lot more wrong with it than this.

Well, I think that's just what happens if you have to take over someone else's code.






 
>> "Well, I think that's just what happens if you have to take over someone else's code."


Especially if the code is not well documented.

Creating a downloaded PCL Encapsulated TrueType Outline (PCLETTO) format font from a 'donor' TrueType font is not a trivial process.

What may help is to look at the equivalent mechanism (including sample 'C' code) for PCL XL (PCL6) fonts, as described in one of the HP documents available for PCL6 (see the 'PCL6 documentation' FAQ for details of where to get access to this).

The PCL5 process is very similar, the main difference being in the 'wrappers' round the bulk of the extracted header and character descriptions.
 
Checksum was not right, and there were a lot of strange overlaps in the segments due to address calculation mixups.

I fixed it yesterday. It works now.

Thanks again for the help

BPWPCL

 
The escape sequence:

{esc}(s1p8v0b0s4T

will, on most modern LaserJet (and clone) devices, select the printer-resident Helvetica font, which actually matches the characteristics:

{esc}(s1p8v0b0s24580T

where the typeface identifier 24580 is (6*4096)+4.

But BPWPCL was having problems with a downloaded font anyway, and not wanting to select a printer-resident font (I think that this was perhaps because the downloaded font contained more characters than the printer-resident typeface-equivalent font).
 
The resident fonts on my LaserJets have many many code pages of characters, several thousand total.
 
The current Arial font on Windows Vista contains 3381 glyphs, which are used in the construction of 2792 characters.

The Arial Unicode MS font contains 50377 glyphs, which are used in the construction of 38917 characters.

I don't know which of these the printer-resident Arial font on modern LaserJet devices most closely matches.

But that's all an aside; the original purpose of this thread was about problems with a downloadable soft font, not any of the printer-resident fonts, so I couldn't see the point of the reference to the resident-font selection escape sequence - that's all.
 
I was only responding to DansDadUK about maybe the resident font didn't have enough characers. You are right.
 
We have an OEM product (TTFntPCL) that we made for EDS/Deloitte for the State of California that generates PCLETTO (.SFT) fonts from full Unicode TrueType fonts (we used ANDALWTJ.TTF with 45,000 Unicode cells).

They provide the UTF-8 text and tell us the language and we extract the appropriate Unicode glyphs from the .TTF to create a .SFT to embed in front of the text. We also apply all the appropriate character substitutions, ligatures, etc.

The purpose of this tool is to allow anyone on the web to ask a question in their native language and have it print locally or convert it into a PDF using our PCLTool SDK tools.

We also just convert TTF into PCLETTO fonts. Or, extract PCLETTO fonts from PCL5e/PCLXL print streams.

Regards,

Bob Pooley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top