Solved

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

Posted on 1998-06-14
5
586 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 150 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
java inner class, for the sole use of parameter passing 21 77
returning a dereferenced pts in C++ 10 158
best sources to up-to-date in C++? 8 91
C++ question 3 70
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

830 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