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

DWRITE_PANOSE

共用体
サイズx64: 10 バイト / x86: 10 バイト

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

フィールド

フィールドサイズx64x86説明
valuesBYTE10+0+0PANOSE分類の10バイトを生のバイト配列として扱うビュー。
familyKindBYTE1+0+0PANOSEのファミリ種別を示す先頭バイト。以下のビューはこの値で選択する。
text_text_e__Struct10+0+0ラテン文字テキスト用のPANOSE分類を表す入れ子構造体。
script_script_e__Struct10+0+0ラテン手書き(スクリプト)用のPANOSE分類を表す入れ子構造体。
decorative_decorative_e__Struct10+0+0装飾文字用のPANOSE分類を表す入れ子構造体。
symbol_symbol_e__Struct10+0+0シンボルフォント用のPANOSE分類を表す入れ子構造体。

構造体: _text_e__Struct x64 10B / x86 10B

フィールドサイズx64x86説明
familyKindBYTE1+0+0PANOSEのファミリ種別を示す先頭バイト。以下のビューはこの値で選択する。
serifStyleBYTE1+1+1
weightBYTE1+2+2
proportionBYTE1+3+3
contrastBYTE1+4+4
strokeVariationBYTE1+5+5
armStyleBYTE1+6+6
letterformBYTE1+7+7
midlineBYTE1+8+8
xHeightBYTE1+9+9

構造体: _script_e__Struct x64 10B / x86 10B

フィールドサイズx64x86説明
familyKindBYTE1+0+0PANOSEのファミリ種別を示す先頭バイト。以下のビューはこの値で選択する。
toolKindBYTE1+1+1
weightBYTE1+2+2
spacingBYTE1+3+3
aspectRatioBYTE1+4+4
contrastBYTE1+5+5
scriptTopologyBYTE1+6+6
scriptFormBYTE1+7+7
finialsBYTE1+8+8
xAscentBYTE1+9+9

構造体: _decorative_e__Struct x64 10B / x86 10B

フィールドサイズx64x86説明
familyKindBYTE1+0+0PANOSEのファミリ種別を示す先頭バイト。以下のビューはこの値で選択する。
decorativeClassBYTE1+1+1
weightBYTE1+2+2
aspectBYTE1+3+3
contrastBYTE1+4+4
serifVariantBYTE1+5+5
fillBYTE1+6+6
liningBYTE1+7+7
decorativeTopologyBYTE1+8+8
characterRangeBYTE1+9+9

構造体: _symbol_e__Struct x64 10B / x86 10B

フィールドサイズx64x86説明
familyKindBYTE1+0+0PANOSEのファミリ種別を示す先頭バイト。以下のビューはこの値で選択する。
symbolKindBYTE1+1+1
weightBYTE1+2+2
spacingBYTE1+3+3
aspectRatioAndContrastBYTE1+4+4
aspectRatio94BYTE1+5+5
aspectRatio119BYTE1+6+6
aspectRatio157BYTE1+7+7
aspectRatio163BYTE1+8+8
aspectRatio211BYTE1+9+9

各言語での定義

#include <windows.h>

// DWRITE_PANOSE  (x64 10 / x86 10 バイト)
typedef struct DWRITE_PANOSE {
    BYTE values[10];
    BYTE familyKind;
    _text_e__Struct text;
    _script_e__Struct script;
    _decorative_e__Struct decorative;
    _symbol_e__Struct symbol;
} DWRITE_PANOSE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DWRITE_PANOSE
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] public byte[] values;
    public byte familyKind;
    public _text_e__Struct text;
    public _script_e__Struct script;
    public _decorative_e__Struct decorative;
    public _symbol_e__Struct symbol;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DWRITE_PANOSE
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=10)> Public values() As Byte
    Public familyKind As Byte
    Public text As _text_e__Struct
    Public script As _script_e__Struct
    Public decorative As _decorative_e__Struct
    Public symbol As _symbol_e__Struct
End Structure
import ctypes
from ctypes import wintypes

class DWRITE_PANOSE(ctypes.Structure):
    _fields_ = [
        ("values", ctypes.c_ubyte * 10),
        ("familyKind", ctypes.c_ubyte),
        ("text", _text_e__Struct),
        ("script", _script_e__Struct),
        ("decorative", _decorative_e__Struct),
        ("symbol", _symbol_e__Struct),
    ]
#[repr(C)]
pub struct DWRITE_PANOSE {
    pub values: [u8; 10],
    pub familyKind: u8,
    pub text: _text_e__Struct,
    pub script: _script_e__Struct,
    pub decorative: _decorative_e__Struct,
    pub symbol: _symbol_e__Struct,
}
import "golang.org/x/sys/windows"

type DWRITE_PANOSE struct {
	values [10]byte
	familyKind byte
	text _text_e__Struct
	script _script_e__Struct
	decorative _decorative_e__Struct
	symbol _symbol_e__Struct
}
type
  DWRITE_PANOSE = record
    values: array[0..9] of Byte;
    familyKind: Byte;
    text: _text_e__Struct;
    script: _script_e__Struct;
    decorative: _decorative_e__Struct;
    symbol: _symbol_e__Struct;
  end;
const DWRITE_PANOSE = extern struct {
    values: [10]u8,
    familyKind: u8,
    text: _text_e__Struct,
    script: _script_e__Struct,
    decorative: _decorative_e__Struct,
    symbol: _symbol_e__Struct,
};
type
  DWRITE_PANOSE {.bycopy.} = object
    values: array[10, uint8]
    familyKind: uint8
    text: _text_e__Struct
    script: _script_e__Struct
    decorative: _decorative_e__Struct
    symbol: _symbol_e__Struct
struct DWRITE_PANOSE
{
    ubyte[10] values;
    ubyte familyKind;
    _text_e__Struct text;
    _script_e__Struct script;
    _decorative_e__Struct decorative;
    _symbol_e__Struct symbol;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DWRITE_PANOSE サイズ: 10 バイト(x64)
dim st, 3    ; 4byte整数×3(構造体サイズ 10 / 4 切り上げ)
; values : BYTE (+0, 10byte)  varptr(st)+0 を基点に操作(10byte:入れ子/配列)
; familyKind : BYTE (+0, 1byte)  poke st,0,値  /  値 = peek(st,0)
; text : _text_e__Struct (+0, 10byte)  varptr(st)+0 を基点に操作(10byte:入れ子/配列)
; script : _script_e__Struct (+0, 10byte)  varptr(st)+0 を基点に操作(10byte:入れ子/配列)
; decorative : _decorative_e__Struct (+0, 10byte)  varptr(st)+0 を基点に操作(10byte:入れ子/配列)
; symbol : _symbol_e__Struct (+0, 10byte)  varptr(st)+0 を基点に操作(10byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DWRITE_PANOSE
    #field byte values 10
    #field byte familyKind
    #field _text_e__Struct text
    #field _script_e__Struct script
    #field _decorative_e__Struct decorative
    #field _symbol_e__Struct symbol
#endstruct

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