ホーム › Graphics.GdiPlus › GdipMeasureCharacterRanges
GdipMeasureCharacterRanges
関数文字列内の文字範囲ごとの領域を測定する。
シグネチャ
// gdiplus.dll
#include <windows.h>
Status GdipMeasureCharacterRanges(
GpGraphics* graphics,
LPCWSTR string,
INT length,
const GpFont* font,
const RectF* layoutRect,
const GpStringFormat* stringFormat,
INT regionCount,
GpRegion** regions
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| graphics | GpGraphics* | inout | 測定の基準とするGpGraphicsオブジェクトへのポインタ。 |
| string | LPCWSTR | in | 測定する文字列を示すワイド文字列。 |
| length | INT | in | 文字列の長さ(文字数)。-1指定でNULL終端まで対象とする。 |
| font | GpFont* | in | 測定に使用するGpFontオブジェクトへのポインタ。 |
| layoutRect | RectF* | in | 文字列のレイアウト範囲を示すRectF構造体へのポインタ。 |
| stringFormat | GpStringFormat* | in | 測定対象の文字範囲を含むGpStringFormatへのポインタ。 |
| regionCount | INT | in | regions配列の要素数を示すINT値。文字範囲数に一致させる。 |
| regions | GpRegion** | inout | 各文字範囲の領域を受け取るGpRegionポインタ配列への出力先。 |
戻り値の型: Status
各言語での呼び出し定義
// gdiplus.dll
#include <windows.h>
Status GdipMeasureCharacterRanges(
GpGraphics* graphics,
LPCWSTR string,
INT length,
const GpFont* font,
const RectF* layoutRect,
const GpStringFormat* stringFormat,
INT regionCount,
GpRegion** regions
);[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipMeasureCharacterRanges(
IntPtr graphics, // GpGraphics* in/out
[MarshalAs(UnmanagedType.LPWStr)] string string, // LPCWSTR
int length, // INT
IntPtr font, // GpFont*
IntPtr layoutRect, // RectF*
IntPtr stringFormat, // GpStringFormat*
int regionCount, // INT
IntPtr regions // GpRegion** in/out
);<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipMeasureCharacterRanges(
graphics As IntPtr, ' GpGraphics* in/out
<MarshalAs(UnmanagedType.LPWStr)> [string] As String, ' LPCWSTR
length As Integer, ' INT
font As IntPtr, ' GpFont*
layoutRect As IntPtr, ' RectF*
stringFormat As IntPtr, ' GpStringFormat*
regionCount As Integer, ' INT
regions As IntPtr ' GpRegion** in/out
) As Integer
End Function' graphics : GpGraphics* in/out
' string : LPCWSTR
' length : INT
' font : GpFont*
' layoutRect : RectF*
' stringFormat : GpStringFormat*
' regionCount : INT
' regions : GpRegion** in/out
Declare PtrSafe Function GdipMeasureCharacterRanges Lib "gdiplus" ( _
ByVal graphics As LongPtr, _
ByVal string As LongPtr, _
ByVal length As Long, _
ByVal font As LongPtr, _
ByVal layoutRect As LongPtr, _
ByVal stringFormat As LongPtr, _
ByVal regionCount As Long, _
ByVal regions As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GdipMeasureCharacterRanges = ctypes.windll.gdiplus.GdipMeasureCharacterRanges
GdipMeasureCharacterRanges.restype = ctypes.c_int
GdipMeasureCharacterRanges.argtypes = [
ctypes.c_void_p, # graphics : GpGraphics* in/out
wintypes.LPCWSTR, # string : LPCWSTR
ctypes.c_int, # length : INT
ctypes.c_void_p, # font : GpFont*
ctypes.c_void_p, # layoutRect : RectF*
ctypes.c_void_p, # stringFormat : GpStringFormat*
ctypes.c_int, # regionCount : INT
ctypes.c_void_p, # regions : GpRegion** in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('gdiplus.dll')
GdipMeasureCharacterRanges = Fiddle::Function.new(
lib['GdipMeasureCharacterRanges'],
[
Fiddle::TYPE_VOIDP, # graphics : GpGraphics* in/out
Fiddle::TYPE_VOIDP, # string : LPCWSTR
Fiddle::TYPE_INT, # length : INT
Fiddle::TYPE_VOIDP, # font : GpFont*
Fiddle::TYPE_VOIDP, # layoutRect : RectF*
Fiddle::TYPE_VOIDP, # stringFormat : GpStringFormat*
Fiddle::TYPE_INT, # regionCount : INT
Fiddle::TYPE_VOIDP, # regions : GpRegion** in/out
],
Fiddle::TYPE_INT)#[link(name = "gdiplus")]
extern "system" {
fn GdipMeasureCharacterRanges(
graphics: *mut GpGraphics, // GpGraphics* in/out
string: *const u16, // LPCWSTR
length: i32, // INT
font: *const GpFont, // GpFont*
layoutRect: *const RectF, // RectF*
stringFormat: *const GpStringFormat, // GpStringFormat*
regionCount: i32, // INT
regions: *mut *mut GpRegion // GpRegion** in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipMeasureCharacterRanges(IntPtr graphics, [MarshalAs(UnmanagedType.LPWStr)] string string, int length, IntPtr font, IntPtr layoutRect, IntPtr stringFormat, int regionCount, IntPtr regions);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipMeasureCharacterRanges' -Namespace Win32 -PassThru
# $api::GdipMeasureCharacterRanges(graphics, string, length, font, layoutRect, stringFormat, regionCount, regions)#uselib "gdiplus.dll"
#func global GdipMeasureCharacterRanges "GdipMeasureCharacterRanges" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; GdipMeasureCharacterRanges varptr(graphics), string, length, varptr(font), varptr(layoutRect), varptr(stringFormat), regionCount, varptr(regions) ; 戻り値は stat
; graphics : GpGraphics* in/out -> "sptr"
; string : LPCWSTR -> "sptr"
; length : INT -> "sptr"
; font : GpFont* -> "sptr"
; layoutRect : RectF* -> "sptr"
; stringFormat : GpStringFormat* -> "sptr"
; regionCount : INT -> "sptr"
; regions : GpRegion** in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "gdiplus.dll" #cfunc global GdipMeasureCharacterRanges "GdipMeasureCharacterRanges" var, wstr, int, var, var, var, int, var ; res = GdipMeasureCharacterRanges(graphics, string, length, font, layoutRect, stringFormat, regionCount, regions) ; graphics : GpGraphics* in/out -> "var" ; string : LPCWSTR -> "wstr" ; length : INT -> "int" ; font : GpFont* -> "var" ; layoutRect : RectF* -> "var" ; stringFormat : GpStringFormat* -> "var" ; regionCount : INT -> "int" ; regions : GpRegion** in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "gdiplus.dll" #cfunc global GdipMeasureCharacterRanges "GdipMeasureCharacterRanges" sptr, wstr, int, sptr, sptr, sptr, int, sptr ; res = GdipMeasureCharacterRanges(varptr(graphics), string, length, varptr(font), varptr(layoutRect), varptr(stringFormat), regionCount, varptr(regions)) ; graphics : GpGraphics* in/out -> "sptr" ; string : LPCWSTR -> "wstr" ; length : INT -> "int" ; font : GpFont* -> "sptr" ; layoutRect : RectF* -> "sptr" ; stringFormat : GpStringFormat* -> "sptr" ; regionCount : INT -> "int" ; regions : GpRegion** in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; Status GdipMeasureCharacterRanges(GpGraphics* graphics, LPCWSTR string, INT length, GpFont* font, RectF* layoutRect, GpStringFormat* stringFormat, INT regionCount, GpRegion** regions) #uselib "gdiplus.dll" #cfunc global GdipMeasureCharacterRanges "GdipMeasureCharacterRanges" var, wstr, int, var, var, var, int, var ; res = GdipMeasureCharacterRanges(graphics, string, length, font, layoutRect, stringFormat, regionCount, regions) ; graphics : GpGraphics* in/out -> "var" ; string : LPCWSTR -> "wstr" ; length : INT -> "int" ; font : GpFont* -> "var" ; layoutRect : RectF* -> "var" ; stringFormat : GpStringFormat* -> "var" ; regionCount : INT -> "int" ; regions : GpRegion** in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; Status GdipMeasureCharacterRanges(GpGraphics* graphics, LPCWSTR string, INT length, GpFont* font, RectF* layoutRect, GpStringFormat* stringFormat, INT regionCount, GpRegion** regions) #uselib "gdiplus.dll" #cfunc global GdipMeasureCharacterRanges "GdipMeasureCharacterRanges" intptr, wstr, int, intptr, intptr, intptr, int, intptr ; res = GdipMeasureCharacterRanges(varptr(graphics), string, length, varptr(font), varptr(layoutRect), varptr(stringFormat), regionCount, varptr(regions)) ; graphics : GpGraphics* in/out -> "intptr" ; string : LPCWSTR -> "wstr" ; length : INT -> "int" ; font : GpFont* -> "intptr" ; layoutRect : RectF* -> "intptr" ; stringFormat : GpStringFormat* -> "intptr" ; regionCount : INT -> "int" ; regions : GpRegion** in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
procGdipMeasureCharacterRanges = gdiplus.NewProc("GdipMeasureCharacterRanges")
)
// graphics (GpGraphics* in/out), string (LPCWSTR), length (INT), font (GpFont*), layoutRect (RectF*), stringFormat (GpStringFormat*), regionCount (INT), regions (GpRegion** in/out)
r1, _, err := procGdipMeasureCharacterRanges.Call(
uintptr(graphics),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(string))),
uintptr(length),
uintptr(font),
uintptr(layoutRect),
uintptr(stringFormat),
uintptr(regionCount),
uintptr(regions),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // Statusfunction GdipMeasureCharacterRanges(
graphics: Pointer; // GpGraphics* in/out
string: PWideChar; // LPCWSTR
length: Integer; // INT
font: Pointer; // GpFont*
layoutRect: Pointer; // RectF*
stringFormat: Pointer; // GpStringFormat*
regionCount: Integer; // INT
regions: Pointer // GpRegion** in/out
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipMeasureCharacterRanges';result := DllCall("gdiplus\GdipMeasureCharacterRanges"
, "Ptr", graphics ; GpGraphics* in/out
, "WStr", string ; LPCWSTR
, "Int", length ; INT
, "Ptr", font ; GpFont*
, "Ptr", layoutRect ; RectF*
, "Ptr", stringFormat ; GpStringFormat*
, "Int", regionCount ; INT
, "Ptr", regions ; GpRegion** in/out
, "Int") ; return: Status●GdipMeasureCharacterRanges(graphics, string, length, font, layoutRect, stringFormat, regionCount, regions) = DLL("gdiplus.dll", "int GdipMeasureCharacterRanges(void*, char*, int, void*, void*, void*, int, void*)")
# 呼び出し: GdipMeasureCharacterRanges(graphics, string, length, font, layoutRect, stringFormat, regionCount, regions)
# graphics : GpGraphics* in/out -> "void*"
# string : LPCWSTR -> "char*"
# length : INT -> "int"
# font : GpFont* -> "void*"
# layoutRect : RectF* -> "void*"
# stringFormat : GpStringFormat* -> "void*"
# regionCount : INT -> "int"
# regions : GpRegion** in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "gdiplus" fn GdipMeasureCharacterRanges(
graphics: [*c]GpGraphics, // GpGraphics* in/out
string: [*c]const u16, // LPCWSTR
length: i32, // INT
font: [*c]GpFont, // GpFont*
layoutRect: [*c]RectF, // RectF*
stringFormat: [*c]GpStringFormat, // GpStringFormat*
regionCount: i32, // INT
regions: [*c][*c]GpRegion // GpRegion** in/out
) callconv(std.os.windows.WINAPI) i32;proc GdipMeasureCharacterRanges(
graphics: ptr GpGraphics, # GpGraphics* in/out
string: WideCString, # LPCWSTR
length: int32, # INT
font: ptr GpFont, # GpFont*
layoutRect: ptr RectF, # RectF*
stringFormat: ptr GpStringFormat, # GpStringFormat*
regionCount: int32, # INT
regions: ptr GpRegion # GpRegion** in/out
): int32 {.importc: "GdipMeasureCharacterRanges", stdcall, dynlib: "gdiplus.dll".}pragma(lib, "gdiplus");
extern(Windows)
int GdipMeasureCharacterRanges(
GpGraphics* graphics, // GpGraphics* in/out
const(wchar)* string, // LPCWSTR
int length, // INT
GpFont* font, // GpFont*
RectF* layoutRect, // RectF*
GpStringFormat* stringFormat, // GpStringFormat*
int regionCount, // INT
GpRegion** regions // GpRegion** in/out
);ccall((:GdipMeasureCharacterRanges, "gdiplus.dll"), stdcall, Int32,
(Ptr{GpGraphics}, Cwstring, Int32, Ptr{GpFont}, Ptr{RectF}, Ptr{GpStringFormat}, Int32, Ptr{GpRegion}),
graphics, string, length, font, layoutRect, stringFormat, regionCount, regions)
# graphics : GpGraphics* in/out -> Ptr{GpGraphics}
# string : LPCWSTR -> Cwstring
# length : INT -> Int32
# font : GpFont* -> Ptr{GpFont}
# layoutRect : RectF* -> Ptr{RectF}
# stringFormat : GpStringFormat* -> Ptr{GpStringFormat}
# regionCount : INT -> Int32
# regions : GpRegion** in/out -> Ptr{GpRegion}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t GdipMeasureCharacterRanges(
void* graphics,
const uint16_t* string,
int32_t length,
void* font,
void* layoutRect,
void* stringFormat,
int32_t regionCount,
void* regions);
]]
local gdiplus = ffi.load("gdiplus")
-- gdiplus.GdipMeasureCharacterRanges(graphics, string, length, font, layoutRect, stringFormat, regionCount, regions)
-- graphics : GpGraphics* in/out
-- string : LPCWSTR
-- length : INT
-- font : GpFont*
-- layoutRect : RectF*
-- stringFormat : GpStringFormat*
-- regionCount : INT
-- regions : GpRegion** in/out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('gdiplus.dll');
const GdipMeasureCharacterRanges = lib.func('__stdcall', 'GdipMeasureCharacterRanges', 'int32_t', ['void *', 'str16', 'int32_t', 'void *', 'void *', 'void *', 'int32_t', 'void *']);
// GdipMeasureCharacterRanges(graphics, string, length, font, layoutRect, stringFormat, regionCount, regions)
// graphics : GpGraphics* in/out -> 'void *'
// string : LPCWSTR -> 'str16'
// length : INT -> 'int32_t'
// font : GpFont* -> 'void *'
// layoutRect : RectF* -> 'void *'
// stringFormat : GpStringFormat* -> 'void *'
// regionCount : INT -> 'int32_t'
// regions : GpRegion** in/out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("gdiplus.dll", {
GdipMeasureCharacterRanges: { parameters: ["pointer", "buffer", "i32", "pointer", "pointer", "pointer", "i32", "pointer"], result: "i32" },
});
// lib.symbols.GdipMeasureCharacterRanges(graphics, string, length, font, layoutRect, stringFormat, regionCount, regions)
// graphics : GpGraphics* in/out -> "pointer"
// string : LPCWSTR -> "buffer"
// length : INT -> "i32"
// font : GpFont* -> "pointer"
// layoutRect : RectF* -> "pointer"
// stringFormat : GpStringFormat* -> "pointer"
// regionCount : INT -> "i32"
// regions : GpRegion** in/out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t GdipMeasureCharacterRanges(
void* graphics,
const uint16_t* string,
int32_t length,
void* font,
void* layoutRect,
void* stringFormat,
int32_t regionCount,
void* regions);
C, "gdiplus.dll");
// $ffi->GdipMeasureCharacterRanges(graphics, string, length, font, layoutRect, stringFormat, regionCount, regions);
// graphics : GpGraphics* in/out
// string : LPCWSTR
// length : INT
// font : GpFont*
// layoutRect : RectF*
// stringFormat : GpStringFormat*
// regionCount : INT
// regions : GpRegion** in/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 Gdiplus extends StdCallLibrary {
Gdiplus INSTANCE = Native.load("gdiplus", Gdiplus.class);
int GdipMeasureCharacterRanges(
Pointer graphics, // GpGraphics* in/out
WString string, // LPCWSTR
int length, // INT
Pointer font, // GpFont*
Pointer layoutRect, // RectF*
Pointer stringFormat, // GpStringFormat*
int regionCount, // INT
Pointer regions // GpRegion** in/out
);
}@[Link("gdiplus")]
lib Libgdiplus
fun GdipMeasureCharacterRanges = GdipMeasureCharacterRanges(
graphics : GpGraphics*, # GpGraphics* in/out
string : UInt16*, # LPCWSTR
length : Int32, # INT
font : GpFont*, # GpFont*
layoutRect : RectF*, # RectF*
stringFormat : GpStringFormat*, # GpStringFormat*
regionCount : Int32, # INT
regions : GpRegion** # GpRegion** in/out
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef GdipMeasureCharacterRangesNative = Int32 Function(Pointer<Void>, Pointer<Utf16>, Int32, Pointer<Void>, Pointer<Void>, Pointer<Void>, Int32, Pointer<Void>);
typedef GdipMeasureCharacterRangesDart = int Function(Pointer<Void>, Pointer<Utf16>, int, Pointer<Void>, Pointer<Void>, Pointer<Void>, int, Pointer<Void>);
final GdipMeasureCharacterRanges = DynamicLibrary.open('gdiplus.dll')
.lookupFunction<GdipMeasureCharacterRangesNative, GdipMeasureCharacterRangesDart>('GdipMeasureCharacterRanges');
// graphics : GpGraphics* in/out -> Pointer<Void>
// string : LPCWSTR -> Pointer<Utf16>
// length : INT -> Int32
// font : GpFont* -> Pointer<Void>
// layoutRect : RectF* -> Pointer<Void>
// stringFormat : GpStringFormat* -> Pointer<Void>
// regionCount : INT -> Int32
// regions : GpRegion** in/out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function GdipMeasureCharacterRanges(
graphics: Pointer; // GpGraphics* in/out
string: PWideChar; // LPCWSTR
length: Integer; // INT
font: Pointer; // GpFont*
layoutRect: Pointer; // RectF*
stringFormat: Pointer; // GpStringFormat*
regionCount: Integer; // INT
regions: Pointer // GpRegion** in/out
): Integer; stdcall;
external 'gdiplus.dll' name 'GdipMeasureCharacterRanges';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "GdipMeasureCharacterRanges"
c_GdipMeasureCharacterRanges :: Ptr () -> CWString -> Int32 -> Ptr () -> Ptr () -> Ptr () -> Int32 -> Ptr () -> IO Int32
-- graphics : GpGraphics* in/out -> Ptr ()
-- string : LPCWSTR -> CWString
-- length : INT -> Int32
-- font : GpFont* -> Ptr ()
-- layoutRect : RectF* -> Ptr ()
-- stringFormat : GpStringFormat* -> Ptr ()
-- regionCount : INT -> Int32
-- regions : GpRegion** in/out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let gdipmeasurecharacterranges =
foreign "GdipMeasureCharacterRanges"
((ptr void) @-> (ptr uint16_t) @-> int32_t @-> (ptr void) @-> (ptr void) @-> (ptr void) @-> int32_t @-> (ptr void) @-> returning int32_t)
(* graphics : GpGraphics* in/out -> (ptr void) *)
(* string : LPCWSTR -> (ptr uint16_t) *)
(* length : INT -> int32_t *)
(* font : GpFont* -> (ptr void) *)
(* layoutRect : RectF* -> (ptr void) *)
(* stringFormat : GpStringFormat* -> (ptr void) *)
(* regionCount : INT -> int32_t *)
(* regions : GpRegion** in/out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library gdiplus (t "gdiplus.dll"))
(cffi:use-foreign-library gdiplus)
(cffi:defcfun ("GdipMeasureCharacterRanges" gdip-measure-character-ranges :convention :stdcall) :int32
(graphics :pointer) ; GpGraphics* in/out
(string (:string :encoding :utf-16le)) ; LPCWSTR
(length :int32) ; INT
(font :pointer) ; GpFont*
(layout-rect :pointer) ; RectF*
(string-format :pointer) ; GpStringFormat*
(region-count :int32) ; INT
(regions :pointer)) ; GpRegion** in/out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $GdipMeasureCharacterRanges = Win32::API::More->new('gdiplus',
'int GdipMeasureCharacterRanges(LPVOID graphics, LPCWSTR string, int length, LPVOID font, LPVOID layoutRect, LPVOID stringFormat, int regionCount, LPVOID regions)');
# my $ret = $GdipMeasureCharacterRanges->Call($graphics, $string, $length, $font, $layoutRect, $stringFormat, $regionCount, $regions);
# graphics : GpGraphics* in/out -> LPVOID
# string : LPCWSTR -> LPCWSTR
# length : INT -> int
# font : GpFont* -> LPVOID
# layoutRect : RectF* -> LPVOID
# stringFormat : GpStringFormat* -> LPVOID
# regionCount : INT -> int
# regions : GpRegion** in/out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。