Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to display vertically oriented text? (VC++ 4.0)

Posted on 1998-06-14
5
Medium Priority
?
614 Views
Last Modified: 2010-08-05
Is there a way to display vertically oriented text using the standard text
functions of the CDC classlike "TextOut" or "SetTextAlign"? In the MFC
help files I have found no hint on how to do this.
If it is not possible with the standard methods, how can I do that at all?
0
Comment
Question by:rernst
  • 4
5 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 600 total points
ID: 1165884
answer coming.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1165885
You specify this when you create the font.  
The escapement is the angle the text goes in as succesive characters are drawn.  An escapement of 0 draws from left to right (for left to right fonts).    And escapement of 90 degrees (900) will cause the text to be drawn vertically.

continues.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1165886
There is another related quantity that is specified when you create the font.  The orientation.  The orientation specifies the angle of each character within the line of text.  For example, If the orientation equals the escapement, the characters are not tilted with respect to the direction the text is being drawn in.  If the escapement is 0, the characters always appear upright, regardless of the direction the text is draw in.  Does that make sense?

On windows 95, you must specify that the orientation equals the escapement.  This means when you draw vertical text, the characters will be on their sides.  If that is not what you want, let me know, there is another way, but much more work.
0
 

Author Comment

by:rernst
ID: 1165887
Thank you, Nietod,

  this is exactly what I've been looking for. After going through the VC++ help once
again I finally found that CFont::CreateFont provides two parameters, nEscapement
and nOrientation, where one can specify the desired values. So far I have always used
the CreatePointFont function because you have to specify only 3 parameters and
so it looked much more convenient to me.

0
 
LVL 22

Expert Comment

by:nietod
ID: 1165888
Your welcome.  I would have made more clear where these parameters were used.  But I don't  use MFC and the two API functions for creating fonts both take these paremeters  (And several hundred more. Well not hundreds, but it seems that way.)
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question