From ca55584b1967c1d36b1b59ca7aafa97bcbbe3107 Mon Sep 17 00:00:00 2001 From: Jeff Latimer Date: Thu, 13 Apr 2006 18:38:31 +1000 Subject: [PATCH] usp10: Add some tests to ScriptGetFontProperties. --- dlls/usp10/usp10.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 030498fba2c..b0e7ce81d8a 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -124,10 +124,31 @@ HRESULT WINAPI ScriptGetProperties(const SCRIPT_PROPERTIES ***ppSp, int *piNumSc */ HRESULT WINAPI ScriptGetFontProperties(HDC hdc, SCRIPT_CACHE *psc, SCRIPT_FONTPROPERTIES *sfp) { + HDC phdc; + Scriptcache *pScriptcache; + FIXME("%p,%p,%p\n", hdc, psc, sfp); + if (!hdc && !*psc) { + TRACE("No Script_Cache (psc) and no hdc. Ask for one. Hdc=%p, psc=%p\n", hdc, *psc); + return E_PENDING; + } else + if (hdc && !*psc) { + pScriptcache = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(Scriptcache) ); + pScriptcache->hdc = (HDC) hdc; + phdc = hdc; + pScriptcache->HaveWidths = 0; + *psc = (Scriptcache *) pScriptcache; + } else + if (*psc) { + pScriptcache = (Scriptcache *) *psc; + phdc = pScriptcache->hdc; + } + + if (sfp->cBytes != sizeof(SCRIPT_FONTPROPERTIES)) + return E_INVALIDARG; + /* return something sensible? */ if (NULL != sfp) { - sfp->cBytes = sizeof(SCRIPT_FONTPROPERTIES); sfp->wgBlank = 0; sfp->wgDefault = 0; sfp->wgInvalid = 0; @@ -427,10 +448,6 @@ HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs, return 0; } -/*********************************************************************** - * ScriptGetCMap (USP10.@) - * - */ /*********************************************************************** * ScriptGetCMap (USP10.@) *