Hi,
I am looking at an issue within our software … is there a standard way to check if a font is proportional or not.
I notice that a previous programmer has used
Proportional = mod(Font,2)But this reports that Courier is proportional which is not the case.
Urgently needed !!
TIA,
Simon
Hi,
I have just come across the following - can anyone let me know if I am completely wrong or any amendments to what I am trying.
Using http://msdn.microsoft.com/en-us/library/cc250405(v=PROT.13).aspx
I am using the following code ..
Proportional = False$
Prop_OutPrecision_TT_Values = '3,4,7,8,9,10'
Locate FontStruct in Prop_OutPrecision_TT_Values using ',' setting voidPos then Proportional=True$
Thanks for any help,
Simon
If you are using OIPI you can check the CALCTEXT result of two strings that are definitely not the same width such as 'WWWW' and 'iiii'.
If not, sorry for confusing things.
Colin
Unfortunately not using OIPI - this is in Report Builder, our re-worked version from the first time round …
Simon
Ok, I now realise my method has a major weakness.
My initial testing to get the OutPrecision setting was from using the Utility ChooseFont option. Unfortunately Get/Set_Property seems to ignore these settings.
Is there a way of extracting this information from the API given the settings we have from a Get_Property ??
Thanks,
Simon
With a great deal of searching, I have found that I can get the Handle to the font with Send_Message using WM_GetFont.
I have also read that I can use that handle to retrieve the details using GetObject. However, I have yet to get that to work.
Has anyone managed anything similar ??
Simon
Ok, getting further with this, just need some assistance from someone who has tried something like this before.
The following code works, but doesn't fill in the LogFont structure as I am expecting.
I have tried blank, and strings of @fm,@vm,@svm and ',' with and without a training \00\ but to no avail.
Has anyone got any idea as to what I need to put into LogFont to get the structure back correctly ??
Thanks,
Simon
Equ WM_GetFont$ to 0x0031
CtrlHandle = Get_Property(CtrlEntId, 'HANDLE')
FontHandle = SendMessage(CtrlHandle, WM_GetFont$,
,
)LogFont = Str(@svm, 15)
FontInfo = GetObjectA(FontHandle, 64, LogFont)
Y'know Simon the list of fixed fonts is VERY finite. You could just code it as a parameter record - unless your clients are designing their own fonts?
World leaders in all things RevSoft
That may end up being the method I have to use - but it would be nice to have this working properly, ti could well be useful for other users as well !!
My latest efforts are as follows :-
CtrlHandle = Get_Property(CtrlEntId, 'HANDLE')
FontHandle = SendMessage(CtrlHandle, WM_GetFont$,
,
)LogFont = Blank_Struct('LOGFONT')
sLen = Struct_Len('LOGFONT')
FontInfo = GetObjectA(FontHandle, sLen, LogFont)
FontDetails = Struct_to_Var(LogFont, 'LOGFONT')
With the LOGFONT structure definition as per the supplied SysObj row, but a SysRepos entry created for it.
This unfortunately supplies a set of zeroes and a char string of 32 Char(0)'s as the name. There must be a simple step that I am missing to get this to work properly ….
Simon