Problem using InchSay Centered, or Right Justified

Problem using InchSay Centered, or Right Justified

Postby byron.hopp » Mon Apr 13, 2015 12:35 am

Anybody know a fix for printing using inchSay, or Say from the printer object when using the Width parameter (pixels only), and using PAD_CENTER, or PAD_RIGHT? It does not seem to cut off correctly based on the width using these.

Thanks,

Byron
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
 
Posts: 356
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Problem using InchSay Centered, or Right Justified

Postby James Bott » Tue Apr 14, 2015 2:44 pm

Byron,

Maybe you could show us a small program showing the problem. And maybe a screenshot of the output.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Problem using InchSay Centered, or Right Justified

Postby byron.hopp » Sat Apr 18, 2015 7:20 pm

Here is an example of the printout discussed earlier. I am using the method Say (Inchsay uses say it just converts Inches to Pixels before)

Source below:

Function TestAlign()
#Define PAD_LEFT 0
#Define PAD_RIGHT 1
#Define PAD_CENTER 2

Local oPrn
Local oBrush := nil
Local oFont := nil
Local oPen := nil
Local nTop := 200
Local nLeft := 200
Local nBottom := 285
Local nRight := 500
Local nCenter := nLeft + ( nRight - nLeft ) / 2
Local nWidth := nRight - nLeft
Local cCode := ""

Printer oPrn Preview
Define Font oFont Name "Arial" Size 0, -10 of oPrn
Define Pen oPen Width 05 Color CLR_BLACK of oPrn
Page
oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
oPrn:Say( nTop,nLeft,"WideText",oFont,,,,PAD_LEFT )
cCode := "oPrn:Say( nTop,nLeft,'WideText',oFont,,,,PAD_LEFT )"
oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT )

nTop += 100
nBottom += 100
oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
oPrn:Say( nTop,nRight,"WideText",oFont,,,,PAD_RIGHT )
oPrn:Say( nTop,nRight,"WideText",oFont,,,,PAD_RIGHT )
cCode := "oPrn:Say( nTop,nRight,'WideText',oFont,,,,PAD_RIGHT )"
oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT )

nTop += 100
nBottom += 100
oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
oPrn:Say( nTop,nCenter,'WideText',oFont,,,,PAD_CENTER )
cCode := "oPrn:Say( nTop,nCenter,'WideText',oFont,,,,PAD_CENTER )"
oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT )

nTop += 150
nBottom += 150
oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
oPrn:Say( nTop,nLeft,"WideText",oFont,nWidth,,,PAD_LEFT )
cCode := "oPrn:Say( nTop,nLeft,'WideText',oFont,nWidth,,,PAD_LEFT )"
oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT )

nTop += 100
nBottom += 100
oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
oPrn:Say( nTop,nRight,"WideText",oFont,nWidth,,,PAD_RIGHT )
cCode := "oPrn:Say( nTop,nRight,'WideText',oFont,nWidth,,,PAD_RIGHT )"
oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT )

nTop += 100
nBottom += 100
oPrn:Box( nTop,nLeft,nBottom,nRight,oPen )
oPrn:Say( nTop,nCenter,'WideText',oFont,nWidth,,,PAD_CENTER )
cCode := "oPrn:Say( nTop,nCenter,'WideText',oFont,nWidth,,,PAD_CENTER )"
oPrn:Say( nTop,nRight + 350 ,cCode,oFont,,,,PAD_LEFT )

EndPage
EndPrint
Return nil
byron.hopp
 
Posts: 356
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 33 guests