
FB II Compiler
PG PRO
Debugging
Memory
System
Mathematics
Resources
Disk I/O
Windows
Controls
Menus
Mouse
Keyboard
Text
Fonts
Drawing
Sound
Clipboard
Printing
Communication
ASM
|
PRINTING
Handle bottom page printing
I use a pretty much straightforward printing routine which uses the TEXT statement to set the font, size and style of the text like so:
LOCAL FN pAddData2Fld (fldID,dInfo$,myfont,mysize,myface)
'-------------------------------------
TEXT myfont,mysize,myface
LONG IF gPrintFlag
ROUTE _toPrinter
PRINT dinfo$
ROUTE _toScreen
END IF
END FN
My question is - one of my customers is complaining because the descenders of, say, a "y" are getting clipped off by the text on the next line in the printed output.
How do you control the lineHeight and fontAscent, I thought they were automatically selected by the TEXT statement. I cannot duplicate this problem on my equipment - does this reflect a shortcoming of the users print driver...or???
LOCAL FN pAddData2Fld (fldID,dInfo$,myfont,mysize,myface)
LONG IF gPrintFlag
ROUTE _toPrinter
TEXT myfont,mysize,myface <-- MOVE HERE
PRINT dinfo$
ROUTE _toScreen
END IF
END FN
I would suggest placing the TEXT statement after the ROUTE _toPrinter command (as shown above) to ensure that the printer setting is exactly what you want. If not, then the print driver may have its own idea about how the default text should be displayed.
I hade the same problem printing edit fields and my solution is as follows:
CLEAR LOCAL
LOCAL FN lineHight(efHandle&)
lngd% = PEEK WORD([efHandle&])
lngd% = lngd% + 2
stilAntal% = PEEK WORD([efHandle&]+lngd%)
lngd% = lngd% + 2
i = 0
DO
INC(i)
fontHight% = PEEK WORD([efHandle&]+lngd% +(i*12))
'
' Change 1.2 if you want another lineHeight
nylineHight% = fontHight% *1.2 : temp% = nylineHight% - fontHight%
ascent% = PEEK WORD([efHandle&]+lngd% + (i*6))
nyascent% = ascent% + temp%
'
POKE WORD [efHandle&]+lngd% + (i*4), nylineHight%
POKE WORD [efHandle&]+lngd% + (i*6), nyascent%
UNTIL i = stilAntal%
END FN = efHandle&
'
GET FIELD EFH&,FieldNumber
EFH& = FN lineHight(EFH&)' New lineHight
EDIT FIELD #1,&EFH&,(L,T)-(R,B),FieldType,FieldJust
KILL FIELD EFH&
|