ホーム › Graphics.DirectWrite › DWRITE_UNDERLINE
DWRITE_UNDERLINE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| width | FLOAT | 4 | +0 | +0 | 下線の幅を示す値です。ベースラインと平行に測定されます。 |
| thickness | FLOAT | 4 | +4 | +4 | 下線の太さを示す値です。ベースラインと垂直に測定されます。 |
| offset | FLOAT | 4 | +8 | +8 | ベースラインからの下線のオフセットを示す値です。正のオフセットはベースラインより下 (テキストから離れる方向) の位置を表し、負のオフセットは上 (テキストに近づく方向) を表します。 |
| runHeight | FLOAT | 4 | +12 | +12 | 下線が適用される実行領域のうち、最も高いものの高さを示す値です。 |
| readingDirection | DWRITE_READING_DIRECTION | 4 | +16 | +16 | 下線に関連付けられたテキストの読み取り方向を示す値です。この値は、width の値が水平方向と垂直方向のどちらに伸びるかを解釈するために使用されます。 |
| flowDirection | DWRITE_FLOW_DIRECTION | 4 | +20 | +20 | 下線に関連付けられたテキストのフロー方向を示す値です。この値は、thickness の値が上から下、左から右、右から左のいずれの方向に進むかを解釈するために使用されます。 |
| localeName | LPWSTR | 8/4 | +24 | +24 | 下線が引かれるテキストのロケールを格納する文字の配列です。たとえば縦書きテキストでは、中国語の場合は下線が左側に、日本語の場合は右側に配置されます。 |
| measuringMode | DWRITE_MEASURING_MODE | 4 | +32 | +28 | 測定モードは、GDI 互換モードで太さをピクセル単位に丸めるなど、下線をどのように描画するかをレンダラーが判断する際に役立ちます。 |
公式ドキュメント
下線の幅、太さ、オフセット、実行領域の高さ、読み取り方向、フロー方向に関する情報を格納します。
解説(Remarks)
すべての座標はデバイス非依存ピクセル (DIP) 単位です。
出典・ライセンス: 上記「公式ドキュメント」の内容は 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>
// DWRITE_UNDERLINE (x64 40 / x86 32 バイト)
typedef struct DWRITE_UNDERLINE {
FLOAT width;
FLOAT thickness;
FLOAT offset;
FLOAT runHeight;
DWRITE_READING_DIRECTION readingDirection;
DWRITE_FLOW_DIRECTION flowDirection;
LPWSTR localeName;
DWRITE_MEASURING_MODE measuringMode;
} DWRITE_UNDERLINE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DWRITE_UNDERLINE
{
public float width;
public float thickness;
public float offset;
public float runHeight;
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_UNDERLINE
Public width As Single
Public thickness As Single
Public offset As Single
Public runHeight As Single
Public readingDirection As Integer
Public flowDirection As Integer
Public localeName As IntPtr
Public measuringMode As Integer
End Structureimport ctypes
from ctypes import wintypes
class DWRITE_UNDERLINE(ctypes.Structure):
_fields_ = [
("width", ctypes.c_float),
("thickness", ctypes.c_float),
("offset", ctypes.c_float),
("runHeight", 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_UNDERLINE {
pub width: f32,
pub thickness: f32,
pub offset: f32,
pub runHeight: 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_UNDERLINE struct {
width float32
thickness float32
offset float32
runHeight float32
readingDirection int32
flowDirection int32
localeName uintptr
measuringMode int32
}type
DWRITE_UNDERLINE = record
width: Single;
thickness: Single;
offset: Single;
runHeight: Single;
readingDirection: Integer;
flowDirection: Integer;
localeName: Pointer;
measuringMode: Integer;
end;const DWRITE_UNDERLINE = extern struct {
width: f32,
thickness: f32,
offset: f32,
runHeight: f32,
readingDirection: i32,
flowDirection: i32,
localeName: ?*anyopaque,
measuringMode: i32,
};type
DWRITE_UNDERLINE {.bycopy.} = object
width: float32
thickness: float32
offset: float32
runHeight: float32
readingDirection: int32
flowDirection: int32
localeName: pointer
measuringMode: int32struct DWRITE_UNDERLINE
{
float width;
float thickness;
float offset;
float runHeight;
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_UNDERLINE サイズ: 32 バイト(x86)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 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 も可)
; runHeight : FLOAT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; readingDirection : DWRITE_READING_DIRECTION (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; flowDirection : DWRITE_FLOW_DIRECTION (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; localeName : LPWSTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; measuringMode : DWRITE_MEASURING_MODE (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DWRITE_UNDERLINE サイズ: 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 も可)
; runHeight : FLOAT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; readingDirection : DWRITE_READING_DIRECTION (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; flowDirection : DWRITE_FLOW_DIRECTION (+20, 4byte) st.5 = 値 / 値 = st.5 (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_UNDERLINE
#field float width
#field float thickness
#field float offset
#field float runHeight
#field int readingDirection
#field int flowDirection
#field intptr localeName
#field int measuringMode
#endstruct
stdim st, DWRITE_UNDERLINE ; NSTRUCT 変数を確保
st->width = 100
mes "width=" + st->width