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

DWRITE_STRIKETHROUGH

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

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

フィールド

フィールドサイズx64x86説明
widthFLOAT4+0+0取り消し線の幅(線の長さ)をDIP単位で表す値。
thicknessFLOAT4+4+4取り消し線の太さをDIP単位で表す値。
offsetFLOAT4+8+8ベースラインから取り消し線までのオフセット。正の値は下方向を表す。
readingDirectionDWRITE_READING_DIRECTION4+12+12テキストの読み進み方向を示す列挙値。
flowDirectionDWRITE_FLOW_DIRECTION4+16+16行の流れる方向を示す列挙値。
localeNameLPWSTR8/4+24+20テキストのロケール名を示すNULL終端ワイド文字列。
measuringModeDWRITE_MEASURING_MODE4+32+24テキスト測定モード(自然/GDI互換など)を示す列挙値。

各言語での定義

#include <windows.h>

// DWRITE_STRIKETHROUGH  (x64 40 / x86 28 バイト)
typedef struct DWRITE_STRIKETHROUGH {
    FLOAT width;
    FLOAT thickness;
    FLOAT offset;
    DWRITE_READING_DIRECTION readingDirection;
    DWRITE_FLOW_DIRECTION flowDirection;
    LPWSTR localeName;
    DWRITE_MEASURING_MODE measuringMode;
} DWRITE_STRIKETHROUGH;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DWRITE_STRIKETHROUGH
{
    public float width;
    public float thickness;
    public float offset;
    public int readingDirection;
    public int flowDirection;
    public IntPtr localeName;
    public int measuringMode;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DWRITE_STRIKETHROUGH
    Public width As Single
    Public thickness As Single
    Public offset As Single
    Public readingDirection As Integer
    Public flowDirection As Integer
    Public localeName As IntPtr
    Public measuringMode As Integer
End Structure
import ctypes
from ctypes import wintypes

class DWRITE_STRIKETHROUGH(ctypes.Structure):
    _fields_ = [
        ("width", ctypes.c_float),
        ("thickness", ctypes.c_float),
        ("offset", ctypes.c_float),
        ("readingDirection", ctypes.c_int),
        ("flowDirection", ctypes.c_int),
        ("localeName", ctypes.c_void_p),
        ("measuringMode", ctypes.c_int),
    ]
#[repr(C)]
pub struct DWRITE_STRIKETHROUGH {
    pub width: f32,
    pub thickness: f32,
    pub offset: f32,
    pub readingDirection: i32,
    pub flowDirection: i32,
    pub localeName: *mut core::ffi::c_void,
    pub measuringMode: i32,
}
import "golang.org/x/sys/windows"

type DWRITE_STRIKETHROUGH struct {
	width float32
	thickness float32
	offset float32
	readingDirection int32
	flowDirection int32
	localeName uintptr
	measuringMode int32
}
type
  DWRITE_STRIKETHROUGH = record
    width: Single;
    thickness: Single;
    offset: Single;
    readingDirection: Integer;
    flowDirection: Integer;
    localeName: Pointer;
    measuringMode: Integer;
  end;
const DWRITE_STRIKETHROUGH = extern struct {
    width: f32,
    thickness: f32,
    offset: f32,
    readingDirection: i32,
    flowDirection: i32,
    localeName: ?*anyopaque,
    measuringMode: i32,
};
type
  DWRITE_STRIKETHROUGH {.bycopy.} = object
    width: float32
    thickness: float32
    offset: float32
    readingDirection: int32
    flowDirection: int32
    localeName: pointer
    measuringMode: int32
struct DWRITE_STRIKETHROUGH
{
    float width;
    float thickness;
    float offset;
    int readingDirection;
    int flowDirection;
    void* localeName;
    int measuringMode;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DWRITE_STRIKETHROUGH サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; width : FLOAT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; thickness : FLOAT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; offset : FLOAT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; readingDirection : DWRITE_READING_DIRECTION (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; flowDirection : DWRITE_FLOW_DIRECTION (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; localeName : LPWSTR (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; measuringMode : DWRITE_MEASURING_MODE (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DWRITE_STRIKETHROUGH サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; width : FLOAT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; thickness : FLOAT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; offset : FLOAT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; readingDirection : DWRITE_READING_DIRECTION (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; flowDirection : DWRITE_FLOW_DIRECTION (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; localeName : LPWSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; measuringMode : DWRITE_MEASURING_MODE (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DWRITE_STRIKETHROUGH
    #field float width
    #field float thickness
    #field float offset
    #field int readingDirection
    #field int flowDirection
    #field intptr localeName
    #field int measuringMode
#endstruct

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