Re: Font in Use 'wanted'
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Feb 23, 2004
- 424 views
----- Original Message ----- From: "Guest" <guest at RapidEuphoria.com> To: <EUforum at topica.com> Subject: Font in Use 'wanted' > > > posted by: a.admin at myway.it > > TO Derek, > > a little problem should be considered about the Fonts management, that > prevents a real check of the current font. > > If a wrong font definition is set for a Control, like: > > setFont (Window, {8388608, "Time Old Romanic"}, 12, {"ALL", 0}) > > the following instruction: > > pretty_print (1, getControlInfo (Window, CONTROLINFO_font), {2}) > > will show exactly: > > { > "Time Old Romanic", > 12, > 0, > 8388608 > } > > without any pity for the good sense, as that Font DOES NOT EXIST, while the > system in effects has set its default Font. > > Same result with the more complete: > > sequence font > atom char, ok > char = struct_CHARFORMAT( 0,0,0,0,0,0,0,"") > ok = sendMessage( Window, EM_GETCHARFORMAT, 1, char ) > font = fetch( char, CHARFORMAT_szFaceName ) > ok = message_box( font, "Font Name", MB_OK ) > > > A correct, true declaration could help instead, also for checking if a Font is > available. > > Do you think it's possible to fix that in the new release? There is nothing to 'fix', except the documentation. The getControlInfo() call returns the parameters that were used by an application, regardless of whether they are a real font or not. However, I've added a new function called getFontData() that will return the font information currently in use by a control. -- Derek