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

OUTLINETEXTMETRICA

構造体
サイズx64: 232 バイト / x86: 212 バイト

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

フィールド

フィールドサイズx64x86説明
otmSizeDWORD4+0+0この構造体および後続の文字列を含む全体のサイズをバイト単位で表す。
otmTextMetricsTEXTMETRICA56+4+4基本的な文字メトリック情報を格納するTEXTMETRICA構造体。
otmFillerBYTE1+60+60構造体を整列させるための予約バイト。値は使用しない。
otmPanoseNumberPANOSE10+61+61フォントのPANOSE分類番号を表すPANOSE構造体。
otmfsSelectionDWORD4+72+72フォントの選択属性を表すフラグ。イタリック、下線、太字等を示す。
otmfsTypeDWORD4+76+76フォントの埋め込み権限などを示すフラグ。
otmsCharSlopeRiseINT4+80+80文字傾斜を表すベクトルの垂直成分。傾きの上昇量を表す。
otmsCharSlopeRunINT4+84+84文字傾斜を表すベクトルの水平成分。傾きの走り量を表す。
otmItalicAngleINT4+88+88イタリック角度を10分の1度単位で表す。垂直からの反時計回りの角度。
otmEMSquareDWORD4+92+92フォントのem方眼(デザイン単位)のサイズを表す。
otmAscentINT4+96+96ベースラインから文字上端までの最大の高さを論理単位で表す。
otmDescentINT4+100+100ベースラインから文字下端までの最大の深さを論理単位で表す。負値。
otmLineGapDWORD4+104+104行間に追加すべき推奨間隔を論理単位で表す。
otmsCapEmHeightDWORD4+108+108大文字の高さ(キャップハイト)を論理単位で表す。
otmsXHeightDWORD4+112+112小文字xの高さ(エックスハイト)を論理単位で表す。
otmrcFontBoxRECT16+116+116フォント全体の外接矩形(フォントバウンディングボックス)を表す。
otmMacAscentINT4+132+132Macintosh実装でのフォント上端の高さを論理単位で表す。
otmMacDescentINT4+136+136Macintosh実装でのフォント下端の深さを論理単位で表す。負値。
otmMacLineGapDWORD4+140+140Macintosh実装での行間隔を論理単位で表す。
otmusMinimumPPEMDWORD4+144+144フォントが意図される最小のem辺ピクセル数(PPEM)を表す。
otmptSubscriptSizePOINT8+148+148下付き文字の推奨サイズ(幅と高さ)を表すPOINT構造体。
otmptSubscriptOffsetPOINT8+156+156下付き文字の推奨オフセット位置を表すPOINT構造体。
otmptSuperscriptSizePOINT8+164+164上付き文字の推奨サイズ(幅と高さ)を表すPOINT構造体。
otmptSuperscriptOffsetPOINT8+172+172上付き文字の推奨オフセット位置を表すPOINT構造体。
otmsStrikeoutSizeDWORD4+180+180取り消し線の太さを論理単位で表す。
otmsStrikeoutPositionINT4+184+184ベースラインから取り消し線位置までの距離を論理単位で表す。
otmsUnderscoreSizeINT4+188+188下線の太さを論理単位で表す。
otmsUnderscorePositionINT4+192+192ベースラインから下線位置までの距離を論理単位で表す。負値。
otmpFamilyNameLPSTR8/4+200+196フォントファミリ名へのオフセット(構造体先頭からのバイト数)を表すANSI文字列ポインタ。
otmpFaceNameLPSTR8/4+208+200フォントの書体名へのオフセットを表すANSI文字列ポインタ。
otmpStyleNameLPSTR8/4+216+204フォントのスタイル名へのオフセットを表すANSI文字列ポインタ。
otmpFullNameLPSTR8/4+224+208フォントのフルネームへのオフセットを表すANSI文字列ポインタ。

各言語での定義

#include <windows.h>

// TEXTMETRICA  (x64 56 / x86 56 バイト)
typedef struct TEXTMETRICA {
    INT tmHeight;
    INT tmAscent;
    INT tmDescent;
    INT tmInternalLeading;
    INT tmExternalLeading;
    INT tmAveCharWidth;
    INT tmMaxCharWidth;
    INT tmWeight;
    INT tmOverhang;
    INT tmDigitizedAspectX;
    INT tmDigitizedAspectY;
    BYTE tmFirstChar;
    BYTE tmLastChar;
    BYTE tmDefaultChar;
    BYTE tmBreakChar;
    BYTE tmItalic;
    BYTE tmUnderlined;
    BYTE tmStruckOut;
    TMPF_FLAGS tmPitchAndFamily;
    BYTE tmCharSet;
} TEXTMETRICA;

// PANOSE  (x64 10 / x86 10 バイト)
typedef struct PANOSE {
    PAN_FAMILY_TYPE bFamilyType;
    PAN_SERIF_STYLE bSerifStyle;
    PAN_WEIGHT bWeight;
    PAN_PROPORTION bProportion;
    PAN_CONTRAST bContrast;
    PAN_STROKE_VARIATION bStrokeVariation;
    PAN_ARM_STYLE bArmStyle;
    PAN_LETT_FORM bLetterform;
    PAN_MIDLINE bMidline;
    PAN_XHEIGHT bXHeight;
} PANOSE;

