Solved

C++ Builder 1.0 - Fonts real height

Posted on 1998-08-30
4
405 Views
Last Modified: 2013-12-03
How can I know the HEIGHT occupied by a font?
Builder gives the height of the font minus the leading space. This space varies from font to font. How can I find out its value?
0
Comment
Question by:tiagov
  • 2
4 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1171628
Use the GetTextMetrics() function.  This fills in a TEXTMETRIC structure that has the information you want.  The tmHeight is the height without taking the external leading into account.  The external leading is also specified in the structure as well as lots of other fugures.

Let me know if you have questions.
0
 

Author Comment

by:tiagov
ID: 1171629
Or Builder 1 doesn´t  have that function or my release is incomplete.
I found out a way using the Canvas->TextHeight function.

Thank you any way.
0
 

Accepted Solution

by:
hlava earned 100 total points
ID: 1171630
i don't know in which situation you are
my English language isn't best to understand you question.

if you can get sizes of Font forexample from Label1
(i'm using B.C++ B. 3.0)
try:

int x,y;
x=Label1->Font->Width;
y=Label1->Font->Height;


I dont Know if it is what you want.


H.E.A.D
0
 
LVL 22

Expert Comment

by:nietod
ID: 1171631
Read the question history.  He already found an answer three weeks ago.  It is not a good idea to go through the old questions and answer them unless you check that an answer is still needed.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

863 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now