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(objec t sender,
System.Drawing. Printing.PrintP ageEventArgs e)
{
Font fo = new Font("Courier new", 12, FontStyle.Regul ar););
SolidBrush br = new SolidBrush(Colo r.Black);
e.Graphics.Scal eTransform(0.4f , 1f);
e.Graphics.Draw String("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.Text RenderingHint = TextRenderingHi nt.ClearTypeGri dFit;
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.plwro te in message
news:11******** **************@ b28g2000cwb.goo glegroups.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)condense d fonts for later
use in a program. In Java I had a really nice method
some_font.deriv eFont(AffineTra nsform), which would return a new font.
(AffineTransfor m was just a simple 3x3 matrix)
I'll be most grateful for the help.
Regards,
Karol