![]() |
How to query font used by ReportControl |
Post Reply ![]() |
Author | |
wrecks ![]() Groupie ![]() Joined: 14 July 2015 Status: Offline Points: 42 |
![]() ![]() ![]() ![]() ![]() Posted: 31 March 2021 at 6:37pm |
How can I query the font that is being used by a ReportControl?
I know I can set the font by creating a StdFont object, setting its Name/Size/Weight and etc. properties, and then passing that font to PaintManager.TextFont. But how can I find out whatever the current font is? (I like the font that RC is using -- I just want to know exactly what it is!) What I really want to know is: how can I query the width (in pixels) of a text string when rendered in the current RC font? If I can get a handle to the font, I know how to measure text size from there. I am using Codejock.ReportControl.18.4.0 Thanks in advance for any help on this.
|
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1354 |
![]() ![]() ![]() ![]() ![]() |
You should also be able to get the PaintManager.TextFont as an StdFont. In VB6 you can get the font like this:
I know you are using APL but I'm not sure if there's a similar way to get an object from a property (though I think there must be?)
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
![]() |
|
wrecks ![]() Groupie ![]() Joined: 14 July 2015 Status: Offline Points: 42 |
![]() ![]() ![]() ![]() ![]() |
Yes, I can query PaintManager.TextFont, but if I use the pointer it returns to create an object, it does not have any properties.
In your VB example, having created lo_Font, does it now have Name and Size properties? |
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1354 |
![]() ![]() ![]() ![]() ![]() |
Sorry for the delay getting back to you! Yes, after getting the PaintManager.TextFont into lo_Font object all the properties are set as expected (Name, Font, Bold, etc...). Not sure why you wouldn't be getting that information? Maybe there's another way to turn assign the pointer to the StdFont object?
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |