0
使用ScriptGetProperties我如何在Delphi用Delphi
使用ScriptGetProperties API的Uniscribe从DLL(的usp10.dll),我发现在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代码应该符合Turbo Delphi 2006或更高版本。
你可以帮忙翻译你已经知道的东西。询问关于你不知道的事情。 – 2010-05-05 11:48:54
哪个部位有问题?请注意,你实际上没有*提出问题*。 – 2010-05-05 13:40:45
Lars&Rob,我编辑了这个问题,我需要如何在Delphi中使用ScriptGetProperties API,很抱歉,如果我一开始并不清楚。 – 2010-05-05 14:31:24