Changeset 10600 for trunk/src


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

KOM: DBCS updates

Location:
trunk/src/gdi32
Files:
2 edited

Legend:

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

    r10403 r10600  
    262262
    263263        DecreaseLogCount();
    264         if(GetTextMetricsW( hps, &tmW ) == TRUE) 
     264        if(GetTextMetricsW( hps, &tmW ) == TRUE)
    265265        {
    266266            pwidthHeight->y = tmW.tmHeight;    // *Must* use the maximum height of the font
     
    316316    int   len;
    317317    LPSTR astring;
     318    LPINT lpDx = NULL;
    318319
    319320    pDCData pHps = (pDCData)OSLibGpiQueryDCData(hps);
     
    323324    lstrcpynWtoA(astring, pchString, len + 1 );
    324325
     326    if( IsDBCSEnv() && alAdx )
     327    {
     328        int i, j;
     329
     330        lpDx = ( LPINT )malloc( len * sizeof( INT ));
     331        for( i = j = 0; i < len; i++, j++ )
     332        {
     333            lpDx[ i ] = alAdx[ j ];
     334            if( IsDBCSLeadByte( astring[ i ]))
     335                lpDx[ ++i ] = 0;
     336        }
     337
     338        alAdx = ( CONST INT * )lpDx;
     339    }
     340
    325341    ret = OSLibGpiCharStringPosAt(pHps,ptl,rct,flOptions,len,astring,alAdx);
     342
     343    if( lpDx )
     344        free( lpDx );
     345
    326346    free(astring);
     347
    327348    return ret;
    328349}
  • 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.