首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Delphi中使用ScriptGetProperties

在Delphi中使用ScriptGetProperties
EN

Stack Overflow用户
提问于 2010-05-05 18:22:21
回答 1查看 483关注 0票数 0

如何在ScriptGetProperties中使用Uniscribe Dll (usp10.dll)中的Delphi

我在C++中找到了一个例子,但我不知道如何翻译它,因为我不擅长C语言。

代码语言:javascript
复制
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代码应符合Turbo Delphi 2006或更高版本。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-05-06 00:58:19

在开始使用该库之前,您需要将其头文件转换为.pas文件。有关起点,请参阅Dr. Bob's header converter。被转换的头应该只有结构,函数,枚举,简单类型等。如果有类声明,全局变量,宏等,你很可能需要一个中间的.h来翻译成Delphi。

祝好运。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2772307

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档