oipi TEXTXY and fonts (OpenInsight 32-bit)
At 03 DEC 2012 04:28:35PM John Bouley wrote:
It appears the following commnd does not work as expected. It places the text left justified. Does the TEXTXY message use the font parameter?
Equate BaseFont$ to "Times New Roman":@fm:"12":@fm:"L":@fm:"0"
Equate BaseFontR$ to "Times New Roman":@fm:"12":@fm:"R":@fm:"0"
x = set_printer("FONT",BaseFont$)
x = set_printer("TEXTXY",Oconv(Check_Amount,"MD2,$"),6.8-LeftMargin$:@fm:4.9,BaseFontR$,0)
Thanks,
John
At 03 DEC 2012 06:52PM Colin Rule wrote:
I have found this an issue for years, but not sure if it is still an issue, I just do it differently always as a result.
Use CALCTEXT to calculate the length, then based on the alignment, you can adjust the position coordinates.
TEXT_WIDTH=""
IF JUST#"L" THEN
CALL SET_PRINTER("CALCTEXT",TEXT)TEXT_SIZES=GET_PRINTER("CALCTEXT")TEXT_WIDTH =TEXT_SIZES<1>TEXT_HEIGHT=TEXT_SIZES<2>END
BEGIN CASE
CASE NOT(NUM(TEXT_WIDTH))CASE JUST="L"CASE JUST="R" ;COORDS<1>=COORDS<1>-TEXT_WIDTHCASE JUST="C" ;COORDS<1>=COORDS<1>-(TEXT_WIDTH/2)END CASE
ERROR=SET_PRINTER("TEXTXY",TEXT,COORDS,"",0)
At 03 DEC 2012 07:42PM john bouley wrote:
Thanks for the confirmation. I will adjust my coding.
At 05 DEC 2012 10:09AM Carl Pates wrote:
John,
I don't think that's a bug - TEXTXY allow you to put the text at the precise X and Y coordinates you specify - justification only really applies if you're in a situation where you are using just a Y coordinate, like the normal TEXT function.
World leaders in all things RevSoft
At 04 DEC 2012 06:32PM John Bouley wrote:
Understood. I just "thought" that if the font passed in the textxy was right justified the text would end at that possision.
Thanks,
John
At 04 DEC 2012 06:34PM John Bouley wrote:
Should be position. :)
At 05 DEC 2012 10:00AM Bob Orsini wrote:
John, right now the TEXTXY command does not use the justification part of the font. Not sure what we would right justify it to.
At 05 DEC 2012 10:34AM Dave Harmacek wrote:
John, I consider using ADDTABLE since it has column justification.
Dave Harmacek
Harmacek Database Systems