Change Font Size in proportion to change in Form Size
Posted: 24 Nov 2015 23:59
Hi,
Is there a simple way to adjust the font size used in drawing text in a form when that form is resized?
I am thinking of "rolling my own" predicate(s) to set the font size in proportion to the Form size when that Form is repainted in the onPaint event handler.
I am already dealing with resizing RCT in the onPaint event handler, of course.
Is there a simple way to adjust the font size used in drawing text in a form when that form is resized?
I am thinking of "rolling my own" predicate(s) to set the font size in proportion to the Form size when that Form is repainted in the onPaint event handler.
Code: Select all
CurrFont = vpi::winGetFont( W ),
% get form height and width,
% calculate new font size required based on "M" size and
% Create NewFont
vpi::winSetFont( W, NewFont ),
vpi::drawTextInRect( W, RCT, String, Flags ),
vpi::winSetFont( W, CurrFont ),
...