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ベースラインと平行に測定した、取り消し線の幅を示す値です。
thicknessFLOAT4+4+4ベースラインと垂直に測定した、取り消し線の太さを示す値です。
offsetFLOAT4+8+8ベースラインからの取り消し線のオフセットを示す値です。 正のオフセットはベースラインより下の位置を表し、 負のオフセットは上の位置を表します。通常、このオフセットは負の値になります。
readingDirectionDWRITE_READING_DIRECTION4+12+12取り消し線に関連付けられたテキストの読み取り方向です。 この値は、width の値が水平方向と垂直方向のどちらに伸びるかを解釈するために使用されます。
flowDirectionDWRITE_FLOW_DIRECTION4+16+16取り消し線に関連付けられたテキストのフロー方向です。 この値は、thickness の値が上から下、左から右、右から左の いずれの方向に進むかを解釈するために使用されます。
localeNameLPWSTR8/4+24+20取り消し線が描画される対象のテキストのロケールを格納する文字の配列です。
measuringModeDWRITE_MEASURING_MODE4+32+24測定モードは、GDI 互換モードで太さを整数ピクセルに丸めるなど、下線をどのように描画するかをレンダラーが判断する際に役立ちます。

公式ドキュメント

取り消し線のサイズと配置に関する情報を格納します。すべての座標はデバイス非依存ピクセル (DIP) 単位です。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#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