Home All Groups Group Topic Archive Search About

Font representation

Author
21 Jun 2006 9:36 AM
Andrey Dzizenko
Hi all!

Is there any method to draw text (using Graphics) that looks like in MS 
Word? It has another parameters like spacing or char width.

There's an idea that it's caused by differences of GDI and GDI+. But what 
to do with it?

Thank you in advance for any comments.

Best regards,
    A. Dzizenko.

Author
21 Jun 2006 9:54 AM
Kevin Spencer
You'll have to be more specific. You can draw text in all sorts of ways. For
example, the Graphics.DrawString method has several overloads that take a
StringFormat instance as a parameter. The StringFormat class is used to
tweak the formatting of the string being drawn. The TextRenderer.DrawText
method has several overloads that take a TxtFormatFlags parameter that
allows tweaking of the text being drawn.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

I recycle.
I send everything back to the planet it came from.

Show quote
"Andrey Dzizenko" <A.Dzize***@logicexplorers.com> wrote in message
news:op.tbhoygfkdn0034@dzizenko.lei.com...
>
> Hi all!
>
> Is there any method to draw text (using Graphics) that looks like in MS
> Word? It has another parameters like spacing or char width.
>
> There's an idea that it's caused by differences of GDI and GDI+. But what
> to do with it?
>
> Thank you in advance for any comments.
>
> Best regards,
> A. Dzizenko.
Author
21 Jun 2006 10:34 AM
Andrey Dzizenko
Both DrawString and DrawText don't take as a parameter char width or char 
spacing. Ain't I right?


On Wed, 21 Jun 2006 13:54:00 +0400, Kevin Spencer <u**@ftc.gov> wrote:

Show quote
> You'll have to be more specific. You can draw text in all sorts of ways. 
> For
> example, the Graphics.DrawString method has several overloads that take a
> StringFormat instance as a parameter. The StringFormat class is used to
> tweak the formatting of the string being drawn. The TextRenderer.DrawText
> method has several overloads that take a TxtFormatFlags parameter that
> allows tweaking of the text being drawn.
>
Author
21 Jun 2006 3:35 PM
Kevin Spencer
No need to ask:

http://msdn2.microsoft.com/en-us/system.drawing.stringformat.aspx
http://msdn2.microsoft.com/en-us/library/system.windows.forms.textformatflags.aspx

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

I recycle.
I send everything back to the planet it came from.

Show quote
"Andrey Dzizenko" <A.Dzize***@logicexplorers.com> wrote in message
news:op.tbhrnbtwdn0034@dzizenko.lei.com...
> Both DrawString and DrawText don't take as a parameter char width or char
> spacing. Ain't I right?
>
>
> On Wed, 21 Jun 2006 13:54:00 +0400, Kevin Spencer <u**@ftc.gov> wrote:
>
>> You'll have to be more specific. You can draw text in all sorts of ways.
>> For
>> example, the Graphics.DrawString method has several overloads that take a
>> StringFormat instance as a parameter. The StringFormat class is used to
>> tweak the formatting of the string being drawn. The TextRenderer.DrawText
>> method has several overloads that take a TxtFormatFlags parameter that
>> allows tweaking of the text being drawn.
>>
>
Author
21 Jun 2006 10:38 AM
Barry Kelly
"Andrey Dzizenko" <A.Dzize***@logicexplorers.com> wrote:

> Is there any method to draw text (using Graphics) that looks like in MS 
> Word? It has another parameters like spacing or char width.
>
> There's an idea that it's caused by differences of GDI and GDI+. But what 
> to do with it?

I've found this interesting:

http://wesnerm.blogs.com/net_undocumented/2006/06/text_mess_in_ne.html

-- Barry

Author
21 Jun 2006 1:09 PM
Andrey Dzizenko
Hmm...

Text measures became identical. But a font became... bold or something.

But it was really interesting, thank you!



On Wed, 21 Jun 2006 14:38:14 +0400, Barry Kelly <barry.j.ke***@gmail.com> 
wrote:

Show quote
> "Andrey Dzizenko" <A.Dzize***@logicexplorers.com> wrote:
>
>> Is there any method to draw text (using Graphics) that looks like in MS
>> Word? It has another parameters like spacing or char width.
>>
>> There's an idea that it's caused by differences of GDI and GDI+. But 
>> what
>> to do with it?
>
> I've found this interesting:
>
> http://wesnerm.blogs.com/net_undocumented/2006/06/text_mess_in_ne.html
>
> -- Barry
>

AddThis Social Bookmark Button