Skip to main content

Monospaced bold/italic font not monospaced in Germany when printing

5 replies [Last post]
cahrens
Offline
Joined: 2006-05-05
Points: 0

I've searched the Sun bug parade for this problem, and although it appears that it has been problematic in the past I didn't find an open record. Anyone know about this?

We have some German customers who have problems when they print with the Java monospaced font. If their text is plain, everything is fine. However, if the text contains bold or italic words, those words are not monospaced. If they choose Courier New instead of the Java monospaced font, everything works as expected. The text looks ok in our product, it just appears to get messed up during the translation to the format required by the printer (PDF Writer or HP Laserjet 4200).

Thanks,

Christina

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
philrace
Offline
Joined: 2003-06-09
Points: 0

Christina,

Which JDK(s) and OSes (specific versions) ?
If Windows what printer driver version?
Why do you mention LJ 4200 ?
There are localised printer drivers from HP perhaps its
specific to that but I did think that was mostly
localised for UI related reasons.
When you say it looks OK in your product, does
that mean OK when you do the same or on just onscreen?

What is being printed?
Do you have a test case?

-Phil.

cahrens
Offline
Joined: 2006-05-05
Points: 0

Hi Phil,

Thanks for responding! Our customers are running Windows XP with the 1.5.0 VM. I don't think the problem is related to a particular print driver, as it has been reported with a few different printers. I noted the HP Laserjet 4200 just because that is one of the printers that the problem has been reported with. If the printer driver version would be helpful, I can contact the customers and ask them.

No, I cannot reproduce the problem myself. Yes, the text looks correct on-screen-- the only problem is with the printout itself. I don't have a test program outside of MATLAB to give you, though if necessary I can work on creating one.

We are printing text, possibly with colors, italics, and bold. When we print, I use graphics.drawString to draw the text (grouped by color and font), and I use TextLayout's getLogicalHighlightShape method to determine where my new x location should be. Interestingly, getLogicalHighlightShape seems to be returning the correct answer for a monospaced font, but then the text drawn into the Graphics object is not actually monospaced (so there is extra room at the end of the run). The problem is only seen when the Italic or Bold attribute is present in the Monospaced font. Again, it does not happen if the user explicitly chooses Courier New.

Hope that helps to clarify the problem,

Christina Ahrens
The MathWorks, Inc.

cahrens
Offline
Joined: 2006-05-05
Points: 0

Hi Phil,

One of our German engineers was able to reproduce this with the Font2DTest demo program, so I submitted a Sun bug report for the problem. It has an internal ID of 578580. If it would be helpful, I can send you a screenshot of the Font2DTest program with monospaced text on-screen but non-monospaced in the printout (as a pdf file).

Thanks,

Christina

cstoeber
Offline
Joined: 2006-03-28
Points: 0

Hello Christina,

did you solve the problem?

I've the same problem with Windows 2000 and a HP LaserJet 13xx printer, but _only_ with Windows. My developer machine is a linux system and there printing works fine.

Bye,
Christian

chrisahrens
Offline
Joined: 2006-04-26
Points: 0

This has been fixed in Mustang. Here is the Sun bug report:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4935871

Hope that helps