Printing Fixed Fonts

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a requirement to print text from a source thats formatting is based on
a fixed font for proper presentation of column alignment. Sounds easy
but.........

The problem I am having is that no matter what "fixed font" family I use the
grapics Drawstring method of the .NET print document is rendering it like a
true type font and the fixed spacing is lost resulting in loss of column
alignment. This occurs no matter what printer driver I use.

For the record I have tryed this with a Lexmark 2480 Forms Printer and four
or five different HP laser and inkjet printer drivers. I have also tried the
seven or eight different "fixed font" families installed on various
development systems.

I am using C#/Framework V1.1 SP1 for development.

Any suggestions you might have would be greatly appreciated.
 
I just tried using System.Drawing.FontFamily.GenericMonospace on a HP
LaserWriter and it prints in monospace but the graphics.MeasureString
function returns a proportional length. Looks like a bug.

Regards,
Jeff
 
My error. The sample text had embedded CRs so MeasureString seems to
work with monospace fonts just fine.

Regards,
Jeff
 
Thanks for your help Jeff. I will give the family you specified a try.

It still baffles me as to why when you specify a fixed font family like
Courier that it does not use fixed spacing. I even went so far as using font
families that were only fixed and had no possible proportinal derivitives of
a similar name. Go figure.

Greg
 
Jeff,

Thanks again it worked great! Not the best looking of fonts but it will do
for what I need to print. I never bothered to look at the static members of
FontFamily but will not make that mistake again.

Greg
 
Back
Top