ホーム › Graphics.Gdi › OUTLINETEXTMETRICW
OUTLINETEXTMETRICW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| otmSize | DWORD | 4 | +0 | +0 | この構造体および後続の文字列を含む全体のサイズをバイト単位で表す。 |
| otmTextMetrics | TEXTMETRICW | 60 | +4 | +4 | 基本的な文字メトリック情報を格納するTEXTMETRICW構造体。 |
| otmFiller | BYTE | 1 | +64 | +64 | 構造体を整列させるための予約バイト。値は使用しない。 |
| otmPanoseNumber | PANOSE | 10 | +65 | +65 | フォントのPANOSE分類番号を表すPANOSE構造体。 |
| otmfsSelection | DWORD | 4 | +76 | +76 | フォントの選択属性を表すフラグ。イタリック、下線、太字等を示す。 |
| otmfsType | DWORD | 4 | +80 | +80 | フォントの埋め込み権限などを示すフラグ。 |
| otmsCharSlopeRise | INT | 4 | +84 | +84 | 文字傾斜を表すベクトルの垂直成分。傾きの上昇量を表す。 |
| otmsCharSlopeRun | INT | 4 | +88 | +88 | 文字傾斜を表すベクトルの水平成分。傾きの走り量を表す。 |
| otmItalicAngle | INT | 4 | +92 | +92 | イタリック角度を10分の1度単位で表す。垂直からの反時計回りの角度。 |
| otmEMSquare | DWORD | 4 | +96 | +96 | フォントのem方眼(デザイン単位)のサイズを表す。 |
| otmAscent | INT | 4 | +100 | +100 | ベースラインから文字上端までの最大の高さを論理単位で表す。 |
| otmDescent | INT | 4 | +104 | +104 | ベースラインから文字下端までの最大の深さを論理単位で表す。負値。 |
| otmLineGap | DWORD | 4 | +108 | +108 | 行間に追加すべき推奨間隔を論理単位で表す。 |
| otmsCapEmHeight | DWORD | 4 | +112 | +112 | 大文字の高さ(キャップハイト)を論理単位で表す。 |
| otmsXHeight | DWORD | 4 | +116 | +116 | 小文字xの高さ(エックスハイト)を論理単位で表す。 |
| otmrcFontBox | RECT | 16 | +120 | +120 | フォント全体の外接矩形(フォントバウンディングボックス)を表す。 |
| otmMacAscent | INT | 4 | +136 | +136 | Macintosh実装でのフォント上端の高さを論理単位で表す。 |
| otmMacDescent | INT | 4 | +140 | +140 | Macintosh実装でのフォント下端の深さを論理単位で表す。負値。 |
| otmMacLineGap | DWORD | 4 | +144 | +144 | Macintosh実装での行間隔を論理単位で表す。 |
| otmusMinimumPPEM | DWORD | 4 | +148 | +148 | フォントが意図される最小のem辺ピクセル数(PPEM)を表す。 |
| otmptSubscriptSize | POINT | 8 | +152 | +152 | 下付き文字の推奨サイズ(幅と高さ)を表すPOINT構造体。 |
| otmptSubscriptOffset | POINT | 8 | +160 | +160 | 下付き文字の推奨オフセット位置を表すPOINT構造体。 |
| otmptSuperscriptSize | POINT | 8 | +168 | +168 | 上付き文字の推奨サイズ(幅と高さ)を表すPOINT構造体。 |
| otmptSuperscriptOffset | POINT | 8 | +176 | +176 | 上付き文字の推奨オフセット位置を表すPOINT構造体。 |
| otmsStrikeoutSize | DWORD | 4 | +184 | +184 | 取り消し線の太さを論理単位で表す。 |
| otmsStrikeoutPosition | INT | 4 | +188 | +188 | ベースラインから取り消し線位置までの距離を論理単位で表す。 |
| otmsUnderscoreSize | INT | 4 | +192 | +192 | 下線の太さを論理単位で表す。 |
| otmsUnderscorePosition | INT | 4 | +196 | +196 | ベースラインから下線位置までの距離を論理単位で表す。負値。 |
| otmpFamilyName | LPSTR | 8/4 | +200 | +200 | フォントファミリ名へのオフセット(構造体先頭からのバイト数)を表す文字列ポインタ。 |
| otmpFaceName | LPSTR | 8/4 | +208 | +204 | フォントの書体名へのオフセットを表す文字列ポインタ。 |
| otmpStyleName | LPSTR | 8/4 | +216 | +208 | フォントのスタイル名へのオフセットを表す文字列ポインタ。 |
| otmpFullName | LPSTR | 8/4 | +224 | +212 | フォントのフルネームへのオフセットを表す文字列ポインタ。 |
各言語での定義
#include <windows.h>
// TEXTMETRICW (x64 60 / x86 60 バイト)
typedef struct TEXTMETRICW {
INT tmHeight;
INT tmAscent;
INT tmDescent;
INT tmInternalLeading;
INT tmExternalLeading;
INT tmAveCharWidth;
INT tmMaxCharWidth;
INT tmWeight;
INT tmOverhang;
INT tmDigitizedAspectX;
INT tmDigitizedAspectY;
WCHAR tmFirstChar;
WCHAR tmLastChar;
WCHAR tmDefaultChar;
WCHAR tmBreakChar;
BYTE tmItalic;
BYTE tmUnderlined;
BYTE tmStruckOut;
TMPF_FLAGS tmPitchAndFamily;
BYTE tmCharSet;
} TEXTMETRICW;
// 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;
// OUTLINETEXTMETRICW (x64 232 / x86 216 バイト)
typedef struct OUTLINETEXTMETRICW {
DWORD otmSize;
TEXTMETRICW 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;
} OUTLINETEXTMETRICW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TEXTMETRICW
{
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 char tmFirstChar;
public char tmLastChar;
public char tmDefaultChar;
public char 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 OUTLINETEXTMETRICW
{
public uint otmSize;
public TEXTMETRICW 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 TEXTMETRICW
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 Char
Public tmLastChar As Char
Public tmDefaultChar As Char
Public tmBreakChar As Char
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 OUTLINETEXTMETRICW
Public otmSize As UInteger
Public otmTextMetrics As TEXTMETRICW
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 Structureimport ctypes
from ctypes import wintypes
class TEXTMETRICW(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_wchar),
("tmLastChar", ctypes.c_wchar),
("tmDefaultChar", ctypes.c_wchar),
("tmBreakChar", ctypes.c_wchar),
("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 OUTLINETEXTMETRICW(ctypes.Structure):
_fields_ = [
("otmSize", wintypes.DWORD),
("otmTextMetrics", TEXTMETRICW),
("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 TEXTMETRICW {
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: u16,
pub tmLastChar: u16,
pub tmDefaultChar: u16,
pub tmBreakChar: u16,
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 OUTLINETEXTMETRICW {
pub otmSize: u32,
pub otmTextMetrics: TEXTMETRICW,
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 TEXTMETRICW struct {
tmHeight int32
tmAscent int32
tmDescent int32
tmInternalLeading int32
tmExternalLeading int32
tmAveCharWidth int32
tmMaxCharWidth int32
tmWeight int32
tmOverhang int32
tmDigitizedAspectX int32
tmDigitizedAspectY int32
tmFirstChar uint16
tmLastChar uint16
tmDefaultChar uint16
tmBreakChar uint16
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 OUTLINETEXTMETRICW struct {
otmSize uint32
otmTextMetrics TEXTMETRICW
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
TEXTMETRICW = record
tmHeight: Integer;
tmAscent: Integer;
tmDescent: Integer;
tmInternalLeading: Integer;
tmExternalLeading: Integer;
tmAveCharWidth: Integer;
tmMaxCharWidth: Integer;
tmWeight: Integer;
tmOverhang: Integer;
tmDigitizedAspectX: Integer;
tmDigitizedAspectY: Integer;
tmFirstChar: WideChar;
tmLastChar: WideChar;
tmDefaultChar: WideChar;
tmBreakChar: WideChar;
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;
OUTLINETEXTMETRICW = record
otmSize: DWORD;
otmTextMetrics: TEXTMETRICW;
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 TEXTMETRICW = 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: u16,
tmLastChar: u16,
tmDefaultChar: u16,
tmBreakChar: u16,
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 OUTLINETEXTMETRICW = extern struct {
otmSize: u32,
otmTextMetrics: TEXTMETRICW,
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
TEXTMETRICW {.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: uint16
tmLastChar: uint16
tmDefaultChar: uint16
tmBreakChar: uint16
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
OUTLINETEXTMETRICW {.bycopy.} = object
otmSize: uint32
otmTextMetrics: TEXTMETRICW
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: pointerstruct TEXTMETRICW
{
int tmHeight;
int tmAscent;
int tmDescent;
int tmInternalLeading;
int tmExternalLeading;
int tmAveCharWidth;
int tmMaxCharWidth;
int tmWeight;
int tmOverhang;
int tmDigitizedAspectX;
int tmDigitizedAspectY;
wchar tmFirstChar;
wchar tmLastChar;
wchar tmDefaultChar;
wchar 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 OUTLINETEXTMETRICW
{
uint otmSize;
TEXTMETRICW 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 レイアウト)
; OUTLINETEXTMETRICW サイズ: 216 バイト(x86)
dim st, 54 ; 4byte整数×54(構造体サイズ 216 / 4 切り上げ)
; otmSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; otmTextMetrics : TEXTMETRICW (+4, 60byte) varptr(st)+4 を基点に操作(60byte:入れ子/配列)
; otmFiller : BYTE (+64, 1byte) poke st,64,値 / 値 = peek(st,64)
; otmPanoseNumber : PANOSE (+65, 10byte) varptr(st)+65 を基点に操作(10byte:入れ子/配列)
; otmfsSelection : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; otmfsType : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; otmsCharSlopeRise : INT (+84, 4byte) st.21 = 値 / 値 = st.21 (lpoke/lpeek も可)
; otmsCharSlopeRun : INT (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; otmItalicAngle : INT (+92, 4byte) st.23 = 値 / 値 = st.23 (lpoke/lpeek も可)
; otmEMSquare : DWORD (+96, 4byte) st.24 = 値 / 値 = st.24 (lpoke/lpeek も可)
; otmAscent : INT (+100, 4byte) st.25 = 値 / 値 = st.25 (lpoke/lpeek も可)
; otmDescent : INT (+104, 4byte) st.26 = 値 / 値 = st.26 (lpoke/lpeek も可)
; otmLineGap : DWORD (+108, 4byte) st.27 = 値 / 値 = st.27 (lpoke/lpeek も可)
; otmsCapEmHeight : DWORD (+112, 4byte) st.28 = 値 / 値 = st.28 (lpoke/lpeek も可)
; otmsXHeight : DWORD (+116, 4byte) st.29 = 値 / 値 = st.29 (lpoke/lpeek も可)
; otmrcFontBox : RECT (+120, 16byte) varptr(st)+120 を基点に操作(16byte:入れ子/配列)
; otmMacAscent : INT (+136, 4byte) st.34 = 値 / 値 = st.34 (lpoke/lpeek も可)
; otmMacDescent : INT (+140, 4byte) st.35 = 値 / 値 = st.35 (lpoke/lpeek も可)
; otmMacLineGap : DWORD (+144, 4byte) st.36 = 値 / 値 = st.36 (lpoke/lpeek も可)
; otmusMinimumPPEM : DWORD (+148, 4byte) st.37 = 値 / 値 = st.37 (lpoke/lpeek も可)
; otmptSubscriptSize : POINT (+152, 8byte) varptr(st)+152 を基点に操作(8byte:入れ子/配列)
; otmptSubscriptOffset : POINT (+160, 8byte) varptr(st)+160 を基点に操作(8byte:入れ子/配列)
; otmptSuperscriptSize : POINT (+168, 8byte) varptr(st)+168 を基点に操作(8byte:入れ子/配列)
; otmptSuperscriptOffset : POINT (+176, 8byte) varptr(st)+176 を基点に操作(8byte:入れ子/配列)
; otmsStrikeoutSize : DWORD (+184, 4byte) st.46 = 値 / 値 = st.46 (lpoke/lpeek も可)
; otmsStrikeoutPosition : INT (+188, 4byte) st.47 = 値 / 値 = st.47 (lpoke/lpeek も可)
; otmsUnderscoreSize : INT (+192, 4byte) st.48 = 値 / 値 = st.48 (lpoke/lpeek も可)
; otmsUnderscorePosition : INT (+196, 4byte) st.49 = 値 / 値 = st.49 (lpoke/lpeek も可)
; otmpFamilyName : LPSTR (+200, 4byte) st.50 = 値 / 値 = st.50 (lpoke/lpeek も可)
; otmpFaceName : LPSTR (+204, 4byte) st.51 = 値 / 値 = st.51 (lpoke/lpeek も可)
; otmpStyleName : LPSTR (+208, 4byte) st.52 = 値 / 値 = st.52 (lpoke/lpeek も可)
; otmpFullName : LPSTR (+212, 4byte) st.53 = 値 / 値 = st.53 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; OUTLINETEXTMETRICW サイズ: 232 バイト(x64)
dim st, 58 ; 4byte整数×58(構造体サイズ 232 / 4 切り上げ)
; otmSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; otmTextMetrics : TEXTMETRICW (+4, 60byte) varptr(st)+4 を基点に操作(60byte:入れ子/配列)
; otmFiller : BYTE (+64, 1byte) poke st,64,値 / 値 = peek(st,64)
; otmPanoseNumber : PANOSE (+65, 10byte) varptr(st)+65 を基点に操作(10byte:入れ子/配列)
; otmfsSelection : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; otmfsType : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; otmsCharSlopeRise : INT (+84, 4byte) st.21 = 値 / 値 = st.21 (lpoke/lpeek も可)
; otmsCharSlopeRun : INT (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; otmItalicAngle : INT (+92, 4byte) st.23 = 値 / 値 = st.23 (lpoke/lpeek も可)
; otmEMSquare : DWORD (+96, 4byte) st.24 = 値 / 値 = st.24 (lpoke/lpeek も可)
; otmAscent : INT (+100, 4byte) st.25 = 値 / 値 = st.25 (lpoke/lpeek も可)
; otmDescent : INT (+104, 4byte) st.26 = 値 / 値 = st.26 (lpoke/lpeek も可)
; otmLineGap : DWORD (+108, 4byte) st.27 = 値 / 値 = st.27 (lpoke/lpeek も可)
; otmsCapEmHeight : DWORD (+112, 4byte) st.28 = 値 / 値 = st.28 (lpoke/lpeek も可)
; otmsXHeight : DWORD (+116, 4byte) st.29 = 値 / 値 = st.29 (lpoke/lpeek も可)
; otmrcFontBox : RECT (+120, 16byte) varptr(st)+120 を基点に操作(16byte:入れ子/配列)
; otmMacAscent : INT (+136, 4byte) st.34 = 値 / 値 = st.34 (lpoke/lpeek も可)
; otmMacDescent : INT (+140, 4byte) st.35 = 値 / 値 = st.35 (lpoke/lpeek も可)
; otmMacLineGap : DWORD (+144, 4byte) st.36 = 値 / 値 = st.36 (lpoke/lpeek も可)
; otmusMinimumPPEM : DWORD (+148, 4byte) st.37 = 値 / 値 = st.37 (lpoke/lpeek も可)
; otmptSubscriptSize : POINT (+152, 8byte) varptr(st)+152 を基点に操作(8byte:入れ子/配列)
; otmptSubscriptOffset : POINT (+160, 8byte) varptr(st)+160 を基点に操作(8byte:入れ子/配列)
; otmptSuperscriptSize : POINT (+168, 8byte) varptr(st)+168 を基点に操作(8byte:入れ子/配列)
; otmptSuperscriptOffset : POINT (+176, 8byte) varptr(st)+176 を基点に操作(8byte:入れ子/配列)
; otmsStrikeoutSize : DWORD (+184, 4byte) st.46 = 値 / 値 = st.46 (lpoke/lpeek も可)
; otmsStrikeoutPosition : INT (+188, 4byte) st.47 = 値 / 値 = st.47 (lpoke/lpeek も可)
; otmsUnderscoreSize : INT (+192, 4byte) st.48 = 値 / 値 = st.48 (lpoke/lpeek も可)
; otmsUnderscorePosition : INT (+196, 4byte) st.49 = 値 / 値 = st.49 (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 TEXTMETRICW
#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 short tmFirstChar
#field short tmLastChar
#field short tmDefaultChar
#field short 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 OUTLINETEXTMETRICW
#field int otmSize
#field TEXTMETRICW 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, OUTLINETEXTMETRICW ; NSTRUCT 変数を確保
st->otmSize = 100
mes "otmSize=" + st->otmSize