0

DelphiでUniscribeDll(usp10.dll)のScriptGetPropertiesAPIを使用するにはどうすればよいですか。

C ++で例を見つけましたが、Cが苦手なので、翻訳方法がわかりません。

const SCRIPT_PROPERTIES **g_ppScriptProperties;
int g_iMaxScript;

WCHAR *pwcInChars = L"Unicode string to itemize";
int cInChars = wcslen(pwcInChars);
const int cMaxItems = 20;
SCRIPT_ITEM si[cMaxItems + 1];
SCRIPT_ITEM *pItems = si;
int cItems;

ScriptGetProperties(&g_ppScriptProperties,
                    &g_iMaxScript);

HRESULT hResult = ScriptItemize(pwcInChars,
                                cInChars,
                                cMaxItems,
                                NULL,
                                NULL,
                                pItems,
                                &cItems);
if (hResult == 0) {
    for (int i=0; i<cItems; i++) {
        if (g_ppScriptProperties[pItems[i].a.eScript]->fComplex) {

            // Item [i] is complex script text
            // requiring glyph shaping.

        } else {

            // The text may be rendered legibly without using Uniscribe. 
            // However, Uniscribe may still be used as a means of accessing 
            // font typographic features. 
        }
    }
} else {
    // Handle the error.
}

Delphiコードは、TurboDelphi2006以降に準拠している必要があります。

4

1 に答える 1

1

ライブラリの操作を開始する前に、ライブラリのヘッダーファイルを.pasファイルに変換する必要があります。開始点については、ボブ博士のヘッダーコンバーターを参照してください。変換されるヘッダーには、構造体、関数、列挙型、単純型などのみが含まれている必要があります。クラス宣言、グローバル変数、マクロなどがある場合は、Delphiに変換する中間.hが必要になる可能性があります。

幸運を。

于 2010-05-05T16:58:19.303 に答える