Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Part of the string - in Bold
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00461366
Message ID:
01231812
Views:
27
I'm also trying to write a function to give me the text width in points using TxtWidth and FontMetric… I’m close but not accurate. Can you tell me what I’m missing in my formula? All my text here are the same style.
PARAMETERS l_Text, l_FontName, l_FontSize, l_FontStyle

?GetTxtWidthPoints('Visual FoxPro','Helvetica Narrow',10,'B')

*!*	l_Text		= 'Visual FoxPro'
*!*	l_FontName	= 'Helvetica Narrow'
*!*	l_FontSize	= 10
*!*	l_FontStyle	= 'B'

LOCAL lnPoints 

*6 - Average character width in pixels
 
lnPoints = txtwidth(l_Text,l_FontName,l_FontSize,l_FontStyle) * (fontmetric(6,l_FontName,l_FontSize,l_FontStyle) * .72)

return lnPoints 
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform