ホーム › Globalization › ScriptGetFontLanguageTags
ScriptGetFontLanguageTags
関数指定スクリプトでフォントが対応する言語システムタグを取得する。
シグネチャ
// USP10.dll
#include <windows.h>
HRESULT ScriptGetFontLanguageTags(
HDC hdc, // optional
void** psc,
SCRIPT_ANALYSIS* psa, // optional
DWORD tagScript,
INT cMaxTags,
DWORD* pLangsysTags,
INT* pcTags
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hdc | HDC | inoptional | デバイスコンテキストへのハンドル。詳細については、Caching を参照してください。 |
| psc | void** | inout | スクリプトキャッシュを識別する SCRIPT_CACHE 構造体へのポインター。 |
| psa | SCRIPT_ANALYSIS* | inoptional | ScriptItemizeOpenType の以前の呼び出しから取得した SCRIPT_ANALYSIS 構造体へのポインター。このパラメーターはシェーピングエンジンを識別し、適切なフォントおよびスクリプトに対応するフォント言語タグを取得できるようにします。 あるいは、アプリケーションはこのパラメーターを NULL に設定して、フィルター処理されていない結果を取得することもできます。 |
| tagScript | DWORD | in | 関連付けられた言語タグの一覧を要求するスクリプトタグを定義する OPENTYPE_TAG 構造体。 |
| cMaxTags | INT | in | pLangSysTags で指定された配列の長さ。 |
| pLangsysTags | DWORD* | out | 入力条件に一致する言語タグを識別する OPENTYPE_TAG 構造体の配列を、この関数が取得するバッファーへのポインター。 |
| pcTags | INT* | out | 言語タグ配列内の要素数へのポインター。 |
戻り値の型: HRESULT
公式ドキュメント
指定された項目で利用可能であり、OpenType 処理用に指定されたスクリプトタグでサポートされている言語タグの一覧を取得します。一覧を構成するタグは、指定されたデバイスコンテキストまたはキャッシュ内のフォントから取得されます。
戻り値
成功した場合は 0 を返します。成功しなかった場合、この関数は 0 以外の HRESULT 値を返します。アプリケーションは、SUCCEEDED マクロおよび FAILED マクロを使用して戻り値をテストできます。
一致するタグの数が cMaxTags を超える場合、この関数は E_OUTOFMEMORY で失敗します。アプリケーションは、より大きなバッファーを指定して再度呼び出すことができます。
解説(Remarks)
OPENTYPE_TAG 構造体は形式上は ULONG 型として宣言されていますが、スペース、A〜Z、または a〜z の 4 つの 8 ビット ASCII 値を含む 4 バイトの配列を含みます。たとえば、ルーマニア語、ウルドゥー語、ペルシャ語の言語タグは、それぞれ "ROM "、"URD "、"FAR " です。各タグはスペースで終わることに注意してください。
重要 Windows 8 以降: Windows 7 上での実行能力を維持するため、Uniscribe を使用するモジュールは、ライブラリ一覧で gdi32.lib より前に Usp10.lib を指定する必要があります。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// USP10.dll
#include <windows.h>
HRESULT ScriptGetFontLanguageTags(
HDC hdc, // optional
void** psc,
SCRIPT_ANALYSIS* psa, // optional
DWORD tagScript,
INT cMaxTags,
DWORD* pLangsysTags,
INT* pcTags
);[DllImport("USP10.dll", ExactSpelling = true)]
static extern int ScriptGetFontLanguageTags(
IntPtr hdc, // HDC optional
IntPtr psc, // void** in/out
IntPtr psa, // SCRIPT_ANALYSIS* optional
uint tagScript, // DWORD
int cMaxTags, // INT
out uint pLangsysTags, // DWORD* out
out int pcTags // INT* out
);<DllImport("USP10.dll", ExactSpelling:=True)>
Public Shared Function ScriptGetFontLanguageTags(
hdc As IntPtr, ' HDC optional
psc As IntPtr, ' void** in/out
psa As IntPtr, ' SCRIPT_ANALYSIS* optional
tagScript As UInteger, ' DWORD
cMaxTags As Integer, ' INT
<Out> ByRef pLangsysTags As UInteger, ' DWORD* out
<Out> ByRef pcTags As Integer ' INT* out
) As Integer
End Function' hdc : HDC optional
' psc : void** in/out
' psa : SCRIPT_ANALYSIS* optional
' tagScript : DWORD
' cMaxTags : INT
' pLangsysTags : DWORD* out
' pcTags : INT* out
Declare PtrSafe Function ScriptGetFontLanguageTags Lib "usp10" ( _
ByVal hdc As LongPtr, _
ByVal psc As LongPtr, _
ByVal psa As LongPtr, _
ByVal tagScript As Long, _
ByVal cMaxTags As Long, _
ByRef pLangsysTags As Long, _
ByRef pcTags As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ScriptGetFontLanguageTags = ctypes.windll.usp10.ScriptGetFontLanguageTags
ScriptGetFontLanguageTags.restype = ctypes.c_int
ScriptGetFontLanguageTags.argtypes = [
wintypes.HANDLE, # hdc : HDC optional
ctypes.c_void_p, # psc : void** in/out
ctypes.c_void_p, # psa : SCRIPT_ANALYSIS* optional
wintypes.DWORD, # tagScript : DWORD
ctypes.c_int, # cMaxTags : INT
ctypes.POINTER(wintypes.DWORD), # pLangsysTags : DWORD* out
ctypes.POINTER(ctypes.c_int), # pcTags : INT* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('USP10.dll')
ScriptGetFontLanguageTags = Fiddle::Function.new(
lib['ScriptGetFontLanguageTags'],
[
Fiddle::TYPE_VOIDP, # hdc : HDC optional
Fiddle::TYPE_VOIDP, # psc : void** in/out
Fiddle::TYPE_VOIDP, # psa : SCRIPT_ANALYSIS* optional
-Fiddle::TYPE_INT, # tagScript : DWORD
Fiddle::TYPE_INT, # cMaxTags : INT
Fiddle::TYPE_VOIDP, # pLangsysTags : DWORD* out
Fiddle::TYPE_VOIDP, # pcTags : INT* out
],
Fiddle::TYPE_INT)#[link(name = "usp10")]
extern "system" {
fn ScriptGetFontLanguageTags(
hdc: *mut core::ffi::c_void, // HDC optional
psc: *mut *mut (), // void** in/out
psa: *mut SCRIPT_ANALYSIS, // SCRIPT_ANALYSIS* optional
tagScript: u32, // DWORD
cMaxTags: i32, // INT
pLangsysTags: *mut u32, // DWORD* out
pcTags: *mut i32 // INT* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("USP10.dll")]
public static extern int ScriptGetFontLanguageTags(IntPtr hdc, IntPtr psc, IntPtr psa, uint tagScript, int cMaxTags, out uint pLangsysTags, out int pcTags);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USP10_ScriptGetFontLanguageTags' -Namespace Win32 -PassThru
# $api::ScriptGetFontLanguageTags(hdc, psc, psa, tagScript, cMaxTags, pLangsysTags, pcTags)#uselib "USP10.dll"
#func global ScriptGetFontLanguageTags "ScriptGetFontLanguageTags" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; ScriptGetFontLanguageTags hdc, psc, varptr(psa), tagScript, cMaxTags, varptr(pLangsysTags), varptr(pcTags) ; 戻り値は stat
; hdc : HDC optional -> "sptr"
; psc : void** in/out -> "sptr"
; psa : SCRIPT_ANALYSIS* optional -> "sptr"
; tagScript : DWORD -> "sptr"
; cMaxTags : INT -> "sptr"
; pLangsysTags : DWORD* out -> "sptr"
; pcTags : INT* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "USP10.dll" #cfunc global ScriptGetFontLanguageTags "ScriptGetFontLanguageTags" sptr, sptr, var, int, int, var, var ; res = ScriptGetFontLanguageTags(hdc, psc, psa, tagScript, cMaxTags, pLangsysTags, pcTags) ; hdc : HDC optional -> "sptr" ; psc : void** in/out -> "sptr" ; psa : SCRIPT_ANALYSIS* optional -> "var" ; tagScript : DWORD -> "int" ; cMaxTags : INT -> "int" ; pLangsysTags : DWORD* out -> "var" ; pcTags : INT* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "USP10.dll" #cfunc global ScriptGetFontLanguageTags "ScriptGetFontLanguageTags" sptr, sptr, sptr, int, int, sptr, sptr ; res = ScriptGetFontLanguageTags(hdc, psc, varptr(psa), tagScript, cMaxTags, varptr(pLangsysTags), varptr(pcTags)) ; hdc : HDC optional -> "sptr" ; psc : void** in/out -> "sptr" ; psa : SCRIPT_ANALYSIS* optional -> "sptr" ; tagScript : DWORD -> "int" ; cMaxTags : INT -> "int" ; pLangsysTags : DWORD* out -> "sptr" ; pcTags : INT* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT ScriptGetFontLanguageTags(HDC hdc, void** psc, SCRIPT_ANALYSIS* psa, DWORD tagScript, INT cMaxTags, DWORD* pLangsysTags, INT* pcTags) #uselib "USP10.dll" #cfunc global ScriptGetFontLanguageTags "ScriptGetFontLanguageTags" intptr, intptr, var, int, int, var, var ; res = ScriptGetFontLanguageTags(hdc, psc, psa, tagScript, cMaxTags, pLangsysTags, pcTags) ; hdc : HDC optional -> "intptr" ; psc : void** in/out -> "intptr" ; psa : SCRIPT_ANALYSIS* optional -> "var" ; tagScript : DWORD -> "int" ; cMaxTags : INT -> "int" ; pLangsysTags : DWORD* out -> "var" ; pcTags : INT* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT ScriptGetFontLanguageTags(HDC hdc, void** psc, SCRIPT_ANALYSIS* psa, DWORD tagScript, INT cMaxTags, DWORD* pLangsysTags, INT* pcTags) #uselib "USP10.dll" #cfunc global ScriptGetFontLanguageTags "ScriptGetFontLanguageTags" intptr, intptr, intptr, int, int, intptr, intptr ; res = ScriptGetFontLanguageTags(hdc, psc, varptr(psa), tagScript, cMaxTags, varptr(pLangsysTags), varptr(pcTags)) ; hdc : HDC optional -> "intptr" ; psc : void** in/out -> "intptr" ; psa : SCRIPT_ANALYSIS* optional -> "intptr" ; tagScript : DWORD -> "int" ; cMaxTags : INT -> "int" ; pLangsysTags : DWORD* out -> "intptr" ; pcTags : INT* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
usp10 = windows.NewLazySystemDLL("USP10.dll")
procScriptGetFontLanguageTags = usp10.NewProc("ScriptGetFontLanguageTags")
)
// hdc (HDC optional), psc (void** in/out), psa (SCRIPT_ANALYSIS* optional), tagScript (DWORD), cMaxTags (INT), pLangsysTags (DWORD* out), pcTags (INT* out)
r1, _, err := procScriptGetFontLanguageTags.Call(
uintptr(hdc),
uintptr(psc),
uintptr(psa),
uintptr(tagScript),
uintptr(cMaxTags),
uintptr(pLangsysTags),
uintptr(pcTags),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction ScriptGetFontLanguageTags(
hdc: THandle; // HDC optional
psc: Pointer; // void** in/out
psa: Pointer; // SCRIPT_ANALYSIS* optional
tagScript: DWORD; // DWORD
cMaxTags: Integer; // INT
pLangsysTags: Pointer; // DWORD* out
pcTags: Pointer // INT* out
): Integer; stdcall;
external 'USP10.dll' name 'ScriptGetFontLanguageTags';result := DllCall("USP10\ScriptGetFontLanguageTags"
, "Ptr", hdc ; HDC optional
, "Ptr", psc ; void** in/out
, "Ptr", psa ; SCRIPT_ANALYSIS* optional
, "UInt", tagScript ; DWORD
, "Int", cMaxTags ; INT
, "Ptr", pLangsysTags ; DWORD* out
, "Ptr", pcTags ; INT* out
, "Int") ; return: HRESULT●ScriptGetFontLanguageTags(hdc, psc, psa, tagScript, cMaxTags, pLangsysTags, pcTags) = DLL("USP10.dll", "int ScriptGetFontLanguageTags(void*, void*, void*, dword, int, void*, void*)")
# 呼び出し: ScriptGetFontLanguageTags(hdc, psc, psa, tagScript, cMaxTags, pLangsysTags, pcTags)
# hdc : HDC optional -> "void*"
# psc : void** in/out -> "void*"
# psa : SCRIPT_ANALYSIS* optional -> "void*"
# tagScript : DWORD -> "dword"
# cMaxTags : INT -> "int"
# pLangsysTags : DWORD* out -> "void*"
# pcTags : INT* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "usp10" fn ScriptGetFontLanguageTags(
hdc: ?*anyopaque, // HDC optional
psc: ?*anyopaque, // void** in/out
psa: [*c]SCRIPT_ANALYSIS, // SCRIPT_ANALYSIS* optional
tagScript: u32, // DWORD
cMaxTags: i32, // INT
pLangsysTags: [*c]u32, // DWORD* out
pcTags: [*c]i32 // INT* out
) callconv(std.os.windows.WINAPI) i32;proc ScriptGetFontLanguageTags(
hdc: pointer, # HDC optional
psc: pointer, # void** in/out
psa: ptr SCRIPT_ANALYSIS, # SCRIPT_ANALYSIS* optional
tagScript: uint32, # DWORD
cMaxTags: int32, # INT
pLangsysTags: ptr uint32, # DWORD* out
pcTags: ptr int32 # INT* out
): int32 {.importc: "ScriptGetFontLanguageTags", stdcall, dynlib: "USP10.dll".}pragma(lib, "usp10");
extern(Windows)
int ScriptGetFontLanguageTags(
void* hdc, // HDC optional
void** psc, // void** in/out
SCRIPT_ANALYSIS* psa, // SCRIPT_ANALYSIS* optional
uint tagScript, // DWORD
int cMaxTags, // INT
uint* pLangsysTags, // DWORD* out
int* pcTags // INT* out
);ccall((:ScriptGetFontLanguageTags, "USP10.dll"), stdcall, Int32,
(Ptr{Cvoid}, Ptr{Cvoid}, Ptr{SCRIPT_ANALYSIS}, UInt32, Int32, Ptr{UInt32}, Ptr{Int32}),
hdc, psc, psa, tagScript, cMaxTags, pLangsysTags, pcTags)
# hdc : HDC optional -> Ptr{Cvoid}
# psc : void** in/out -> Ptr{Cvoid}
# psa : SCRIPT_ANALYSIS* optional -> Ptr{SCRIPT_ANALYSIS}
# tagScript : DWORD -> UInt32
# cMaxTags : INT -> Int32
# pLangsysTags : DWORD* out -> Ptr{UInt32}
# pcTags : INT* out -> Ptr{Int32}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t ScriptGetFontLanguageTags(
void* hdc,
void** psc,
void* psa,
uint32_t tagScript,
int32_t cMaxTags,
uint32_t* pLangsysTags,
int32_t* pcTags);
]]
local usp10 = ffi.load("usp10")
-- usp10.ScriptGetFontLanguageTags(hdc, psc, psa, tagScript, cMaxTags, pLangsysTags, pcTags)
-- hdc : HDC optional
-- psc : void** in/out
-- psa : SCRIPT_ANALYSIS* optional
-- tagScript : DWORD
-- cMaxTags : INT
-- pLangsysTags : DWORD* out
-- pcTags : INT* out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('USP10.dll');
const ScriptGetFontLanguageTags = lib.func('__stdcall', 'ScriptGetFontLanguageTags', 'int32_t', ['void *', 'void *', 'void *', 'uint32_t', 'int32_t', 'uint32_t *', 'int32_t *']);
// ScriptGetFontLanguageTags(hdc, psc, psa, tagScript, cMaxTags, pLangsysTags, pcTags)
// hdc : HDC optional -> 'void *'
// psc : void** in/out -> 'void *'
// psa : SCRIPT_ANALYSIS* optional -> 'void *'
// tagScript : DWORD -> 'uint32_t'
// cMaxTags : INT -> 'int32_t'
// pLangsysTags : DWORD* out -> 'uint32_t *'
// pcTags : INT* out -> 'int32_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("USP10.dll", {
ScriptGetFontLanguageTags: { parameters: ["pointer", "pointer", "pointer", "u32", "i32", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.ScriptGetFontLanguageTags(hdc, psc, psa, tagScript, cMaxTags, pLangsysTags, pcTags)
// hdc : HDC optional -> "pointer"
// psc : void** in/out -> "pointer"
// psa : SCRIPT_ANALYSIS* optional -> "pointer"
// tagScript : DWORD -> "u32"
// cMaxTags : INT -> "i32"
// pLangsysTags : DWORD* out -> "pointer"
// pcTags : INT* out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t ScriptGetFontLanguageTags(
void* hdc,
void** psc,
void* psa,
uint32_t tagScript,
int32_t cMaxTags,
uint32_t* pLangsysTags,
int32_t* pcTags);
C, "USP10.dll");
// $ffi->ScriptGetFontLanguageTags(hdc, psc, psa, tagScript, cMaxTags, pLangsysTags, pcTags);
// hdc : HDC optional
// psc : void** in/out
// psa : SCRIPT_ANALYSIS* optional
// tagScript : DWORD
// cMaxTags : INT
// pLangsysTags : DWORD* out
// pcTags : INT* out
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Usp10 extends StdCallLibrary {
Usp10 INSTANCE = Native.load("usp10", Usp10.class);
int ScriptGetFontLanguageTags(
Pointer hdc, // HDC optional
Pointer psc, // void** in/out
Pointer psa, // SCRIPT_ANALYSIS* optional
int tagScript, // DWORD
int cMaxTags, // INT
IntByReference pLangsysTags, // DWORD* out
IntByReference pcTags // INT* out
);
}@[Link("usp10")]
lib LibUSP10
fun ScriptGetFontLanguageTags = ScriptGetFontLanguageTags(
hdc : Void*, # HDC optional
psc : Void**, # void** in/out
psa : SCRIPT_ANALYSIS*, # SCRIPT_ANALYSIS* optional
tagScript : UInt32, # DWORD
cMaxTags : Int32, # INT
pLangsysTags : UInt32*, # DWORD* out
pcTags : Int32* # INT* out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef ScriptGetFontLanguageTagsNative = Int32 Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, Uint32, Int32, Pointer<Uint32>, Pointer<Int32>);
typedef ScriptGetFontLanguageTagsDart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Void>, int, int, Pointer<Uint32>, Pointer<Int32>);
final ScriptGetFontLanguageTags = DynamicLibrary.open('USP10.dll')
.lookupFunction<ScriptGetFontLanguageTagsNative, ScriptGetFontLanguageTagsDart>('ScriptGetFontLanguageTags');
// hdc : HDC optional -> Pointer<Void>
// psc : void** in/out -> Pointer<Void>
// psa : SCRIPT_ANALYSIS* optional -> Pointer<Void>
// tagScript : DWORD -> Uint32
// cMaxTags : INT -> Int32
// pLangsysTags : DWORD* out -> Pointer<Uint32>
// pcTags : INT* out -> Pointer<Int32>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function ScriptGetFontLanguageTags(
hdc: THandle; // HDC optional
psc: Pointer; // void** in/out
psa: Pointer; // SCRIPT_ANALYSIS* optional
tagScript: DWORD; // DWORD
cMaxTags: Integer; // INT
pLangsysTags: Pointer; // DWORD* out
pcTags: Pointer // INT* out
): Integer; stdcall;
external 'USP10.dll' name 'ScriptGetFontLanguageTags';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "ScriptGetFontLanguageTags"
c_ScriptGetFontLanguageTags :: Ptr () -> Ptr () -> Ptr () -> Word32 -> Int32 -> Ptr Word32 -> Ptr Int32 -> IO Int32
-- hdc : HDC optional -> Ptr ()
-- psc : void** in/out -> Ptr ()
-- psa : SCRIPT_ANALYSIS* optional -> Ptr ()
-- tagScript : DWORD -> Word32
-- cMaxTags : INT -> Int32
-- pLangsysTags : DWORD* out -> Ptr Word32
-- pcTags : INT* out -> Ptr Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let scriptgetfontlanguagetags =
foreign "ScriptGetFontLanguageTags"
((ptr void) @-> (ptr void) @-> (ptr void) @-> uint32_t @-> int32_t @-> (ptr uint32_t) @-> (ptr int32_t) @-> returning int32_t)
(* hdc : HDC optional -> (ptr void) *)
(* psc : void** in/out -> (ptr void) *)
(* psa : SCRIPT_ANALYSIS* optional -> (ptr void) *)
(* tagScript : DWORD -> uint32_t *)
(* cMaxTags : INT -> int32_t *)
(* pLangsysTags : DWORD* out -> (ptr uint32_t) *)
(* pcTags : INT* out -> (ptr int32_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library usp10 (t "USP10.dll"))
(cffi:use-foreign-library usp10)
(cffi:defcfun ("ScriptGetFontLanguageTags" script-get-font-language-tags :convention :stdcall) :int32
(hdc :pointer) ; HDC optional
(psc :pointer) ; void** in/out
(psa :pointer) ; SCRIPT_ANALYSIS* optional
(tag-script :uint32) ; DWORD
(c-max-tags :int32) ; INT
(p-langsys-tags :pointer) ; DWORD* out
(pc-tags :pointer)) ; INT* out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $ScriptGetFontLanguageTags = Win32::API::More->new('USP10',
'int ScriptGetFontLanguageTags(HANDLE hdc, LPVOID psc, LPVOID psa, DWORD tagScript, int cMaxTags, LPVOID pLangsysTags, LPVOID pcTags)');
# my $ret = $ScriptGetFontLanguageTags->Call($hdc, $psc, $psa, $tagScript, $cMaxTags, $pLangsysTags, $pcTags);
# hdc : HDC optional -> HANDLE
# psc : void** in/out -> LPVOID
# psa : SCRIPT_ANALYSIS* optional -> LPVOID
# tagScript : DWORD -> DWORD
# cMaxTags : INT -> int
# pLangsysTags : DWORD* out -> LPVOID
# pcTags : INT* out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
公式の関連項目
- f ScriptItemizeOpenType — 文字列をスクリプトタグ付きでアイテム分割する。
使用する型