Win32 API 日本語リファレンス
ホームGraphics.Printing › UNI_GLYPHSETDATA

UNI_GLYPHSETDATA

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

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

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0このグリフセットデータ全体のサイズをバイト単位で示す。
dwVersionDWORD4+4+4構造のバージョン番号。
dwFlagsDWORD4+8+8グリフセットの属性を示すフラグ。
lPredefinedIDINT4+12+12定義済みグリフセットの識別ID。
dwGlyphCountDWORD4+16+16グリフの総数。
dwRunCountDWORD4+20+20グリフランの数。
loRunOffsetDWORD4+24+24グリフラン配列への先頭からのバイトオフセット。
dwCodePageCountDWORD4+28+28対応するコードページの数。
loCodePageOffsetDWORD4+32+32コードページ情報への先頭からのバイトオフセット。
loMapTableOffsetDWORD4+36+36マップテーブルへの先頭からのバイトオフセット。
dwReservedDWORD8+40+40予約フィールド。0に設定する。

各言語での定義

#include <windows.h>

// UNI_GLYPHSETDATA  (x64 48 / x86 48 バイト)
typedef struct UNI_GLYPHSETDATA {
    DWORD dwSize;
    DWORD dwVersion;
    DWORD dwFlags;
    INT lPredefinedID;
    DWORD dwGlyphCount;
    DWORD dwRunCount;
    DWORD loRunOffset;
    DWORD dwCodePageCount;
    DWORD loCodePageOffset;
    DWORD loMapTableOffset;
    DWORD dwReserved[2];
} UNI_GLYPHSETDATA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct UNI_GLYPHSETDATA
{
    public uint dwSize;
    public uint dwVersion;
    public uint dwFlags;
    public int lPredefinedID;
    public uint dwGlyphCount;
    public uint dwRunCount;
    public uint loRunOffset;
    public uint dwCodePageCount;
    public uint loCodePageOffset;
    public uint loMapTableOffset;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public uint[] dwReserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure UNI_GLYPHSETDATA
    Public dwSize As UInteger
    Public dwVersion As UInteger
    Public dwFlags As UInteger
    Public lPredefinedID As Integer
    Public dwGlyphCount As UInteger
    Public dwRunCount As UInteger
    Public loRunOffset As UInteger
    Public dwCodePageCount As UInteger
    Public loCodePageOffset As UInteger
    Public loMapTableOffset As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public dwReserved() As UInteger
End Structure
import ctypes
from ctypes import wintypes

class UNI_GLYPHSETDATA(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("dwVersion", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("lPredefinedID", ctypes.c_int),
        ("dwGlyphCount", wintypes.DWORD),
        ("dwRunCount", wintypes.DWORD),
        ("loRunOffset", wintypes.DWORD),
        ("dwCodePageCount", wintypes.DWORD),
        ("loCodePageOffset", wintypes.DWORD),
        ("loMapTableOffset", wintypes.DWORD),
        ("dwReserved", wintypes.DWORD * 2),
    ]
#[repr(C)]
pub struct UNI_GLYPHSETDATA {
    pub dwSize: u32,
    pub dwVersion: u32,
    pub dwFlags: u32,
    pub lPredefinedID: i32,
    pub dwGlyphCount: u32,
    pub dwRunCount: u32,
    pub loRunOffset: u32,
    pub dwCodePageCount: u32,
    pub loCodePageOffset: u32,
    pub loMapTableOffset: u32,
    pub dwReserved: [u32; 2],
}
import "golang.org/x/sys/windows"

type UNI_GLYPHSETDATA struct {
	dwSize uint32
	dwVersion uint32
	dwFlags uint32
	lPredefinedID int32
	dwGlyphCount uint32
	dwRunCount uint32
	loRunOffset uint32
	dwCodePageCount uint32
	loCodePageOffset uint32
	loMapTableOffset uint32
	dwReserved [2]uint32
}
type
  UNI_GLYPHSETDATA = record
    dwSize: DWORD;
    dwVersion: DWORD;
    dwFlags: DWORD;
    lPredefinedID: Integer;
    dwGlyphCount: DWORD;
    dwRunCount: DWORD;
    loRunOffset: DWORD;
    dwCodePageCount: DWORD;
    loCodePageOffset: DWORD;
    loMapTableOffset: DWORD;
    dwReserved: array[0..1] of DWORD;
  end;
const UNI_GLYPHSETDATA = extern struct {
    dwSize: u32,
    dwVersion: u32,
    dwFlags: u32,
    lPredefinedID: i32,
    dwGlyphCount: u32,
    dwRunCount: u32,
    loRunOffset: u32,
    dwCodePageCount: u32,
    loCodePageOffset: u32,
    loMapTableOffset: u32,
    dwReserved: [2]u32,
};
type
  UNI_GLYPHSETDATA {.bycopy.} = object
    dwSize: uint32
    dwVersion: uint32
    dwFlags: uint32
    lPredefinedID: int32
    dwGlyphCount: uint32
    dwRunCount: uint32
    loRunOffset: uint32
    dwCodePageCount: uint32
    loCodePageOffset: uint32
    loMapTableOffset: uint32
    dwReserved: array[2, uint32]
struct UNI_GLYPHSETDATA
{
    uint dwSize;
    uint dwVersion;
    uint dwFlags;
    int lPredefinedID;
    uint dwGlyphCount;
    uint dwRunCount;
    uint loRunOffset;
    uint dwCodePageCount;
    uint loCodePageOffset;
    uint loMapTableOffset;
    uint[2] dwReserved;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; UNI_GLYPHSETDATA サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwVersion : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwFlags : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; lPredefinedID : INT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwGlyphCount : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwRunCount : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; loRunOffset : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwCodePageCount : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; loCodePageOffset : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; loMapTableOffset : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; dwReserved : DWORD (+40, 8byte)  varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global UNI_GLYPHSETDATA
    #field int dwSize
    #field int dwVersion
    #field int dwFlags
    #field int lPredefinedID
    #field int dwGlyphCount
    #field int dwRunCount
    #field int loRunOffset
    #field int dwCodePageCount
    #field int loCodePageOffset
    #field int loMapTableOffset
    #field int dwReserved 2
#endstruct

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