Thank you for your fast response.
A word of explanation: I don't need to use tiny fonts but very narrow
ones (e.g. Courier new 12, with 40% of the original width) for printing
reports.
I'm now trying to transform the Graphics object. It works, but the
quality is very poor. Here is a sample code:
private void printDocument1_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e)
{
Font fo = new Font("Courier new", 12, FontStyle.Regular););
SolidBrush br = new SolidBrush(Color.Black);
e.Graphics.ScaleTransform(0.4f, 1f);
e.Graphics.DrawString("N", fo, br, 30, 30);
e.HasMorePages = false;
}
The difference in quality of a print with and without the
transformation is very noticeable - I can provide samples if
required.
I've tried
e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
before drawing the string but without visible results.
Regards,
Karol
Bob Powell [MVP] napisal(a):
This method doesn't exist for .NET fonts. You can create a font with a
specific point size but these may be grid-fitted so the quality will go down
pretty quickly below 8 points.
If you want to draw really tiny fonts with the benefit of some antialiasing
you can use a matrix to shange the drawing scale but you will need to treat
fonts and drawing objects differently.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"k" <va***@wp.plwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Hi,
I'm trying to migrate from Java to C# and have encountered a problem.
I can't seem to find a way to create (ultra)condensed fonts for later
use in a program. In Java I had a really nice method
some_font.deriveFont(AffineTransform), which would return a new font.
(AffineTransform was just a simple 3x3 matrix)
I'll be most grateful for the help.
Regards,
Karol