// RECT  (x64 16 / x86 16 バイト)
typedef struct RECT {
    INT left;
    INT top;
    INT right;
    INT bottom;
} RECT;

// POINT  (x64 8 / x86 8 バイト)
typedef struct POINT {
    INT x;
    INT y;
} POINT;

// OUTLINETEXTMETRICA  (x64 232 / x86 212 バイト)
typedef struct OUTLINETEXTMETRICA {
    DWORD otmSize;
    TEXTMETRICA otmTextMetrics;
    BYTE otmFiller;
    PANOSE otmPanoseNumber;
    DWORD otmfsSelection;
    DWORD otmfsType;
    INT otmsCharSlopeRise;
    INT otmsCharSlopeRun;
    INT otmItalicAngle;
    DWORD otmEMSquare;
    INT otmAscent;
    INT otmDescent;
    DWORD otmLineGap;
    DWORD otmsCapEmHeight;
    DWORD otmsXHeight;
    RECT otmrcFontBox;
    INT otmMacAscent;
    INT otmMacDescent;
    DWORD otmMacLineGap;
    DWORD otmusMinimumPPEM;
    POINT otmptSubscriptSize;
    POINT otmptSubscriptOffset;
    POINT otmptSuperscriptSize;
    POINT otmptSuperscriptOffset;
    DWORD otmsStrikeoutSize;
    INT otmsStrikeoutPosition;
    INT otmsUnderscoreSize;
    INT otmsUnderscorePosition;
    LPSTR otmpFamilyName;
    LPSTR otmpFaceName;
    LPSTR otmpStyleName;
    LPSTR otmpFullName;
} OUTLINETEXTMETRICA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TEXTMETRICA
{
    public int tmHeight;
    public int tmAscent;
    public int tmDescent;
    public int tmInternalLeading;
    public int tmExternalLeading;
    public int tmAveCharWidth;
    public int tmMaxCharWidth;
    public int tmWeight;
    public int tmOverhang;
    public int tmDigitizedAspectX;
    public int tmDigitizedAspectY;
    public byte tmFirstChar;
    public byte tmLastChar;
    public byte tmDefaultChar;
    public byte tmBreakChar;
    public byte tmItalic;
    public byte tmUnderlined;
    public byte tmStruckOut;
    public byte tmPitchAndFamily;
    public byte tmCharSet;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PANOSE
{
    public byte bFamilyType;
    public byte bSerifStyle;
    public byte bWeight;
    public byte bProportion;
    public byte bContrast;
    public byte bStrokeVariation;
    public byte bArmStyle;
    public byte bLetterform;
    public byte bMidline;
    public byte bXHeight;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECT
{
    public int left;
    public int top;
    public int right;
    public int bottom;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POINT
{
    public int x;
    public int y;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OUTLINETEXTMETRICA
{
    public uint otmSize;
    public TEXTMETRICA otmTextMetrics;
    public byte otmFiller;
    public PANOSE otmPanoseNumber;
    public uint otmfsSelection;
    public uint otmfsType;
    public int otmsCharSlopeRise;
    public int otmsCharSlopeRun;
    public int otmItalicAngle;
    public uint otmEMSquare;
    public int otmAscent;
    public int otmDescent;
    public uint otmLineGap;
    public uint otmsCapEmHeight;
    public uint otmsXHeight;
    public RECT otmrcFontBox;
    public int otmMacAscent;
    public int otmMacDescent;
    public uint otmMacLineGap;
    public uint otmusMinimumPPEM;
    public POINT otmptSubscriptSize;
    public POINT otmptSubscriptOffset;
    public POINT otmptSuperscriptSize;
    public POINT otmptSuperscriptOffset;
    public uint otmsStrikeoutSize;
    public int otmsStrikeoutPosition;
    public int otmsUnderscoreSize;
    public int otmsUnderscorePosition;
    public IntPtr otmpFamilyName;
    public IntPtr otmpFaceName;
    public IntPtr otmpStyleName;
    public IntPtr otmpFullName;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TEXTMETRICA
    Public tmHeight As Integer
    Public tmAscent As Integer
    Public tmDescent As Integer
    Public tmInternalLeading As Integer
    Public tmExternalLeading As Integer
    Public tmAveCharWidth As Integer
    Public tmMaxCharWidth As Integer
    Public tmWeight As Integer
    Public tmOverhang As Integer
    Public tmDigitizedAspectX As Integer
    Public tmDigitizedAspectY As Integer
    Public tmFirstChar As Byte
    Public tmLastChar As Byte
    Public tmDefaultChar As Byte
    Public tmBreakChar As Byte
    Public tmItalic As Byte
    Public tmUnderlined As Byte
    Public tmStruckOut As Byte
    Public tmPitchAndFamily As Byte
    Public tmCharSet As Byte
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PANOSE
    Public bFamilyType As Byte
    Public bSerifStyle As Byte
    Public bWeight As Byte
    Public bProportion As Byte
    Public bContrast As Byte
    Public bStrokeVariation As Byte
    Public bArmStyle As Byte
    Public bLetterform As Byte
    Public bMidline As Byte
    Public bXHeight As Byte
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECT
    Public left As Integer
    Public top As Integer
    Public right As Integer
    Public bottom As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POINT
    Public x As Integer
    Public y As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure OUTLINETEXTMETRICA
    Public otmSize As UInteger
    Public otmTextMetrics As TEXTMETRICA
    Public otmFiller As Byte
    Public otmPanoseNumber As PANOSE
    Public otmfsSelection As UInteger
    Public otmfsType As UInteger
    Public otmsCharSlopeRise As Integer
    Public otmsCharSlopeRun As Integer
    Public otmItalicAngle As Integer
    Public otmEMSquare As UInteger
    Public otmAscent As Integer
    Public otmDescent As Integer
    Public otmLineGap As UInteger
    Public otmsCapEmHeight As UInteger
    Public otmsXHeight As UInteger
    Public otmrcFontBox As RECT
    Public otmMacAscent As Integer
    Public otmMacDescent As Integer
    Public otmMacLineGap As UInteger
    Public otmusMinimumPPEM As UInteger
    Public otmptSubscriptSize As POINT
    Public otmptSubscriptOffset As POINT
    Public otmptSuperscriptSize As POINT
    Public otmptSuperscriptOffset As POINT
    Public otmsStrikeoutSize As UInteger
    Public otmsStrikeoutPosition As Integer
    Public otmsUnderscoreSize As Integer
    Public otmsUnderscorePosition As Integer
    Public otmpFamilyName As IntPtr
    Public otmpFaceName As IntPtr
    Public otmpStyleName As IntPtr
    Public otmpFullName As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class TEXTMETRICA(ctypes.Structure):
    _fields_ = [
        ("tmHeight", ctypes.c_int),
        ("tmAscent", ctypes.c_int),
        ("tmDescent", ctypes.c_int),
        ("tmInternalLeading", ctypes.c_int),
        ("tmExternalLeading", ctypes.c_int),
        ("tmAveCharWidth", ctypes.c_int),
        ("tmMaxCharWidth", ctypes.c_int),
        ("tmWeight", ctypes.c_int),
        ("tmOverhang", ctypes.c_int),
        ("tmDigitizedAspectX", ctypes.c_int),
        ("tmDigitizedAspectY", ctypes.c_int),
        ("tmFirstChar", ctypes.c_ubyte),
        ("tmLastChar", ctypes.c_ubyte),
        ("tmDefaultChar", ctypes.c_ubyte),
        ("tmBreakChar", ctypes.c_ubyte),
        ("tmItalic", ctypes.c_ubyte),
        ("tmUnderlined", ctypes.c_ubyte),
        ("tmStruckOut", ctypes.c_ubyte),
        ("tmPitchAndFamily", ctypes.c_ubyte),
        ("tmCharSet", ctypes.c_ubyte),
    ]

class PANOSE(ctypes.Structure):
    _fields_ = [
        ("bFamilyType", ctypes.c_ubyte),
        ("bSerifStyle", ctypes.c_ubyte),
        ("bWeight", ctypes.c_ubyte),
        ("bProportion", ctypes.c_ubyte),
        ("bContrast", ctypes.c_ubyte),
        ("bStrokeVariation", ctypes.c_ubyte),
        ("bArmStyle", ctypes.c_ubyte),
        ("bLetterform", ctypes.c_ubyte),
        ("bMidline", ctypes.c_ubyte),
        ("bXHeight", ctypes.c_ubyte),
    ]

class RECT(ctypes.Structure):
    _fields_ = [
        ("left", ctypes.c_int),
        ("top", ctypes.c_int),
        ("right", ctypes.c_int),
        ("bottom", ctypes.c_int),
    ]

class POINT(ctypes.Structure):
    _fields_ = [
        ("x", ctypes.c_int),
        ("y", ctypes.c_int),
    ]

class OUTLINETEXTMETRICA(ctypes.Structure):
    _fields_ = [
        ("otmSize", wintypes.DWORD),
        ("otmTextMetrics", TEXTMETRICA),
        ("otmFiller", ctypes.c_ubyte),
        ("otmPanoseNumber", PANOSE),
        ("otmfsSelection", wintypes.DWORD),
        ("otmfsType", wintypes.DWORD),
        ("otmsCharSlopeRise", ctypes.c_int),
        ("otmsCharSlopeRun", ctypes.c_int),
        ("otmItalicAngle", ctypes.c_int),
        ("otmEMSquare", wintypes.DWORD),
        ("otmAscent", ctypes.c_int),
        ("otmDescent", ctypes.c_int),
        ("otmLineGap", wintypes.DWORD),
        ("otmsCapEmHeight", wintypes.DWORD),
        ("otmsXHeight", wintypes.DWORD),
        ("otmrcFontBox", RECT),
        ("otmMacAscent", ctypes.c_int),
        ("otmMacDescent", ctypes.c_int),
        ("otmMacLineGap", wintypes.DWORD),
        ("otmusMinimumPPEM", wintypes.DWORD),
        ("otmptSubscriptSize", POINT),
        ("otmptSubscriptOffset", POINT),
        ("otmptSuperscriptSize", POINT),
        ("otmptSuperscriptOffset", POINT),
        ("otmsStrikeoutSize", wintypes.DWORD),
        ("otmsStrikeoutPosition", ctypes.c_int),
        ("otmsUnderscoreSize", ctypes.c_int),
        ("otmsUnderscorePosition", ctypes.c_int),
        ("otmpFamilyName", ctypes.c_void_p),
        ("otmpFaceName", ctypes.c_void_p),
        ("otmpStyleName", ctypes.c_void_p),
        ("otmpFullName", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct TEXTMETRICA {
    pub tmHeight: i32,
    pub tmAscent: i32,
    pub tmDescent: i32,
    pub tmInternalLeading: i32,
    pub tmExternalLeading: i32,
    pub tmAveCharWidth: i32,
    pub tmMaxCharWidth: i32,
    pub tmWeight: i32,
    pub tmOverhang: i32,
    pub tmDigitizedAspectX: i32,
    pub tmDigitizedAspectY: i32,
    pub tmFirstChar: u8,
    pub tmLastChar: u8,
    pub tmDefaultChar: u8,
    pub tmBreakChar: u8,
    pub tmItalic: u8,
    pub tmUnderlined: u8,
    pub tmStruckOut: u8,
    pub tmPitchAndFamily: u8,
    pub tmCharSet: u8,
}

#[repr(C)]
pub struct PANOSE {
    pub bFamilyType: u8,
    pub bSerifStyle: u8,
    pub bWeight: u8,
    pub bProportion: u8,
    pub bContrast: u8,
    pub bStrokeVariation: u8,
    pub bArmStyle: u8,
    pub bLetterform: u8,
    pub bMidline: u8,
    pub bXHeight: u8,
}

#[repr(C)]
pub struct RECT {
    pub left: i32,
    pub top: i32,
    pub right: i32,
    pub bottom: i32,
}

#[repr(C)]
pub struct POINT {
    pub x: i32,
    pub y: i32,
}

#[repr(C)]
pub struct OUTLINETEXTMETRICA {
    pub otmSize: u32,
    pub otmTextMetrics: TEXTMETRICA,
    pub otmFiller: u8,
    pub otmPanoseNumber: PANOSE,
    pub otmfsSelection: u32,
    pub otmfsType: u32,
    pub otmsCharSlopeRise: i32,
    pub otmsCharSlopeRun: i32,
    pub otmItalicAngle: i32,
    pub otmEMSquare: u32,
    pub otmAscent: i32,
    pub otmDescent: i32,
    pub otmLineGap: u32,
    pub otmsCapEmHeight: u32,
    pub otmsXHeight: u32,
    pub otmrcFontBox: RECT,
    pub otmMacAscent: i32,
    pub otmMacDescent: i32,
    pub otmMacLineGap: u32,
    pub otmusMinimumPPEM: u32,
    pub otmptSubscriptSize: POINT,
    pub otmptSubscriptOffset: POINT,
    pub otmptSuperscriptSize: POINT,
    pub otmptSuperscriptOffset: POINT,
    pub otmsStrikeoutSize: u32,
    pub otmsStrikeoutPosition: i32,
    pub otmsUnderscoreSize: i32,
    pub otmsUnderscorePosition: i32,
    pub otmpFamilyName: *mut core::ffi::c_void,
    pub otmpFaceName: *mut core::ffi::c_void,
    pub otmpStyleName: *mut core::ffi::c_void,
    pub otmpFullName: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type TEXTMETRICA struct {
	tmHeight int32
	tmAscent int32
	tmDescent int32
	tmInternalLeading int32
	tmExternalLeading int32
	tmAveCharWidth int32
	tmMaxCharWidth int32
	tmWeight int32
	tmOverhang int32
	tmDigitizedAspectX int32
	tmDigitizedAspectY int32
	tmFirstChar byte
	tmLastChar byte
	tmDefaultChar byte
	tmBreakChar byte
	tmItalic byte
	tmUnderlined byte
	tmStruckOut byte
	tmPitchAndFamily byte
	tmCharSet byte
}

type PANOSE struct {
	bFamilyType byte
	bSerifStyle byte
	bWeight byte
	bProportion byte
	bContrast byte
	bStrokeVariation byte
	bArmStyle byte
	bLetterform byte
	bMidline byte
	bXHeight byte
}

type RECT struct {
	left int32
	top int32
	right int32
	bottom int32
}

type POINT struct {
	x int32
	y int32
}

type OUTLINETEXTMETRICA struct {
	otmSize uint32
	otmTextMetrics TEXTMETRICA
	otmFiller byte
	otmPanoseNumber PANOSE
	otmfsSelection uint32
	otmfsType uint32
	otmsCharSlopeRise int32
	otmsCharSlopeRun int32
	otmItalicAngle int32
	otmEMSquare uint32
	otmAscent int32
	otmDescent int32
	otmLineGap uint32
	otmsCapEmHeight uint32
	otmsXHeight uint32
	otmrcFontBox RECT
	otmMacAscent int32
	otmMacDescent int32
	otmMacLineGap uint32
	otmusMinimumPPEM uint32
	otmptSubscriptSize POINT
	otmptSubscriptOffset POINT
	otmptSuperscriptSize POINT
	otmptSuperscriptOffset POINT
	otmsStrikeoutSize uint32
	otmsStrikeoutPosition int32
	otmsUnderscoreSize int32
	otmsUnderscorePosition int32
	otmpFamilyName uintptr
	otmpFaceName uintptr
	otmpStyleName uintptr
	otmpFullName uintptr
}
type
  TEXTMETRICA = record
    tmHeight: Integer;
    tmAscent: Integer;
    tmDescent: Integer;
    tmInternalLeading: Integer;
    tmExternalLeading: Integer;
    tmAveCharWidth: Integer;
    tmMaxCharWidth: Integer;
    tmWeight: Integer;
    tmOverhang: Integer;
    tmDigitizedAspectX: Integer;
    tmDigitizedAspectY: Integer;
    tmFirstChar: Byte;
    tmLastChar: Byte;
    tmDefaultChar: Byte;
    tmBreakChar: Byte;
    tmItalic: Byte;
    tmUnderlined: Byte;
    tmStruckOut: Byte;
    tmPitchAndFamily: Byte;
    tmCharSet: Byte;
  end;

  PANOSE = record
    bFamilyType: Byte;
    bSerifStyle: Byte;
    bWeight: Byte;
    bProportion: Byte;
    bContrast: Byte;
    bStrokeVariation: Byte;
    bArmStyle: Byte;
    bLetterform: Byte;
    bMidline: Byte;
    bXHeight: Byte;
  end;

  RECT = record
    left: Integer;
    top: Integer;
    right: Integer;
    bottom: Integer;
  end;

  POINT = record
    x: Integer;
    y: Integer;
  end;

  OUTLINETEXTMETRICA = record
    otmSize: DWORD;
    otmTextMetrics: TEXTMETRICA;
    otmFiller: Byte;
    otmPanoseNumber: PANOSE;
    otmfsSelection: DWORD;
    otmfsType: DWORD;
    otmsCharSlopeRise: Integer;
    otmsCharSlopeRun: Integer;
    otmItalicAngle: Integer;
    otmEMSquare: DWORD;
    otmAscent: Integer;
    otmDescent: Integer;
    otmLineGap: DWORD;
    otmsCapEmHeight: DWORD;
    otmsXHeight: DWORD;
    otmrcFontBox: RECT;
    otmMacAscent: Integer;
    otmMacDescent: Integer;
    otmMacLineGap: DWORD;
    otmusMinimumPPEM: DWORD;
    otmptSubscriptSize: POINT;
    otmptSubscriptOffset: POINT;
    otmptSuperscriptSize: POINT;
    otmptSuperscriptOffset: POINT;
    otmsStrikeoutSize: DWORD;
    otmsStrikeoutPosition: Integer;
    otmsUnderscoreSize: Integer;
    otmsUnderscorePosition: Integer;
    otmpFamilyName: Pointer;
    otmpFaceName: Pointer;
    otmpStyleName: Pointer;
    otmpFullName: Pointer;
  end;
const TEXTMETRICA = extern struct {
    tmHeight: i32,
    tmAscent: i32,
    tmDescent: i32,
    tmInternalLeading: i32,
    tmExternalLeading: i32,
    tmAveCharWidth: i32,
    tmMaxCharWidth: i32,
    tmWeight: i32,
    tmOverhang: i32,
    tmDigitizedAspectX: i32,
    tmDigitizedAspectY: i32,
    tmFirstChar: u8,
    tmLastChar: u8,
    tmDefaultChar: u8,
    tmBreakChar: u8,
    tmItalic: u8,
    tmUnderlined: u8,
    tmStruckOut: u8,
    tmPitchAndFamily: u8,
    tmCharSet: u8,
};

const PANOSE = extern struct {
    bFamilyType: u8,
    bSerifStyle: u8,
    bWeight: u8,
    bProportion: u8,
    bContrast: u8,
    bStrokeVariation: u8,
    bArmStyle: u8,
    bLetterform: u8,
    bMidline: u8,
    bXHeight: u8,
};

const RECT = extern struct {
    left: i32,
    top: i32,
    right: i32,
    bottom: i32,
};

const POINT = extern struct {
    x: i32,
    y: i32,
};

const OUTLINETEXTMETRICA = extern struct {
    otmSize: u32,
    otmTextMetrics: TEXTMETRICA,
    otmFiller: u8,
    otmPanoseNumber: PANOSE,
    otmfsSelection: u32,
    otmfsType: u32,
    otmsCharSlopeRise: i32,
    otmsCharSlopeRun: i32,
    otmItalicAngle: i32,
    otmEMSquare: u32,
    otmAscent: i32,
    otmDescent: i32,
    otmLineGap: u32,
    otmsCapEmHeight: u32,
    otmsXHeight: u32,
    otmrcFontBox: RECT,
    otmMacAscent: i32,
    otmMacDescent: i32,
    otmMacLineGap: u32,
    otmusMinimumPPEM: u32,
    otmptSubscriptSize: POINT,
    otmptSubscriptOffset: POINT,
    otmptSuperscriptSize: POINT,
    otmptSuperscriptOffset: POINT,
    otmsStrikeoutSize: u32,
    otmsStrikeoutPosition: i32,
    otmsUnderscoreSize: i32,
    otmsUnderscorePosition: i32,
    otmpFamilyName: ?*anyopaque,
    otmpFaceName: ?*anyopaque,
    otmpStyleName: ?*anyopaque,
    otmpFullName: ?*anyopaque,
};
type
  TEXTMETRICA {.bycopy.} = object
    tmHeight: int32
    tmAscent: int32
    tmDescent: int32
    tmInternalLeading: int32
    tmExternalLeading: int32
    tmAveCharWidth: int32
    tmMaxCharWidth: int32
    tmWeight: int32
    tmOverhang: int32
    tmDigitizedAspectX: int32
    tmDigitizedAspectY: int32
    tmFirstChar: uint8
    tmLastChar: uint8
    tmDefaultChar: uint8
    tmBreakChar: uint8
    tmItalic: uint8
    tmUnderlined: uint8
    tmStruckOut: uint8
    tmPitchAndFamily: uint8
    tmCharSet: uint8

  PANOSE {.bycopy.} = object
    bFamilyType: uint8
    bSerifStyle: uint8
    bWeight: uint8
    bProportion: uint8
    bContrast: uint8
    bStrokeVariation: uint8
    bArmStyle: uint8
    bLetterform: uint8
    bMidline: uint8
    bXHeight: uint8

  RECT {.bycopy.} = object
    left: int32
    top: int32
    right: int32
    bottom: int32

  POINT {.bycopy.} = object
    x: int32
    y: int32

  OUTLINETEXTMETRICA {.bycopy.} = object
    otmSize: uint32
    otmTextMetrics: TEXTMETRICA
    otmFiller: uint8
    otmPanoseNumber: PANOSE
    otmfsSelection: uint32
    otmfsType: uint32
    otmsCharSlopeRise: int32
    otmsCharSlopeRun: int32
    otmItalicAngle: int32
    otmEMSquare: uint32
    otmAscent: int32
    otmDescent: int32
    otmLineGap: uint32
    otmsCapEmHeight: uint32
    otmsXHeight: uint32
    otmrcFontBox: RECT
    otmMacAscent: int32
    otmMacDescent: int32
    otmMacLineGap: uint32
    otmusMinimumPPEM: uint32
    otmptSubscriptSize: POINT
    otmptSubscriptOffset: POINT
    otmptSuperscriptSize: POINT
    otmptSuperscriptOffset: POINT
    otmsStrikeoutSize: uint32
    otmsStrikeoutPosition: int32
    otmsUnderscoreSize: int32
    otmsUnderscorePosition: int32
    otmpFamilyName: pointer
    otmpFaceName: pointer
    otmpStyleName: pointer
    otmpFullName: pointer
struct TEXTMETRICA
{
    int tmHeight;
    int tmAscent;
    int tmDescent;
    int tmInternalLeading;
    int tmExternalLeading;
    int tmAveCharWidth;
    int tmMaxCharWidth;
    int tmWeight;
    int tmOverhang;
    int tmDigitizedAspectX;
    int tmDigitizedAspectY;
    ubyte tmFirstChar;
    ubyte tmLastChar;
    ubyte tmDefaultChar;
    ubyte tmBreakChar;
    ubyte tmItalic;
    ubyte tmUnderlined;
    ubyte tmStruckOut;
    ubyte tmPitchAndFamily;
    ubyte tmCharSet;
}

struct PANOSE
{
    ubyte bFamilyType;
    ubyte bSerifStyle;
    ubyte bWeight;
    ubyte bProportion;
    ubyte bContrast;
    ubyte bStrokeVariation;
    ubyte bArmStyle;
    ubyte bLetterform;
    ubyte bMidline;
    ubyte bXHeight;
}

struct RECT
{
    int left;
    int top;
    int right;
    int bottom;
}

struct POINT
{
    int x;
    int y;
}

struct OUTLINETEXTMETRICA
{
    uint otmSize;
    TEXTMETRICA otmTextMetrics;
    ubyte otmFiller;
    PANOSE otmPanoseNumber;
    uint otmfsSelection;
    uint otmfsType;
    int otmsCharSlopeRise;
    int otmsCharSlopeRun;
    int otmItalicAngle;
    uint otmEMSquare;
    int otmAscent;
    int otmDescent;
    uint otmLineGap;
    uint otmsCapEmHeight;
    uint otmsXHeight;
    RECT otmrcFontBox;
    int otmMacAscent;
    int otmMacDescent;
    uint otmMacLineGap;
    uint otmusMinimumPPEM;
    POINT otmptSubscriptSize;
    POINT otmptSubscriptOffset;
    POINT otmptSuperscriptSize;
    POINT otmptSuperscriptOffset;
    uint otmsStrikeoutSize;
    int otmsStrikeoutPosition;
    int otmsUnderscoreSize;
    int otmsUnderscorePosition;
    void* otmpFamilyName;
    void* otmpFaceName;
    void* otmpStyleName;
    void* otmpFullName;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; OUTLINETEXTMETRICA サイズ: 212 バイト(x86)
dim st, 53    ; 4byte整数×53(構造体サイズ 212 / 4 切り上げ)
; otmSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; otmTextMetrics : TEXTMETRICA (+4, 56byte)  varptr(st)+4 を基点に操作(56byte:入れ子/配列)
; otmFiller : BYTE (+60, 1byte)  poke st,60,値  /  値 = peek(st,60)
; otmPanoseNumber : PANOSE (+61, 10byte)  varptr(st)+61 を基点に操作(10byte:入れ子/配列)
; otmfsSelection : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; otmfsType : DWORD (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; otmsCharSlopeRise : INT (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; otmsCharSlopeRun : INT (+84, 4byte)  st.21 = 値  /  値 = st.21   (lpoke/lpeek も可)
; otmItalicAngle : INT (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; otmEMSquare : DWORD (+92, 4byte)  st.23 = 値  /  値 = st.23   (lpoke/lpeek も可)
; otmAscent : INT (+96, 4byte)  st.24 = 値  /  値 = st.24   (lpoke/lpeek も可)
; otmDescent : INT (+100, 4byte)  st.25 = 値  /  値 = st.25   (lpoke/lpeek も可)
; otmLineGap : DWORD (+104, 4byte)  st.26 = 値  /  値 = st.26   (lpoke/lpeek も可)
; otmsCapEmHeight : DWORD (+108, 4byte)  st.27 = 値  /  値 = st.27   (lpoke/lpeek も可)
; otmsXHeight : DWORD (+112, 4byte)  st.28 = 値  /  値 = st.28   (lpoke/lpeek も可)
; otmrcFontBox : RECT (+116, 16byte)  varptr(st)+116 を基点に操作(16byte:入れ子/配列)
; otmMacAscent : INT (+132, 4byte)  st.33 = 値  /  値 = st.33   (lpoke/lpeek も可)
; otmMacDescent : INT (+136, 4byte)  st.34 = 値  /  値 = st.34   (lpoke/lpeek も可)
; otmMacLineGap : DWORD (+140, 4byte)  st.35 = 値  /  値 = st.35   (lpoke/lpeek も可)
; otmusMinimumPPEM : DWORD (+144, 4byte)  st.36 = 値  /  値 = st.36   (lpoke/lpeek も可)
; otmptSubscriptSize : POINT (+148, 8byte)  varptr(st)+148 を基点に操作(8byte:入れ子/配列)
; otmptSubscriptOffset : POINT (+156, 8byte)  varptr(st)+156 を基点に操作(8byte:入れ子/配列)
; otmptSuperscriptSize : POINT (+164, 8byte)  varptr(st)+164 を基点に操作(8byte:入れ子/配列)
; otmptSuperscriptOffset : POINT (+172, 8byte)  varptr(st)+172 を基点に操作(8byte:入れ子/配列)
; otmsStrikeoutSize : DWORD (+180, 4byte)  st.45 = 値  /  値 = st.45   (lpoke/lpeek も可)
; otmsStrikeoutPosition : INT (+184, 4byte)  st.46 = 値  /  値 = st.46   (lpoke/lpeek も可)
; otmsUnderscoreSize : INT (+188, 4byte)  st.47 = 値  /  値 = st.47   (lpoke/lpeek も可)
; otmsUnderscorePosition : INT (+192, 4byte)  st.48 = 値  /  値 = st.48   (lpoke/lpeek も可)
; otmpFamilyName : LPSTR (+196, 4byte)  st.49 = 値  /  値 = st.49   (lpoke/lpeek も可)
; otmpFaceName : LPSTR (+200, 4byte)  st.50 = 値  /  値 = st.50   (lpoke/lpeek も可)
; otmpStyleName : LPSTR (+204, 4byte)  st.51 = 値  /  値 = st.51   (lpoke/lpeek も可)
; otmpFullName : LPSTR (+208, 4byte)  st.52 = 値  /  値 = st.52   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; OUTLINETEXTMETRICA サイズ: 232 バイト(x64)
dim st, 58    ; 4byte整数×58(構造体サイズ 232 / 4 切り上げ)
; otmSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; otmTextMetrics : TEXTMETRICA (+4, 56byte)  varptr(st)+4 を基点に操作(56byte:入れ子/配列)
; otmFiller : BYTE (+60, 1byte)  poke st,60,値  /  値 = peek(st,60)
; otmPanoseNumber : PANOSE (+61, 10byte)  varptr(st)+61 を基点に操作(10byte:入れ子/配列)
; otmfsSelection : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; otmfsType : DWORD (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; otmsCharSlopeRise : INT (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; otmsCharSlopeRun : INT (+84, 4byte)  st.21 = 値  /  値 = st.21   (lpoke/lpeek も可)
; otmItalicAngle : INT (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; otmEMSquare : DWORD (+92, 4byte)  st.23 = 値  /  値 = st.23   (lpoke/lpeek も可)
; otmAscent : INT (+96, 4byte)  st.24 = 値  /  値 = st.24   (lpoke/lpeek も可)
; otmDescent : INT (+100, 4byte)  st.25 = 値  /  値 = st.25   (lpoke/lpeek も可)
; otmLineGap : DWORD (+104, 4byte)  st.26 = 値  /  値 = st.26   (lpoke/lpeek も可)
; otmsCapEmHeight : DWORD (+108, 4byte)  st.27 = 値  /  値 = st.27   (lpoke/lpeek も可)
; otmsXHeight : DWORD (+112, 4byte)  st.28 = 値  /  値 = st.28   (lpoke/lpeek も可)
; otmrcFontBox : RECT (+116, 16byte)  varptr(st)+116 を基点に操作(16byte:入れ子/配列)
; otmMacAscent : INT (+132, 4byte)  st.33 = 値  /  値 = st.33   (lpoke/lpeek も可)
; otmMacDescent : INT (+136, 4byte)  st.34 = 値  /  値 = st.34   (lpoke/lpeek も可)
; otmMacLineGap : DWORD (+140, 4byte)  st.35 = 値  /  値 = st.35   (lpoke/lpeek も可)
; otmusMinimumPPEM : DWORD (+144, 4byte)  st.36 = 値  /  値 = st.36   (lpoke/lpeek も可)
; otmptSubscriptSize : POINT (+148, 8byte)  varptr(st)+148 を基点に操作(8byte:入れ子/配列)
; otmptSubscriptOffset : POINT (+156, 8byte)  varptr(st)+156 を基点に操作(8byte:入れ子/配列)
; otmptSuperscriptSize : POINT (+164, 8byte)  varptr(st)+164 を基点に操作(8byte:入れ子/配列)
; otmptSuperscriptOffset : POINT (+172, 8byte)  varptr(st)+172 を基点に操作(8byte:入れ子/配列)
; otmsStrikeoutSize : DWORD (+180, 4byte)  st.45 = 値  /  値 = st.45   (lpoke/lpeek も可)
; otmsStrikeoutPosition : INT (+184, 4byte)  st.46 = 値  /  値 = st.46   (lpoke/lpeek も可)
; otmsUnderscoreSize : INT (+188, 4byte)  st.47 = 値  /  値 = st.47   (lpoke/lpeek も可)
; otmsUnderscorePosition : INT (+192, 4byte)  st.48 = 値  /  値 = st.48   (lpoke/lpeek も可)
; otmpFamilyName : LPSTR (+200, 8byte)  qpoke st,200,値 / qpeek(st,200)  ※IronHSPのみ。3.7/3.8は lpoke st,200,下位 : lpoke st,204,上位
; otmpFaceName : LPSTR (+208, 8byte)  qpoke st,208,値 / qpeek(st,208)  ※IronHSPのみ。3.7/3.8は lpoke st,208,下位 : lpoke st,212,上位
; otmpStyleName : LPSTR (+216, 8byte)  qpoke st,216,値 / qpeek(st,216)  ※IronHSPのみ。3.7/3.8は lpoke st,216,下位 : lpoke st,220,上位
; otmpFullName : LPSTR (+224, 8byte)  qpoke st,224,値 / qpeek(st,224)  ※IronHSPのみ。3.7/3.8は lpoke st,224,下位 : lpoke st,228,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global TEXTMETRICA
    #field int tmHeight
    #field int tmAscent
    #field int tmDescent
    #field int tmInternalLeading
    #field int tmExternalLeading
    #field int tmAveCharWidth
    #field int tmMaxCharWidth
    #field int tmWeight
    #field int tmOverhang
    #field int tmDigitizedAspectX
    #field int tmDigitizedAspectY
    #field byte tmFirstChar
    #field byte tmLastChar
    #field byte tmDefaultChar
    #field byte tmBreakChar
    #field byte tmItalic
    #field byte tmUnderlined
    #field byte tmStruckOut
    #field byte tmPitchAndFamily
    #field byte tmCharSet
#endstruct

#defstruct global PANOSE
    #field byte bFamilyType
    #field byte bSerifStyle
    #field byte bWeight
    #field byte bProportion
    #field byte bContrast
    #field byte bStrokeVariation
    #field byte bArmStyle
    #field byte bLetterform
    #field byte bMidline
    #field byte bXHeight
#endstruct

#defstruct global RECT
    #field int left
    #field int top
    #field int right
    #field int bottom
#endstruct

#defstruct global POINT
    #field int x
    #field int y
#endstruct

#defstruct global OUTLINETEXTMETRICA
    #field int otmSize
    #field TEXTMETRICA otmTextMetrics
    #field byte otmFiller
    #field PANOSE otmPanoseNumber
    #field int otmfsSelection
    #field int otmfsType
    #field int otmsCharSlopeRise
    #field int otmsCharSlopeRun
    #field int otmItalicAngle
    #field int otmEMSquare
    #field int otmAscent
    #field int otmDescent
    #field int otmLineGap
    #field int otmsCapEmHeight
    #field int otmsXHeight
    #field RECT otmrcFontBox
    #field int otmMacAscent
    #field int otmMacDescent
    #field int otmMacLineGap
    #field int otmusMinimumPPEM
    #field POINT otmptSubscriptSize
    #field POINT otmptSubscriptOffset
    #field POINT otmptSuperscriptSize
    #field POINT otmptSuperscriptOffset
    #field int otmsStrikeoutSize
    #field int otmsStrikeoutPosition
    #field int otmsUnderscoreSize
    #field int otmsUnderscorePosition
    #field intptr otmpFamilyName
    #field intptr otmpFaceName
    #field intptr otmpStyleName
    #field intptr otmpFullName
#endstruct

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