From e94d3dc399f357f397ff956062f0ea233cb17720 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Mon, 4 Jan 2010 20:48:31 +0000 Subject: [PATCH] - Revert changes in font. svn path=/trunk/; revision=44933 --- .../subsystems/win32/win32k/objects/font.c | 193 +----------------- 1 file changed, 4 insertions(+), 189 deletions(-) diff --git a/reactos/subsystems/win32/win32k/objects/font.c b/reactos/subsystems/win32/win32k/objects/font.c index a9b795a56c0..41a75cdb43f 100644 --- a/reactos/subsystems/win32/win32k/objects/font.c +++ b/reactos/subsystems/win32/win32k/objects/font.c @@ -75,19 +75,7 @@ GreGetKerningPairs( return Count; } -/* - It is recommended that an application use the GetFontLanguageInfo function - to determine whether the GCP_DIACRITIC, GCP_DBCS, GCP_USEKERNING, GCP_LIGATE, - GCP_REORDER, GCP_GLYPHSHAPE, and GCP_KASHIDA values are valid for the - currently selected font. If not valid, GetCharacterPlacement ignores the - value. - - M$ must use a preset "compiled in" support for each language based releases. - ReactOS uses FreeType, this will need to be supported. ATM this is hard coded - for GCPCLASS_LATIN! - - */ DWORD FASTCALL GreGetCharacterPlacementW( @@ -98,185 +86,16 @@ GreGetCharacterPlacementW( LPGCP_RESULTSW pgcpw, DWORD dwFlags) { - GCP_RESULTSW gcpwSave; - UINT i, nSet, cSet; -// INT *lpDx, *tmpDxCaretPos; - INT *tmpDxCaretPos; - LONG Cx; SIZE Size = {0,0}; - DPRINT1("GreGCPW Start\n"); - if (!pgcpw) { if (GreGetTextExtentW( hdc, pwsz, nCount, &Size, 1)) return MAKELONG(Size.cx, Size.cy); return 0; } - - RtlCopyMemory(&gcpwSave, pgcpw, sizeof(GCP_RESULTSW)); - - cSet = nSet = nCount; - - if ( nCount > gcpwSave.nGlyphs ) cSet = gcpwSave.nGlyphs; - - /* GCP_JUSTIFY may only be used in conjunction with GCP_MAXEXTENT. */ - if ( dwFlags & GCP_JUSTIFY) dwFlags |= GCP_MAXEXTENT; - - if ( !gcpwSave.lpDx && gcpwSave.lpCaretPos ) - tmpDxCaretPos = gcpwSave.lpCaretPos; - else - tmpDxCaretPos = gcpwSave.lpDx; - - if ( !GreGetTextExtentExW( hdc, - pwsz, - cSet, - nMaxExtent, - ((dwFlags & GCP_MAXEXTENT) ? (PULONG) &cSet : NULL), - (PULONG) tmpDxCaretPos, - &Size, - 0) ) - { - return 0; - } - - nSet = cSet; - - if ( tmpDxCaretPos && nSet > 0) - { -// lpDx = tmpDxCaretPos + 4 * nSet - 4; -// lpDx = tmpDxCaretPos[nSet - 1]; -/* while ( lpDx > tmpDxCaretPos ) - { - *lpDx -= *lpDx - 4; - lpDx -= 4; - }*/ - for (i = (nSet - 1); i > 0; i--) - { - tmpDxCaretPos[i] -= tmpDxCaretPos[i - 1]; - } - } - - if ( !(dwFlags & GCP_MAXEXTENT) || nSet ) - { - if ( (dwFlags & GCP_USEKERNING) && - ( gcpwSave.lpDx || - gcpwSave.lpCaretPos ) && - nSet >= 2 ) - { - DWORD Count; - LPKERNINGPAIR pKP; - - Count = GreGetKerningPairs( hdc, 0, NULL); - if (Count) - { - pKP = ExAllocatePoolWithTag(PagedPool, Count * sizeof(KERNINGPAIR), GDITAG_TEXT); - if (pKP) - { - if ( GreGetKerningPairs( hdc, Count, pKP) != Count) - { - ExFreePoolWithTag( pKP, GDITAG_TEXT); - return 0; - } - - if ( (ULONG_PTR)(pKP) < ((ULONG_PTR)(pKP) + (ULONG_PTR)(Count * sizeof(KERNINGPAIR))) ) - { - DPRINT1("We Need to Do Something HERE!\n"); - } - - ExFreePoolWithTag( pKP, GDITAG_TEXT); - - if ( dwFlags & GCP_MAXEXTENT ) - { -// Cx = Size.cx; - if ( Size.cx > nMaxExtent ) - { -// lpDx = tmpDxCaretPos + 4 * nSet - 4; -// lpDx = tmpDxCaretPos[nSet - 1]; -/* - while ( 1 ) - { - if ( !nSet ) break; - - Cx -= *lpDx; - --nSet; - lpDx -= 4; - - Size.cx = Cx; - - if ( Cx <= nMaxExtent ) break; - }*/ - for (Cx = Size.cx; nSet > 0; nSet--) - { - Cx -= tmpDxCaretPos[nSet - 1]; - Size.cx = Cx; - if ( Cx <= nMaxExtent ) break; - } - } - if ( !nSet ) - { - pgcpw->nGlyphs = 0; - pgcpw->nMaxFit = 0; - return 0; - } - } - } - } - } - - if ( (dwFlags & GCP_JUSTIFY) && - ( gcpwSave.lpDx || - gcpwSave.lpCaretPos ) && - nSet ) - { - DPRINT1("We Need to Do Something HERE 2!\n"); - } - - if ( gcpwSave.lpDx && gcpwSave.lpCaretPos ) - RtlCopyMemory( gcpwSave.lpCaretPos, gcpwSave.lpDx, nSet * sizeof(LONG)); - - if ( gcpwSave.lpCaretPos ) - { - int pos = 0; - i = 0; - if ( nSet > 0 ) - { - do - { - Cx = gcpwSave.lpCaretPos[i]; - gcpwSave.lpCaretPos[i] = pos; - pos += Cx; - ++i; - } - while ( i < nSet ); - } - } - - if ( gcpwSave.lpOutString ) - RtlCopyMemory(gcpwSave.lpOutString, pwsz, nSet * sizeof(WCHAR)); - - if ( gcpwSave.lpClass ) - RtlFillMemory(gcpwSave.lpClass, nSet, GCPCLASS_LATIN); - - if ( gcpwSave.lpOrder ) - { - for (i = 0; i < nSet; i++) - gcpwSave.lpOrder[i] = i; - } - - if ( gcpwSave.lpGlyphs ) - { - if ( GreGetGlyphIndicesW( hdc, pwsz, nSet, gcpwSave.lpGlyphs, 0, 0) == GDI_ERROR ) - { - nSet = 0; - Size.cx = 0; - Size.cy = 0; - } - } - pgcpw->nGlyphs = nSet; - pgcpw->nMaxFit = nSet; - } - return MAKELONG(Size.cx, Size.cy); + UNIMPLEMENTED; + return 0; } INT @@ -494,12 +313,8 @@ NtGdiGetCharacterPlacementW( IN OUT LPGCP_RESULTSW pgcpw, IN DWORD dwFlags) { - return GreGetCharacterPlacementW( hdc, - pwsz, - nCount, - nMaxExtent, - pgcpw, - dwFlags); + UNIMPLEMENTED; + return 0; } DWORD