Hi
Is there a simple way to rotate text using GDI?
I know I know write to a Buffer or Memory DC and rotate then
display, I wanna know if there's a faster way.
Originally posted by awni
Is there a simple way to rotate text using GDI?
I know I know write to a Buffer or Memory DC and rotate then
display, I wanna know if there's a faster way.
Yes - when creating a font (either with ::CreateFont or CFont::CreateFont), you can specify an angle (in tenths of degrees) as the nOrientation parameter.
Yes - when creating a font (either with ::CreateFont or CFont::CreateFont), you can specify an angle (in tenths of degrees) as the nOrientation parameter.
Actually the nEscapement is responsible for the angle of a row of text. The escapement vector is parallel to the baseline of a row of characters. The escapement angle is the angle between the escapement vector and the x axis of a device. The orientation is the angle between each individual character and the x axis. On Win 95,98 and ME the orientation value is not used and the escapement specifies both the orientation and escapement (ususally the 2 are set to the same value). On Win 2000 and XP it is possible to specify each independently.
Thanks, i did use both escapement and orientation, I'm still trying
to write the names of streets on a map. Streets are made up of segments and each segment needs the name written next to it, and the text needs to be at an angle. Some segments are too small, so no writing there.
Hi, awni.
Few month ago I written the map program. I also encountered problem with font like this. After I tried this method (escapement and orientation), I developed my own font in file with my own format, that was simple to rotate to any angle with "rotate matrix". It's all because standart font was a little buggy. Also (I written map program for both PC and PocketPC) this method is wery slow (using my own font is about 10 times faster!).
Also I added logical circles around letters. I put a letter in this place only if current letter is not overlapping another circles - this prevents overlapping letters.
So, you can follow my steps.
Hi,
For drawing text with any angle or other features,I think you need try the following MFC Source Code Flow/Diagram Kit: http://www.********.net/index.htm
It includes all the features for drawing and manage shapes on the canvas.
Regards
Hi,
For drawing text with any angle or other features,I think you need try the following MFC Source Code Flow/Diagram Kit: http://www.********.net/index.htm
It includes all the features for drawing and manage shapes on the canvas.
Regards
Could you please stop with posting this to each graphics problem! This is often not helpfull, as the mentioned diagram kit it not free (the cheapest license is more than $600) and spending $600 just to be able to draw rotated text is a bit too much, don't you think so...
I am sure tha t there is an API function CreateFont to do so.
HFONT CreateFont(
int nHeight, // logical height of font
int nWidth, // logical average character width
int nEscapement, // angle of escapement
int nOrientation, // base-line orientation angle
int fnWeight, // font weight
DWORD fdwItalic, // italic attribute flag
DWORD fdwUnderline, // underline attribute flag
DWORD fdwStrikeOut, // strikeout attribute flag
DWORD fdwCharSet, // character set identifier
DWORD fdwOutputPrecision, // output precision
DWORD fdwClipPrecision, // clipping precision
DWORD fdwQuality, // output quality
DWORD fdwPitchAndFamily, // pitch and family
LPCTSTR lpszFace // pointer to typeface name string
);
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.