OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Programming => Topic started by: Martin Vieregg on December 18, 2019, 09:22:05 am

Title: GpiCreateLogFont size problem with discrete sizes (longint)
Post by: Martin Vieregg on December 18, 2019, 09:22:05 am
I have got a problem with a print preview function where the size of a font is calculated via the actual window size. Changing the window sizes makes ugly font size steps, because  the FATTRS. lAveCharWidth parameter for GpiCreateLogFont is a integer and not a floating point parameter. The typical values are about 10, so there are 10% steps which really looks ugly.

Other programs manage the problem, e.g. PDF viewers or OpenOffice. Is there a substitute for GpiCreateLogFont or how can I solve this problem?
Title: Re: GpiCreateLogFont size problem with discrete sizes (longint)
Post by: Laurence Pithie on December 18, 2019, 11:22:11 pm
You can use GpiSetCharBox in conjunction with GpiCreateLogFont to get finer control over font sizes.
https://books.google.co.uk/books?id=kjyIOLYr7yMC&pg=PA314&lpg=PA314&dq=GpiCreateLogFont&source=bl&ots=COy2URANRZ&sig=ACfU3U1rqC6L2U5d7NYokVZLBO53ETj-SQ&hl=en&sa=X&ved=2ahUKEwiVz5_OmcDmAhVXilwKHYOzAaAQ6AEwAXoECCoQAQ#v=onepage&q=GpiCreateLogFont&f=false (https://books.google.co.uk/books?id=kjyIOLYr7yMC&pg=PA314&lpg=PA314&dq=GpiCreateLogFont&source=bl&ots=COy2URANRZ&sig=ACfU3U1rqC6L2U5d7NYokVZLBO53ETj-SQ&hl=en&sa=X&ved=2ahUKEwiVz5_OmcDmAhVXilwKHYOzAaAQ6AEwAXoECCoQAQ#v=onepage&q=GpiCreateLogFont&f=false)