ホーム › Globalization › SCRIPT_FONTPROPERTIES
SCRIPT_FONTPROPERTIES
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cBytes | INT | 4 | +0 | +0 | 構造体のサイズ (バイト単位)。 |
| wgBlank | WORD | 2 | +4 | +4 | 空白を示すために使用されるグリフ。 |
| wgDefault | WORD | 2 | +6 | +6 | フォントに存在しない Unicode 文字を示すために使用されるグリフ。 |
| wgInvalid | WORD | 2 | +8 | +8 | 無効な文字の組み合わせを示すために使用されるグリフ。 |
| wgKashida | WORD | 2 | +10 | +10 | 最短の連続カシーダを示すために使用されるグリフ。値が 1 の場合、そのフォントにカシーダが含まれていないことを示します。 |
| iKashidaWidth | INT | 4 | +12 | +12 | wgKashida メンバーが示す、フォント内で最短の連続カシーダグリフの幅。 |
公式ドキュメント
現在のフォントのプロパティに関する情報を格納します。
出典・ライセンス: 上記「公式ドキュメント」の内容は 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>
// SCRIPT_FONTPROPERTIES (x64 16 / x86 16 バイト)
typedef struct SCRIPT_FONTPROPERTIES {
INT cBytes;
WORD wgBlank;
WORD wgDefault;
WORD wgInvalid;
WORD wgKashida;
INT iKashidaWidth;
} SCRIPT_FONTPROPERTIES;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SCRIPT_FONTPROPERTIES
{
public int cBytes;
public ushort wgBlank;
public ushort wgDefault;
public ushort wgInvalid;
public ushort wgKashida;
public int iKashidaWidth;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SCRIPT_FONTPROPERTIES
Public cBytes As Integer
Public wgBlank As UShort
Public wgDefault As UShort
Public wgInvalid As UShort
Public wgKashida As UShort
Public iKashidaWidth As Integer
End Structureimport ctypes
from ctypes import wintypes
class SCRIPT_FONTPROPERTIES(ctypes.Structure):
_fields_ = [
("cBytes", ctypes.c_int),
("wgBlank", ctypes.c_ushort),
("wgDefault", ctypes.c_ushort),
("wgInvalid", ctypes.c_ushort),
("wgKashida", ctypes.c_ushort),
("iKashidaWidth", ctypes.c_int),
]#[repr(C)]
pub struct SCRIPT_FONTPROPERTIES {
pub cBytes: i32,
pub wgBlank: u16,
pub wgDefault: u16,
pub wgInvalid: u16,
pub wgKashida: u16,
pub iKashidaWidth: i32,
}import "golang.org/x/sys/windows"
type SCRIPT_FONTPROPERTIES struct {
cBytes int32
wgBlank uint16
wgDefault uint16
wgInvalid uint16
wgKashida uint16
iKashidaWidth int32
}type
SCRIPT_FONTPROPERTIES = record
cBytes: Integer;
wgBlank: Word;
wgDefault: Word;
wgInvalid: Word;
wgKashida: Word;
iKashidaWidth: Integer;
end;const SCRIPT_FONTPROPERTIES = extern struct {
cBytes: i32,
wgBlank: u16,
wgDefault: u16,
wgInvalid: u16,
wgKashida: u16,
iKashidaWidth: i32,
};type
SCRIPT_FONTPROPERTIES {.bycopy.} = object
cBytes: int32
wgBlank: uint16
wgDefault: uint16
wgInvalid: uint16
wgKashida: uint16
iKashidaWidth: int32struct SCRIPT_FONTPROPERTIES
{
int cBytes;
ushort wgBlank;
ushort wgDefault;
ushort wgInvalid;
ushort wgKashida;
int iKashidaWidth;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SCRIPT_FONTPROPERTIES サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; cBytes : INT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; wgBlank : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; wgDefault : WORD (+6, 2byte) wpoke st,6,値 / 値 = wpeek(st,6)
; wgInvalid : WORD (+8, 2byte) wpoke st,8,値 / 値 = wpeek(st,8)
; wgKashida : WORD (+10, 2byte) wpoke st,10,値 / 値 = wpeek(st,10)
; iKashidaWidth : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SCRIPT_FONTPROPERTIES
#field int cBytes
#field short wgBlank
#field short wgDefault
#field short wgInvalid
#field short wgKashida
#field int iKashidaWidth
#endstruct
stdim st, SCRIPT_FONTPROPERTIES ; NSTRUCT 変数を確保
st->cBytes = 100
mes "cBytes=" + st->cBytes