Board index » cppbuilder » Accessing Font Metrics information

Accessing Font Metrics information


2005-02-22 09:29:39 AM
cppbuilder81
I need to get the Font Metrics infomation for a TFont
This would be the same as the Java Function getFontMetrics(Font f) and allow me to get the Leading, Ascent and Descent of a particular font/size/style.
any suggestions?
 
 

Re:Accessing Font Metrics information

GetTextMetrics. Check the Windows help file for details.
"Chris G" < XXXX@XXXXX.COM >wrote in message
Quote

I need to get the Font Metrics infomation for a TFont

This would be the same as the Java Function getFontMetrics(Font f)
and allow me to get the Leading, Ascent and Descent of a particular
font/size/style.
Quote

any suggestions?
 

Re:Accessing Font Metrics information

Look at ::GetTextMetrics()
"Chris G" < XXXX@XXXXX.COM >ha scritto nel messaggio
Quote

I need to get the Font Metrics infomation for a TFont

This would be the same as the Java Function getFontMetrics(Font f) and
allow me to get the Leading, Ascent and Descent of a particular
font/size/style.
Quote

any suggestions?
 

{smallsort}

Re:Accessing Font Metrics information

Chris G wrote:
Quote
any suggestions?
VCL components are pretty much just wrappers encapsulating Win32 API
functionality. If you ever need more information or control than the
VCL component provides you can nearly always rely on their being a
Handle property that you can pass to the API. In the case of
TFont::Handle the help states:
///////////////
The Handle property indicates the Windows GDI font object handle.
Use Handle as a parameter when calling Windows API functions that
require a font handle. Set Handle to make the TFont object represent
the Windows font indicated by the font handle. Setting Handle releases
the current Windows font resource.
Note: When possible, change a font by setting the other properties of
TFont rather than using the Handle property. Setting Handle does not
reset the properties that describe the font. However, an OnChange event
does occur when Handle is set directly by an application
--
Andrue Cope [TeamB]
[Bicester, Uk]
info.borland.com/newsgroups/guide.html