Win32 API 日本語リファレンス
ホームGlobalization › SCRIPTFONTINFO

SCRIPTFONTINFO

構造体
サイズx64: 72 バイト / x86: 72 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
scriptsLONGLONG8+0+0このフォントが対応するスクリプトを示す64ビットビットマスク。
wszFontWCHAR64+8+8フォント名文字列(Unicode)。

各言語での定義

#include <windows.h>

// SCRIPTFONTINFO  (x64 72 / x86 72 バイト)
typedef struct SCRIPTFONTINFO {
    LONGLONG scripts;
    WCHAR wszFont[32];
} SCRIPTFONTINFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SCRIPTFONTINFO
{
    public long scripts;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string wszFont;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SCRIPTFONTINFO
    Public scripts As Long
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)> Public wszFont As String
End Structure
import ctypes
from ctypes import wintypes

class SCRIPTFONTINFO(ctypes.Structure):
    _fields_ = [
        ("scripts", ctypes.c_longlong),
        ("wszFont", ctypes.c_wchar * 32),
    ]
#[repr(C)]
pub struct SCRIPTFONTINFO {
    pub scripts: i64,
    pub wszFont: [u16; 32],
}
import "golang.org/x/sys/windows"

type SCRIPTFONTINFO struct {
	scripts int64
	wszFont [32]uint16
}
type
  SCRIPTFONTINFO = record
    scripts: Int64;
    wszFont: array[0..31] of WideChar;
  end;
const SCRIPTFONTINFO = extern struct {
    scripts: i64,
    wszFont: [32]u16,
};
type
  SCRIPTFONTINFO {.bycopy.} = object
    scripts: int64
    wszFont: array[32, uint16]
struct SCRIPTFONTINFO
{
    long scripts;
    wchar[32] wszFont;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SCRIPTFONTINFO サイズ: 72 バイト(x64)
dim st, 18    ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; scripts : LONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; wszFont : WCHAR (+8, 64byte)  varptr(st)+8 を基点に操作(64byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SCRIPTFONTINFO
    #field int64 scripts
    #field wchar wszFont 32
#endstruct

stdim st, SCRIPTFONTINFO        ; NSTRUCT 変数を確保
st->scripts = 100
mes "scripts=" + st->scripts