diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index 567884a3c29..e56552a4d85 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -377,7 +377,7 @@ IntLoadFontSubstList(PLIST_ENTRY pHead) } /* query value */ - Status = ZwQueryValueKey(KeyHandle, &FromW, KeyValueFullInformation, + Status = ZwQueryValueKey(KeyHandle, &FromW, KeyValueFullInformation, InfoBuffer, sizeof(InfoBuffer), &Length); pInfo = (PKEY_VALUE_FULL_INFORMATION)InfoBuffer; if (!NT_SUCCESS(Status) || !pInfo->DataLength) @@ -1132,7 +1132,7 @@ IntGdiAddFontResource(PUNICODE_STRING FileName, DWORD Characteristics) SIZE_T ViewSize = 0; LARGE_INTEGER SectionSize; OBJECT_ATTRIBUTES ObjectAttributes; - GDI_LOAD_FONT LoadFont; + GDI_LOAD_FONT LoadFont; INT FontCount; HANDLE KeyHandle; static const UNICODE_STRING TrueTypePostfix = RTL_CONSTANT_STRING(L" (TrueType)"); @@ -1242,7 +1242,6 @@ IntGdiAddFontMemResource(PVOID Buffer, DWORD dwSize, PDWORD pNumAdded) HANDLE Ret = 0; PVOID BufferCopy = ExAllocatePoolWithTag(PagedPool, dwSize, TAG_FONT); - if (!BufferCopy) { *pNumAdded = 0; @@ -1552,7 +1551,6 @@ static BOOL face_has_symbol_charmap(FT_Face ft_face) return FALSE; } - static void FASTCALL FillTMEx(TEXTMETRICW *TM, PFONTGDI FontGDI, TT_OS2 *pOS2, TT_HoriHeader *pHori, @@ -1633,9 +1631,7 @@ FillTMEx(TEXTMETRICW *TM, PFONTGDI FontGDI, TM->tmAveCharWidth = (FT_MulFix(pOS2->xAvgCharWidth, XScale) + 32) >> 6; if (TM->tmAveCharWidth == 0) - { TM->tmAveCharWidth = 1; - } /* Correct forumla to get the maxcharwidth from unicode and ansi font */ TM->tmMaxCharWidth = (FT_MulFix(Face->max_advance_width, XScale) + 32) >> 6; @@ -2319,7 +2315,7 @@ FontFamilyFillInfo(PFONTFAMILYINFO Info, LPCWSTR FaceName, /* full name */ if (!FullName) FullName = (WCHAR*)((ULONG_PTR) Otm + (ULONG_PTR)Otm->otmpFaceName); - + RtlStringCbCopyW(Info->EnumLogFontEx.elfFullName, sizeof(Info->EnumLogFontEx.elfFullName), FullName); @@ -3173,7 +3169,6 @@ ftGdiGetGlyphOutline( FT_Matrix ftmatrix; FLOATOBJ efTemp; - PMATRIX pmx = DC_pmxWorldToDevice(dc); /* Create a freetype matrix, by converting to 16.16 fixpoint format */ @@ -3770,6 +3765,9 @@ ftGetFontUnicodeRanges(PFONTGDI Font, PGLYPHSET glyphset) DWORD num_ranges = 0; FT_Face face = Font->SharedFace->Face; + if (face->charmap == NULL) + return 0; + if (face->charmap->encoding == FT_ENCODING_UNICODE) { FT_UInt glyph_code = 0; @@ -4246,7 +4244,7 @@ GetFontPenalty(const LOGFONTW * LogFont, if (Long != TM->tmWeight) { /* Weight Penalty 3 */ - /* The candidate's weight does not match the requested weight. + /* The candidate's weight does not match the requested weight. Penalty * (weight difference/10) */ Penalty += 3 * (labs(Long - TM->tmWeight) / 10); } @@ -4481,9 +4479,6 @@ TextIntRealizeFont(HFONT FontHandle, PTEXTOBJ pTextObj) FontGdi->RequestWeight = FW_NORMAL; Face = FontGdi->SharedFace->Face; - - //FontGdi->OriginalWeight = WeightFromStyle(Face->style_name); - if (!FontGdi->OriginalItalic) FontGdi->OriginalItalic = ItalicFromStyle(Face->style_name); @@ -5519,7 +5514,7 @@ GreExtTextOutW( FLOATOBJ_Set1(&Scale); /* do the shift before multiplying to preserve precision */ - FLOATOBJ_MulLong(&Scale, Dx[i<bitmap.pitch, BMF_8BPP, BMF_TOPDOWN, realglyph->bitmap.buffer); - if ( !HSourceGlyph ) + if (!HSourceGlyph) { DPRINT1("WARNING: EngCreateBitmap() failed!\n"); - // FT_Done_Glyph(realglyph); bResult = FALSE; break; } SourceGlyphSurf = EngLockSurface((HSURF)HSourceGlyph); - if ( !SourceGlyphSurf ) + if (!SourceGlyphSurf) { EngDeleteSurface((HSURF)HSourceGlyph); DPRINT1("WARNING: EngLockSurface() failed!\n"); @@ -5783,7 +5777,7 @@ GreExtTextOutW( FLOATOBJ_Set1(&Scale); /* do the shift before multiplying to preserve precision */ - FLOATOBJ_MulLong(&Scale, Dx[i<Font, FONT); TEXTOBJ_UnlockText(TextObj); @@ -6434,7 +6426,6 @@ NtGdiGetGlyphIndicesW( pwcSize = cwc * sizeof(WCHAR); Safepwc = ExAllocatePoolWithTag(PagedPool, pwcSize, GDITAG_TEXT); - if (!Safepwc) { Status = STATUS_NO_MEMORY; @@ -6455,7 +6446,6 @@ NtGdiGetGlyphIndicesW( if (!NT_SUCCESS(Status)) goto ErrorRet; IntLockFreeType; - for (i = 0; i < cwc; i++) { Buffer[i] = FT_Get_Char_Index(FontGDI->SharedFace->Face, Safepwc[i]); @@ -6464,7 +6454,6 @@ NtGdiGetGlyphIndicesW( Buffer[i] = DefChar; } } - IntUnLockFreeType; _SEH2_TRY