mfc >> Font thing

by German Koninin » Thu, 20 Jan 2005 21:21:51 GMT

Good afternoon, everybody.
A stupid question about font. How to make a font looking like this:
S o m e t e x t.
I mean to make a space between characters longer, but characters should be
the same size like normal.
Thanks.




mfc >> Font thing

by Frank Hickman [MVP] » Fri, 21 Jan 2005 01:13:58 GMT


Use Courier (raster) or Courier New (true type).

--
============
Frank Hickman
Microsoft MVP
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.









mfc >> Font thing

by German Koninin » Fri, 21 Jan 2005 01:26:20 GMT

Unfortunately I need to use Verdana. And I'm looking how to make a font like
this.






be




Font thing

by TWFubnkgU2lsdmE » Fri, 21 Jan 2005 06:09:03 GMT

Hi German,

Try using the ExtTextOut API. The last parameter is an array of spacing
values which allows you to specify exactly how far apart each character will
appear from the last. It will take a bit of effort to calculate that array
if you want the spacing to depend on the widths of the characters. If you
want the character widths to be equal then this is a breeze.

Hope that helps,
Manny


Font thing

by German Koninin » Fri, 21 Jan 2005 22:27:37 GMT

Looks like working. But the size of every cell is different. It is dependent
of actual character that is there. For example space that "space" takes is
more then space of T.
For eample "TEST TEST" looks like "T E S T T E S T", so you see that
"space" if long. Is there some tricky way how to cound the individual size
for every character depending of font name I use. I'm sure there is a way,
but can't remember where I seen it and any keywords. thanks a lot, your
reply was helpful for me.



spacing
will
array




Font thing

by Bill Thompson » Sat, 22 Jan 2005 10:35:46 GMT

Poke around with functions like CDC::GetTextExtent() (for individual
character sizes) or CDC::GetTextMetrics() (for average character
sizes), or perhaps SetTextCharacterExtra() to control the amount of
spaces between each character.

It seems like doing a character by character write, using
GetTextExtent() for each character, might do the trick for you.



Font thing

by Jerry Coffin » Thu, 27 Jan 2005 09:31:27 GMT

In article <es5YgV8$ XXXX@XXXXX.COM >, "German Koninin"
<germanD0Tkoninin/_\TcolumbuscrmD0|com> says...

GetTextExtentEx32 will give you an array of the starting points of
the characters. You should be able to modify that and then feed the
result back to ExtTextOut.

--
Later,
Jerry.

The universe is a figment of its own imagination.


Similar Threads

1. Interface -- C# thing or .NET thing - CSharp/C#

2. MeasureString(string s,Font font) dosen't return right pixels

The function return quite rough pixels.

e.g. if you use Font: Verdana, Font style:Regular, Size:8 and type 60 upper 
case
character C, the functuion returns pixels 478.3639, but actualy it occupies 
a textbox
that has width 545 pixels, that is about 13% difference. When using the 
function to
get pixels and grow a textBox, the textBox is not big enough to show all 
characters.

For other characters like lower case i, it return more pixels than it it has.

So it is impossile to use the function to get pixels to expand or shink a 
textbox
dynamically when typing character.

Is there any other way?

Thanks



3. Convert MFC Fonts to c# Fonts - CSharp/C#

4. Disable Font Style and Size selection in Font Dialio box

Is there any way i can disable Font Style and Size Section 
that comes on Font Dialog Box.

5. fallback font and custom font combination problem - CSharp/C#

6. Font question (non-installed fonts)

Hi guys.

is it possible to embed a font (which is probably not installed on the 
client machine and I dont want it to be) in the assembly (the font file 
itself or anything else) and then use that embedded resource for creating 
System.Drawing.Font objects?

Thanx,

Picho 


7. Large Font/ Small Font - Microsoft Visual C++/VC++

8. Get font filename of a font

Hello,

I have the name of a font and want to know the file name, where the font 
is saved. I have searched around, but have not found a usefull function 
to do this. Can somebody tell me the function I have to call.

Many thanks

AF