Problem/Issue 5132
 
Query for PDR ID
Example: search for PDR ID 109-9999 , just enter 9999 into the entry field and press ENTER.
Open Build: Open Date: Language:
1.80.284 25.10.2002 (All)
Closed Build: Close Date: Platform:
1.82.302 13.04.2004 W98SE
State: Reference PDR ID: Hotfix Rollup No.:
CLOSED    
Symptom:
XbpCRT displays strings with leading spaces in a wrong way
Description:
Using member :fontWidth of XbpCRT objects to specify a font width other
than the default font width can yield incorrect string output.

If @SAY is used to output a string with leading spaces for example,
character placement may differ from the output produced when using
the trimmed string.

  cStr := "test"
  @ 26,0 SAY REPLICATE(" ", 4) + cStr
  @ 26,4 SAY LTrim( cStr )

The output produced by the two @SAY commands above should be the same.
However, the anomaly described above may cause the character positions
to be slightly different. This occurs because the font (width) used by
the operating system for character output differs from the one reported
to the Xbase++ application. This causes the second statement above
(which addresses a specific column) to produce output that is slightly
off.

NOTE: This anomaly only occurs on Windows 9x platforms and affects only
the x-coordinate used for output (column position).

NOTE: Only some applications are affected by this anomaly!

NOTE: This anomaly may also affect Xbase PARTs and output made via the
function GraStringAt(). See PDR 5330 for further info.





















Solution:
A work-around for this problem is available via Public Fix Level
(PFL) 182306. The work-around lessens the effects of said anomaly.
Since the problems is caused by the operating system, we cannot
guarantee correct behaviour in all cases. Please visit
www.alaska-software.com (support section) for further information.

This anomaly seems to be produced by rounding errors within the
operating system, causing the font width reported to be incorrect
for certain font width/height rations. If you are using font widths
other than the defaults (the width the font was originally designed
for), carefully test character placement in your application's output
on Windows 9.x. If this anomaly affects your application, try
specifying a different width/height combination, if possible.

This anomaly normally affects only applications that use coding
patterns similar to the one illustrated above (i.e. inserting/
replacing/overwriting individual characters during output).

The following (pseudo) code can be used to check whether a
certain font width/height combination shows this anomaly:

FUNCTION ValidateFont( oCrt )

#define PDR5132TSTSTR      "    abcdefgUVWXYZ     "
#define PDR5132TSTSTRLEN   22

  LOCAL oPS      := oCrt:presSpace()
  LOCAL oFont
  LOCAL oOldFont
  LOCAL bIsValid := .T.
  LOCAL aBox

  oFont := XbpFont():new()
  oFont:familyName := oCrt:fontName
  oFont:height     := oCrt:fontHeight
  oFont:width      := oCrt:fontWidth
  oFont:fixed      := .T.
  oFont:create()

  oOldFont := GraSetFont( oPS, oFont )
  aBox     := GraQueryTextBox( oPS, PDR5132TSTSTR )
  IF oFont:width * PDR5132TSTSTRLEN != aBox[3,1]-aBox[2,1]
     bIsValid := .F.
  ENDIF

  GraSetFont( oPS, oOldFont )

RETURN bIsValid













 
(C) Copyright Alaska Software Inc. 2008, All rights reserved!
Disclaimer, Limitation of Liability, no Warranty: THE INFORMATION, DOCUMENTS, FILES AND MATERIALS CONTAINED IN THIS SITE ARE PROVIDED "AS IS". ALASKA SOFTWARE DOES NOT WARRANT THE ACCURACY, ADEQUACY OR COMPLETENESS OF THIS INFORMATION AND MATERIALS; THUS EXPRESSLY DISCLAIMS LIABILITY FOR ERRORS OR OMISSIONS IN THIS INFORMATION AND MATERIALS.
WARRANTIES OF ANY KIND, IMPLIED, EXPRESSED OR STATUTORY, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF NON-INFRINGEMENT OF THIRD PARTY RIGHTS, TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR RESOLVEMENT-CLAIMS, ARE DISCLAIMED.