ホーム › Graphics.Gdi › GLYPHSET
GLYPHSET
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||
|---|---|---|---|---|---|---|---|---|---|
| cbThis | DWORD | 4 | +0 | +0 | この構造体のサイズ (バイト単位)。 | ||||
| flAccel | DWORD | 4 | +4 | +4 | グリフインデックスの最大サイズを表すフラグ。このメンバーには次の値を指定できます。
| ||||
| cGlyphsSupported | DWORD | 4 | +8 | +8 | フォントでサポートされる Unicode コードポイントの総数。 | ||||
| cRanges | DWORD | 4 | +12 | +12 | ranges 内の Unicode 範囲の総数。 | ||||
| ranges | WCRANGE | 4 | +16 | +16 | フォントでサポートされる Unicode 範囲の配列。 |
公式ドキュメント
GLYPHSET 構造体は、Unicode コードポイントの範囲に関する情報を保持します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// WCRANGE (x64 4 / x86 4 バイト)
typedef struct WCRANGE {
WCHAR wcLow;
WORD cGlyphs;
} WCRANGE;
// GLYPHSET (x64 20 / x86 20 バイト)
typedef struct GLYPHSET {
DWORD cbThis;
DWORD flAccel;
DWORD cGlyphsSupported;
DWORD cRanges;
WCRANGE ranges[1];
} GLYPHSET;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WCRANGE
{
public char wcLow;
public ushort cGlyphs;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GLYPHSET
{
public uint cbThis;
public uint flAccel;
public uint cGlyphsSupported;
public uint cRanges;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public WCRANGE[] ranges;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WCRANGE
Public wcLow As Char
Public cGlyphs As UShort
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GLYPHSET
Public cbThis As UInteger
Public flAccel As UInteger
Public cGlyphsSupported As UInteger
Public cRanges As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public ranges() As WCRANGE
End Structureimport ctypes
from ctypes import wintypes
class WCRANGE(ctypes.Structure):
_fields_ = [
("wcLow", ctypes.c_wchar),
("cGlyphs", ctypes.c_ushort),
]
class GLYPHSET(ctypes.Structure):
_fields_ = [
("cbThis", wintypes.DWORD),
("flAccel", wintypes.DWORD),
("cGlyphsSupported", wintypes.DWORD),
("cRanges", wintypes.DWORD),
("ranges", WCRANGE * 1),
]#[repr(C)]
pub struct WCRANGE {
pub wcLow: u16,
pub cGlyphs: u16,
}
#[repr(C)]
pub struct GLYPHSET {
pub cbThis: u32,
pub flAccel: u32,
pub cGlyphsSupported: u32,
pub cRanges: u32,
pub ranges: [WCRANGE; 1],
}import "golang.org/x/sys/windows"
type WCRANGE struct {
wcLow uint16
cGlyphs uint16
}
type GLYPHSET struct {
cbThis uint32
flAccel uint32
cGlyphsSupported uint32
cRanges uint32
ranges [1]WCRANGE
}type
WCRANGE = record
wcLow: WideChar;
cGlyphs: Word;
end;
GLYPHSET = record
cbThis: DWORD;
flAccel: DWORD;
cGlyphsSupported: DWORD;
cRanges: DWORD;
ranges: array[0..0] of WCRANGE;
end;const WCRANGE = extern struct {
wcLow: u16,
cGlyphs: u16,
};
const GLYPHSET = extern struct {
cbThis: u32,
flAccel: u32,
cGlyphsSupported: u32,
cRanges: u32,
ranges: [1]WCRANGE,
};type
WCRANGE {.bycopy.} = object
wcLow: uint16
cGlyphs: uint16
GLYPHSET {.bycopy.} = object
cbThis: uint32
flAccel: uint32
cGlyphsSupported: uint32
cRanges: uint32
ranges: array[1, WCRANGE]struct WCRANGE
{
wchar wcLow;
ushort cGlyphs;
}
struct GLYPHSET
{
uint cbThis;
uint flAccel;
uint cGlyphsSupported;
uint cRanges;
WCRANGE[1] ranges;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GLYPHSET サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; cbThis : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; flAccel : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; cGlyphsSupported : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; cRanges : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ranges : WCRANGE (+16, 4byte) varptr(st)+16 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global WCRANGE
#field short wcLow
#field short cGlyphs
#endstruct
#defstruct global GLYPHSET
#field int cbThis
#field int flAccel
#field int cGlyphsSupported
#field int cRanges
#field WCRANGE ranges 1
#endstruct
stdim st, GLYPHSET ; NSTRUCT 変数を確保
st->cbThis = 100
mes "cbThis=" + st->cbThis