Ignore:
Timestamp:
May 7, 2004, 12:27:50 PM (21 years ago)
Author:
sandervl
Message:

KOM: DBCS updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/text.cpp

    r10594 r10600  
    1 /* $Id: text.cpp,v 1.44 2004-04-30 13:27:19 sandervl Exp $ */
     1/* $Id: text.cpp,v 1.45 2004-05-07 10:27:50 sandervl Exp $ */
    22
    33/*
     
    306306  if(fUnicode)
    307307       hits = FT2Module.Ft2CharStringPosAtW(pHps->hps,&ptl,&pmRect,flOptions,cbCount,lpszStringW,lpDx, fuOptions & ETO_GLYPH_INDEX);
    308   else hits = FT2Module.Ft2CharStringPosAtA(pHps->hps,&ptl,&pmRect,flOptions,cbCount,lpszStringA,lpDx, fuOptions & ETO_GLYPH_INDEX);
     308  else
     309  {
     310       INT *lpDxNew = NULL;
     311
     312       // KOMH : OS/2 uses width of lead byte for whole DBCS width and is not concerned about
     313       //        trail byte, while Win can apportion width between lead byte and trail byte
     314       if( IsDBCSEnv() && lpDx  )
     315       {
     316            int i;
     317
     318            lpDxNew = ( INT * )malloc(( cbCount + 1 ) * sizeof( INT )); // 1 for broken DBCS char
     319            for( i = 0; i < cbCount; i++ )
     320            {
     321                lpDxNew[ i ] = lpDx[ i ];
     322                if( IsDBCSLeadByte( lpszStringA[ i ] ))
     323                {
     324                    lpDxNew[ i ] += lpDx[ i + 1 ];
     325                    lpDxNew[ ++i ] = 0; // for the sake of possibility
     326                }
     327            }
     328
     329            lpDx = lpDxNew;
     330       }
     331
     332       hits = FT2Module.Ft2CharStringPosAtA(pHps->hps,&ptl,&pmRect,flOptions,cbCount,lpszStringA,lpDx, fuOptions & ETO_GLYPH_INDEX);
     333
     334       if( lpDxNew )
     335            free( lpDxNew );
     336  }
    309337
    310338  if (lprc && ((align & 0x18) == TA_BASELINE))
     
    356384      }
    357385  }
     386
    358387  rc = InternalTextOutAW(hdc, X, Y, fuOptions, lprc, lpszString, NULL, cbCount, lpDx, TRUE, FALSE);
    359388
Note: See TracChangeset for help on using the changeset viewer.