Decimal font size

<< Click to Display Table of Contents >>

Navigation:  How to >

Decimal font size

vpxPrint, like the Windows APIs, does not support decimal font size.

 

But sometimes, some official institutions require to write with a decimal font size. it's not Windows native, even if MSWord allows that.

As there is no choice, you will find below a workaround.

 

How to write a text with a decimal font size:

 

Set the CPI to the value that you want. Example: <CPI=9> means that you want 9 characters per inch. Set the <CPI> to the right value for the decimal font size, this value can be decimal.
That defines the horizontal grid for characters.

Set the font size to a value less or equal to the integer part of your decimal font size. Example: <P8> if you want a size of 8.5

Do not put directly the text as a string on your document but rather write it char/char with a <C+1> between each character:

 

DEF VAR myTEXT AS CHAR INITIAL "ABCDEFGHIJ".

 

PUT STREAM O CONTROL "<AT=xxx,yyyy><CPI=cccc><Pxxxx>.                // STARTING POSITION

 

DO    I = 1 TO LENGTH(myText):

PUT STREAM o  UNFORMATTED  "<#C>" SUBSTRING(myTEXT, I, 1) "<=C><C+1>".

END.