Hello,
I have used GpiQueryFontMetrics() to get the pixel width of a line of
text in a control, like a radio button or checkbox. For controls that are
defined in a resource file, this works fine; it allows me to adjust the
horizontal layout to accommodate different font widths.
However. There is a search function that does not use a resource file;
rather, it creates all of the controls on the fly. (I inherited it this
way.) GpiQueryTextBox() does not work on these controls. There does not
seem to be any reason for the failure. Regardless of the font
specification, the average font width from GpiQueryFontMetrics() always
returns as 7, and a string is the same width despite being rendered in
different fonts. For instance, "Simple" has a width of 41 whether the font
is Workplace Sans or Verdana. That is clearly inaccurate since Verdana is
a much wider font than Workplace Sans.
Neither GPI function reports an error.
Can anyone suggest what might be happening here?
--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)