473,382 Members | 1,225 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Printing Fixed Fonts

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.
Jul 21 '05 #1
4 1443
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

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #2
My error. The sample text had embedded CRs so MeasureString seems to
work with monospace fonts just fine.

Regards,
Jeff

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #3
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 Louie" wrote:
My error. The sample text had embedded CRs so MeasureString seems to
work with monospace fonts just fine.

Regards,
Jeff

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #4
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

"Jeff Louie" wrote:
My error. The sample text had embedded CRs so MeasureString seems to
work with monospace fonts just fine.

Regards,
Jeff

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Murray Elliot | last post by:
Just wondering if anyone has any ideas on how to solve a particular problem. A client wants to print barcode labels from their (web/php based application). The barcode labels are very small, so I'm...
7
by: Kamilche | last post by:
I'm pretty desperate to get color syntax printing. I just tried out the evaluation version of 'Komodo', which several people in here suggested, and its print features are terrible. The text is...
4
by: Arthur | last post by:
Hi Everyone, I'm having a real hard time with this. Maybe some smarter people can assist. I'm running Mandrake 9.2. I have a Laserjet 4M Plus. I want to be able to print Postscript, bold,...
21
by: Arthur Connor | last post by:
I want to embed some source code lines in an article on a web page. As usual I want to use a fixed sized font for this souce code lines (read: the letters should have all the same width). The...
7
by: Mark | last post by:
Hi, I am trying to create a "print preview" window for a web site using asp.net. I have got a long way down the road to the solution but the problem I have now is that the text and lines on the...
4
by: Arif | last post by:
I C# code prints very slow as compared to a third party barcode printing software. That software prints approximately 10 labels in 2 seconds while my C# code prints 10 labels in 5 to 6 seconds. And...
2
by: F. Potier | last post by:
I want to print with a small Epson ticket printer (Epson TM-T88II) As the printing is very slow with the windows fonts I'm looking for some code to make use the hardware fonts built in the...
4
by: SmithG | last post by:
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...
2
by: user | last post by:
Hi all... i am trying to print an image using GDI - but the only thing i get is a black rectangle. Does anybody know what is wrong, or how else to get the bitmap on the printer (GDI+ is not...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.