From 46bb89e7daeec84a9c0007f696668a0d52adc252 Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Sun, 24 Dec 2006 12:47:15 +0100 Subject: [PATCH] usp10: Implement ScriptStringGetLogicalWidths. --- dlls/usp10/usp10.c | 33 +++++++++++++++++++++++++++++++++ dlls/usp10/usp10.spec | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 360d24e931..b9a8b62697 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -1425,6 +1425,39 @@ HRESULT WINAPI ScriptLayout(int runs, const BYTE *level, int *vistolog, int *log return S_OK; } +/*********************************************************************** + * ScriptStringGetLogicalWidths (USP10.@) + * + * Returns logical widths from a string analysis. + * + * PARAMS + * ssa [I] string analysis. + * piDx [O] logical widths returned. + * + * RETURNS + * Success: S_OK + * Failure: a non-zero HRESULT. + */ +HRESULT WINAPI ScriptStringGetLogicalWidths(SCRIPT_STRING_ANALYSIS ssa, int *piDx) +{ + int i, j, next = 0; + StringAnalysis *analysis = ssa; + + TRACE("%p, %p\n", ssa, piDx); + + if (!analysis) return S_FALSE; + + for (i = 0; i < analysis->numItems; i++) + { + for (j = 0; j < analysis->glyphs[i].numGlyphs; j++) + { + piDx[next] = analysis->glyphs[i].piAdvance[j]; + next++; + } + } + return S_OK; +} + /*********************************************************************** * ScriptStringValidate (USP10.@) * diff --git a/dlls/usp10/usp10.spec b/dlls/usp10/usp10.spec index 83e97bad37..8051da2335 100644 --- a/dlls/usp10/usp10.spec +++ b/dlls/usp10/usp10.spec @@ -20,7 +20,7 @@ @ stdcall ScriptStringAnalyse(ptr ptr long long long long long ptr ptr ptr ptr ptr ptr) @ stdcall ScriptStringCPtoX(ptr long long ptr) @ stdcall ScriptStringFree(ptr) -@ stub ScriptStringGetLogicalWidths +@ stdcall ScriptStringGetLogicalWidths(ptr ptr) @ stub ScriptStringGetOrder @ stdcall ScriptStringOut(ptr long long long ptr long long long) @ stdcall ScriptStringValidate(ptr)