ホーム › Graphics.Printing › PRINTIFI32
PRINTIFI32
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cjThis | DWORD | 4 | +0 | +0 | この構造体全体のサイズをバイト単位で示す。 |
| cjIfiExtra | DWORD | 4 | +4 | +4 | 追加データ部分のサイズをバイト単位で示す。 |
| dpwszFamilyName | INT | 4 | +8 | +8 | ファミリ名文字列への先頭からのバイトオフセット。 |
| dpwszStyleName | INT | 4 | +12 | +12 | スタイル名文字列への先頭からのバイトオフセット。 |
| dpwszFaceName | INT | 4 | +16 | +16 | フェイス名文字列への先頭からのバイトオフセット。 |
| dpwszUniqueName | INT | 4 | +20 | +20 | 一意名文字列への先頭からのバイトオフセット。 |
| dpFontSim | INT | 4 | +24 | +24 | フォントシミュレーションデータへのオフセット。 |
| lEmbedId | INT | 4 | +28 | +28 | 埋め込みフォントの識別ID。 |
| lItalicAngle | INT | 4 | +32 | +32 | イタリック体の傾斜角度(度)。 |
| lCharBias | INT | 4 | +36 | +36 | 文字バイアス値。 |
| dpCharSets | INT | 4 | +40 | +40 | 文字セットデータへのオフセット。 |
| jWinCharSet | BYTE | 1 | +44 | +44 | Windowsの文字セット識別子(ANSI_CHARSET等)。 |
| jWinPitchAndFamily | BYTE | 1 | +45 | +45 | ピッチとフォントファミリを示す値。LOGFONTのlfPitchAndFamily相当。 |
| usWinWeight | WORD | 2 | +46 | +46 | フォントの太さ(100〜900、400が標準)。 |
| flInfo | DWORD | 4 | +48 | +48 | フォントの情報フラグ。 |
| fsSelection | WORD | 2 | +52 | +52 | フォント選択属性(イタリック・ボールド等)を示すフラグ。 |
| fsType | WORD | 2 | +54 | +54 | フォント埋め込み許可等のライセンス属性を示すフラグ。 |
| fwdUnitsPerEm | SHORT | 2 | +56 | +56 | em当たりのデザイン単位数。 |
| fwdLowestPPEm | SHORT | 2 | +58 | +58 | 読み取り可能な最小PPEM。 |
| fwdWinAscender | SHORT | 2 | +60 | +60 | Windows基準のアセンダー値。 |
| fwdWinDescender | SHORT | 2 | +62 | +62 | Windows基準のディセンダー値。 |
| fwdMacAscender | SHORT | 2 | +64 | +64 | Mac基準のアセンダー値。 |
| fwdMacDescender | SHORT | 2 | +66 | +66 | Mac基準のディセンダー値。 |
| fwdMacLineGap | SHORT | 2 | +68 | +68 | Mac基準の行間ギャップ値。 |
| fwdTypoAscender | SHORT | 2 | +70 | +70 | タイポグラフィ基準のアセンダー値。 |
| fwdTypoDescender | SHORT | 2 | +72 | +72 | タイポグラフィ基準のディセンダー値。 |
| fwdTypoLineGap | SHORT | 2 | +74 | +74 | タイポグラフィ基準の行間ギャップ値。 |
| fwdAveCharWidth | SHORT | 2 | +76 | +76 | 平均文字幅。 |
| fwdMaxCharInc | SHORT | 2 | +78 | +78 | 最大文字送り幅。 |
| fwdCapHeight | SHORT | 2 | +80 | +80 | 大文字の高さ(キャップハイト)。 |
| fwdXHeight | SHORT | 2 | +82 | +82 | 小文字xの高さ(エックスハイト)。 |
| fwdSubscriptXSize | SHORT | 2 | +84 | +84 | 下付き文字のX方向サイズ。 |
| fwdSubscriptYSize | SHORT | 2 | +86 | +86 | 下付き文字のY方向サイズ。 |
| fwdSubscriptXOffset | SHORT | 2 | +88 | +88 | 下付き文字のX方向オフセット。 |
| fwdSubscriptYOffset | SHORT | 2 | +90 | +90 | 下付き文字のY方向オフセット。 |
| fwdSuperscriptXSize | SHORT | 2 | +92 | +92 | 上付き文字のX方向サイズ。 |
| fwdSuperscriptYSize | SHORT | 2 | +94 | +94 | 上付き文字のY方向サイズ。 |
| fwdSuperscriptXOffset | SHORT | 2 | +96 | +96 | 上付き文字のX方向オフセット。 |
| fwdSuperscriptYOffset | SHORT | 2 | +98 | +98 | 上付き文字のY方向オフセット。 |
| fwdUnderscoreSize | SHORT | 2 | +100 | +100 | 下線の太さ。 |
| fwdUnderscorePosition | SHORT | 2 | +102 | +102 | 下線の位置(ベースラインからのオフセット)。 |
| fwdStrikeoutSize | SHORT | 2 | +104 | +104 | 打ち消し線の太さ。 |
| fwdStrikeoutPosition | SHORT | 2 | +106 | +106 | 打ち消し線の位置。 |
| chFirstChar | BYTE | 1 | +108 | +108 | ANSIの最初の文字コード。 |
| chLastChar | BYTE | 1 | +109 | +109 | ANSIの最後の文字コード。 |
| chDefaultChar | BYTE | 1 | +110 | +110 | 未定義グリフの代替として使う既定文字コード。 |
| chBreakChar | BYTE | 1 | +111 | +111 | 単語区切りに使う文字コード(通常スペース)。 |
| wcFirstChar | WCHAR | 2 | +112 | +112 | Unicodeの最初の文字コード。 |
| wcLastChar | WCHAR | 2 | +114 | +114 | Unicodeの最後の文字コード。 |
| wcDefaultChar | WCHAR | 2 | +116 | +116 | 未定義グリフの代替として使う既定Unicode文字。 |
| wcBreakChar | WCHAR | 2 | +118 | +118 | 単語区切りに使うUnicode文字。 |
| ptlBaseline | POINTL | 8 | +120 | +120 | ベースライン方向ベクトルを示すPOINTL。 |
| ptlAspect | POINTL | 8 | +128 | +128 | デバイスのアスペクト比を示すPOINTL。 |
| ptlCaret | POINTL | 8 | +136 | +136 | キャレット傾斜方向を示すPOINTL。 |
| rclFontBox | RECTL | 16 | +144 | +144 | フォントのバウンディングボックスを示すRECTL。 |
| achVendId | BYTE | 4 | +160 | +160 | フォントベンダーを識別する4バイトの識別子配列。 |
| cKerningPairs | DWORD | 4 | +164 | +164 | カーニングペアの数。 |
| ulPanoseCulture | DWORD | 4 | +168 | +168 | PANOSE分類の文化圏(カルチャー)識別値。 |
| panose | PANOSE | 10 | +172 | +172 | フォントの視覚的特性を分類するPANOSE構造体。 |
各言語での定義
#include <windows.h>
// POINTL (x64 8 / x86 8 バイト)
typedef struct POINTL {
INT x;
INT y;
} POINTL;
// RECTL (x64 16 / x86 16 バイト)
typedef struct RECTL {
INT left;
INT top;
INT right;
INT bottom;
} RECTL;
// 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;
// PRINTIFI32 (x64 184 / x86 184 バイト)
typedef struct PRINTIFI32 {
DWORD cjThis;
DWORD cjIfiExtra;
INT dpwszFamilyName;
INT dpwszStyleName;
INT dpwszFaceName;
INT dpwszUniqueName;
INT dpFontSim;
INT lEmbedId;
INT lItalicAngle;
INT lCharBias;
INT dpCharSets;
BYTE jWinCharSet;
BYTE jWinPitchAndFamily;
WORD usWinWeight;
DWORD flInfo;
WORD fsSelection;
WORD fsType;
SHORT fwdUnitsPerEm;
SHORT fwdLowestPPEm;
SHORT fwdWinAscender;
SHORT fwdWinDescender;
SHORT fwdMacAscender;
SHORT fwdMacDescender;
SHORT fwdMacLineGap;
SHORT fwdTypoAscender;
SHORT fwdTypoDescender;
SHORT fwdTypoLineGap;
SHORT fwdAveCharWidth;
SHORT fwdMaxCharInc;
SHORT fwdCapHeight;
SHORT fwdXHeight;
SHORT fwdSubscriptXSize;
SHORT fwdSubscriptYSize;
SHORT fwdSubscriptXOffset;
SHORT fwdSubscriptYOffset;
SHORT fwdSuperscriptXSize;
SHORT fwdSuperscriptYSize;
SHORT fwdSuperscriptXOffset;
SHORT fwdSuperscriptYOffset;
SHORT fwdUnderscoreSize;
SHORT fwdUnderscorePosition;
SHORT fwdStrikeoutSize;
SHORT fwdStrikeoutPosition;
BYTE chFirstChar;
BYTE chLastChar;
BYTE chDefaultChar;
BYTE chBreakChar;
WCHAR wcFirstChar;
WCHAR wcLastChar;
WCHAR wcDefaultChar;
WCHAR wcBreakChar;
POINTL ptlBaseline;
POINTL ptlAspect;
POINTL ptlCaret;
RECTL rclFontBox;
BYTE achVendId[4];
DWORD cKerningPairs;
DWORD ulPanoseCulture;
PANOSE panose;
} PRINTIFI32;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POINTL
{
public int x;
public int y;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECTL
{
public int left;
public int top;
public int right;
public int bottom;
}
[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 PRINTIFI32
{
public uint cjThis;
public uint cjIfiExtra;
public int dpwszFamilyName;
public int dpwszStyleName;
public int dpwszFaceName;
public int dpwszUniqueName;
public int dpFontSim;
public int lEmbedId;
public int lItalicAngle;
public int lCharBias;
public int dpCharSets;
public byte jWinCharSet;
public byte jWinPitchAndFamily;
public ushort usWinWeight;
public uint flInfo;
public ushort fsSelection;
public ushort fsType;
public short fwdUnitsPerEm;
public short fwdLowestPPEm;
public short fwdWinAscender;
public short fwdWinDescender;
public short fwdMacAscender;
public short fwdMacDescender;
public short fwdMacLineGap;
public short fwdTypoAscender;
public short fwdTypoDescender;
public short fwdTypoLineGap;
public short fwdAveCharWidth;
public short fwdMaxCharInc;
public short fwdCapHeight;
public short fwdXHeight;
public short fwdSubscriptXSize;
public short fwdSubscriptYSize;
public short fwdSubscriptXOffset;
public short fwdSubscriptYOffset;
public short fwdSuperscriptXSize;
public short fwdSuperscriptYSize;
public short fwdSuperscriptXOffset;
public short fwdSuperscriptYOffset;
public short fwdUnderscoreSize;
public short fwdUnderscorePosition;
public short fwdStrikeoutSize;
public short fwdStrikeoutPosition;
public byte chFirstChar;
public byte chLastChar;
public byte chDefaultChar;
public byte chBreakChar;
public char wcFirstChar;
public char wcLastChar;
public char wcDefaultChar;
public char wcBreakChar;
public POINTL ptlBaseline;
public POINTL ptlAspect;
public POINTL ptlCaret;
public RECTL rclFontBox;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public byte[] achVendId;
public uint cKerningPairs;
public uint ulPanoseCulture;
public PANOSE panose;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POINTL
Public x As Integer
Public y As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECTL
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 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 PRINTIFI32
Public cjThis As UInteger
Public cjIfiExtra As UInteger
Public dpwszFamilyName As Integer
Public dpwszStyleName As Integer
Public dpwszFaceName As Integer
Public dpwszUniqueName As Integer
Public dpFontSim As Integer
Public lEmbedId As Integer
Public lItalicAngle As Integer
Public lCharBias As Integer
Public dpCharSets As Integer
Public jWinCharSet As Byte
Public jWinPitchAndFamily As Byte
Public usWinWeight As UShort
Public flInfo As UInteger
Public fsSelection As UShort
Public fsType As UShort
Public fwdUnitsPerEm As Short
Public fwdLowestPPEm As Short
Public fwdWinAscender As Short
Public fwdWinDescender As Short
Public fwdMacAscender As Short
Public fwdMacDescender As Short
Public fwdMacLineGap As Short
Public fwdTypoAscender As Short
Public fwdTypoDescender As Short
Public fwdTypoLineGap As Short
Public fwdAveCharWidth As Short
Public fwdMaxCharInc As Short
Public fwdCapHeight As Short
Public fwdXHeight As Short
Public fwdSubscriptXSize As Short
Public fwdSubscriptYSize As Short
Public fwdSubscriptXOffset As Short
Public fwdSubscriptYOffset As Short
Public fwdSuperscriptXSize As Short
Public fwdSuperscriptYSize As Short
Public fwdSuperscriptXOffset As Short
Public fwdSuperscriptYOffset As Short
Public fwdUnderscoreSize As Short
Public fwdUnderscorePosition As Short
Public fwdStrikeoutSize As Short
Public fwdStrikeoutPosition As Short
Public chFirstChar As Byte
Public chLastChar As Byte
Public chDefaultChar As Byte
Public chBreakChar As Byte
Public wcFirstChar As Char
Public wcLastChar As Char
Public wcDefaultChar As Char
Public wcBreakChar As Char
Public ptlBaseline As POINTL
Public ptlAspect As POINTL
Public ptlCaret As POINTL
Public rclFontBox As RECTL
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public achVendId() As Byte
Public cKerningPairs As UInteger
Public ulPanoseCulture As UInteger
Public panose As PANOSE
End Structureimport ctypes
from ctypes import wintypes
class POINTL(ctypes.Structure):
_fields_ = [
("x", ctypes.c_int),
("y", ctypes.c_int),
]
class RECTL(ctypes.Structure):
_fields_ = [
("left", ctypes.c_int),
("top", ctypes.c_int),
("right", ctypes.c_int),
("bottom", ctypes.c_int),
]
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 PRINTIFI32(ctypes.Structure):
_fields_ = [
("cjThis", wintypes.DWORD),
("cjIfiExtra", wintypes.DWORD),
("dpwszFamilyName", ctypes.c_int),
("dpwszStyleName", ctypes.c_int),
("dpwszFaceName", ctypes.c_int),
("dpwszUniqueName", ctypes.c_int),
("dpFontSim", ctypes.c_int),
("lEmbedId", ctypes.c_int),
("lItalicAngle", ctypes.c_int),
("lCharBias", ctypes.c_int),
("dpCharSets", ctypes.c_int),
("jWinCharSet", ctypes.c_ubyte),
("jWinPitchAndFamily", ctypes.c_ubyte),
("usWinWeight", ctypes.c_ushort),
("flInfo", wintypes.DWORD),
("fsSelection", ctypes.c_ushort),
("fsType", ctypes.c_ushort),
("fwdUnitsPerEm", ctypes.c_short),
("fwdLowestPPEm", ctypes.c_short),
("fwdWinAscender", ctypes.c_short),
("fwdWinDescender", ctypes.c_short),
("fwdMacAscender", ctypes.c_short),
("fwdMacDescender", ctypes.c_short),
("fwdMacLineGap", ctypes.c_short),
("fwdTypoAscender", ctypes.c_short),
("fwdTypoDescender", ctypes.c_short),
("fwdTypoLineGap", ctypes.c_short),
("fwdAveCharWidth", ctypes.c_short),
("fwdMaxCharInc", ctypes.c_short),
("fwdCapHeight", ctypes.c_short),
("fwdXHeight", ctypes.c_short),
("fwdSubscriptXSize", ctypes.c_short),
("fwdSubscriptYSize", ctypes.c_short),
("fwdSubscriptXOffset", ctypes.c_short),
("fwdSubscriptYOffset", ctypes.c_short),
("fwdSuperscriptXSize", ctypes.c_short),
("fwdSuperscriptYSize", ctypes.c_short),
("fwdSuperscriptXOffset", ctypes.c_short),
("fwdSuperscriptYOffset", ctypes.c_short),
("fwdUnderscoreSize", ctypes.c_short),
("fwdUnderscorePosition", ctypes.c_short),
("fwdStrikeoutSize", ctypes.c_short),
("fwdStrikeoutPosition", ctypes.c_short),
("chFirstChar", ctypes.c_ubyte),
("chLastChar", ctypes.c_ubyte),
("chDefaultChar", ctypes.c_ubyte),
("chBreakChar", ctypes.c_ubyte),
("wcFirstChar", ctypes.c_wchar),
("wcLastChar", ctypes.c_wchar),
("wcDefaultChar", ctypes.c_wchar),
("wcBreakChar", ctypes.c_wchar),
("ptlBaseline", POINTL),
("ptlAspect", POINTL),
("ptlCaret", POINTL),
("rclFontBox", RECTL),
("achVendId", ctypes.c_ubyte * 4),
("cKerningPairs", wintypes.DWORD),
("ulPanoseCulture", wintypes.DWORD),
("panose", PANOSE),
]#[repr(C)]
pub struct POINTL {
pub x: i32,
pub y: i32,
}
#[repr(C)]
pub struct RECTL {
pub left: i32,
pub top: i32,
pub right: i32,
pub bottom: i32,
}
#[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 PRINTIFI32 {
pub cjThis: u32,
pub cjIfiExtra: u32,
pub dpwszFamilyName: i32,
pub dpwszStyleName: i32,
pub dpwszFaceName: i32,
pub dpwszUniqueName: i32,
pub dpFontSim: i32,
pub lEmbedId: i32,
pub lItalicAngle: i32,
pub lCharBias: i32,
pub dpCharSets: i32,
pub jWinCharSet: u8,
pub jWinPitchAndFamily: u8,
pub usWinWeight: u16,
pub flInfo: u32,
pub fsSelection: u16,
pub fsType: u16,
pub fwdUnitsPerEm: i16,
pub fwdLowestPPEm: i16,
pub fwdWinAscender: i16,
pub fwdWinDescender: i16,
pub fwdMacAscender: i16,
pub fwdMacDescender: i16,
pub fwdMacLineGap: i16,
pub fwdTypoAscender: i16,
pub fwdTypoDescender: i16,
pub fwdTypoLineGap: i16,
pub fwdAveCharWidth: i16,
pub fwdMaxCharInc: i16,
pub fwdCapHeight: i16,
pub fwdXHeight: i16,
pub fwdSubscriptXSize: i16,
pub fwdSubscriptYSize: i16,
pub fwdSubscriptXOffset: i16,
pub fwdSubscriptYOffset: i16,
pub fwdSuperscriptXSize: i16,
pub fwdSuperscriptYSize: i16,
pub fwdSuperscriptXOffset: i16,
pub fwdSuperscriptYOffset: i16,
pub fwdUnderscoreSize: i16,
pub fwdUnderscorePosition: i16,
pub fwdStrikeoutSize: i16,
pub fwdStrikeoutPosition: i16,
pub chFirstChar: u8,
pub chLastChar: u8,
pub chDefaultChar: u8,
pub chBreakChar: u8,
pub wcFirstChar: u16,
pub wcLastChar: u16,
pub wcDefaultChar: u16,
pub wcBreakChar: u16,
pub ptlBaseline: POINTL,
pub ptlAspect: POINTL,
pub ptlCaret: POINTL,
pub rclFontBox: RECTL,
pub achVendId: [u8; 4],
pub cKerningPairs: u32,
pub ulPanoseCulture: u32,
pub panose: PANOSE,
}import "golang.org/x/sys/windows"
type POINTL struct {
x int32
y int32
}
type RECTL struct {
left int32
top int32
right int32
bottom int32
}
type PANOSE struct {
bFamilyType byte
bSerifStyle byte
bWeight byte
bProportion byte
bContrast byte
bStrokeVariation byte
bArmStyle byte
bLetterform byte
bMidline byte
bXHeight byte
}
type PRINTIFI32 struct {
cjThis uint32
cjIfiExtra uint32
dpwszFamilyName int32
dpwszStyleName int32
dpwszFaceName int32
dpwszUniqueName int32
dpFontSim int32
lEmbedId int32
lItalicAngle int32
lCharBias int32
dpCharSets int32
jWinCharSet byte
jWinPitchAndFamily byte
usWinWeight uint16
flInfo uint32
fsSelection uint16
fsType uint16
fwdUnitsPerEm int16
fwdLowestPPEm int16
fwdWinAscender int16
fwdWinDescender int16
fwdMacAscender int16
fwdMacDescender int16
fwdMacLineGap int16
fwdTypoAscender int16
fwdTypoDescender int16
fwdTypoLineGap int16
fwdAveCharWidth int16
fwdMaxCharInc int16
fwdCapHeight int16
fwdXHeight int16
fwdSubscriptXSize int16
fwdSubscriptYSize int16
fwdSubscriptXOffset int16
fwdSubscriptYOffset int16
fwdSuperscriptXSize int16
fwdSuperscriptYSize int16
fwdSuperscriptXOffset int16
fwdSuperscriptYOffset int16
fwdUnderscoreSize int16
fwdUnderscorePosition int16
fwdStrikeoutSize int16
fwdStrikeoutPosition int16
chFirstChar byte
chLastChar byte
chDefaultChar byte
chBreakChar byte
wcFirstChar uint16
wcLastChar uint16
wcDefaultChar uint16
wcBreakChar uint16
ptlBaseline POINTL
ptlAspect POINTL
ptlCaret POINTL
rclFontBox RECTL
achVendId [4]byte
cKerningPairs uint32
ulPanoseCulture uint32
panose PANOSE
}type
POINTL = record
x: Integer;
y: Integer;
end;
RECTL = record
left: Integer;
top: Integer;
right: Integer;
bottom: Integer;
end;
PANOSE = record
bFamilyType: Byte;
bSerifStyle: Byte;
bWeight: Byte;
bProportion: Byte;
bContrast: Byte;
bStrokeVariation: Byte;
bArmStyle: Byte;
bLetterform: Byte;
bMidline: Byte;
bXHeight: Byte;
end;
PRINTIFI32 = record
cjThis: DWORD;
cjIfiExtra: DWORD;
dpwszFamilyName: Integer;
dpwszStyleName: Integer;
dpwszFaceName: Integer;
dpwszUniqueName: Integer;
dpFontSim: Integer;
lEmbedId: Integer;
lItalicAngle: Integer;
lCharBias: Integer;
dpCharSets: Integer;
jWinCharSet: Byte;
jWinPitchAndFamily: Byte;
usWinWeight: Word;
flInfo: DWORD;
fsSelection: Word;
fsType: Word;
fwdUnitsPerEm: Smallint;
fwdLowestPPEm: Smallint;
fwdWinAscender: Smallint;
fwdWinDescender: Smallint;
fwdMacAscender: Smallint;
fwdMacDescender: Smallint;
fwdMacLineGap: Smallint;
fwdTypoAscender: Smallint;
fwdTypoDescender: Smallint;
fwdTypoLineGap: Smallint;
fwdAveCharWidth: Smallint;
fwdMaxCharInc: Smallint;
fwdCapHeight: Smallint;
fwdXHeight: Smallint;
fwdSubscriptXSize: Smallint;
fwdSubscriptYSize: Smallint;
fwdSubscriptXOffset: Smallint;
fwdSubscriptYOffset: Smallint;
fwdSuperscriptXSize: Smallint;
fwdSuperscriptYSize: Smallint;
fwdSuperscriptXOffset: Smallint;
fwdSuperscriptYOffset: Smallint;
fwdUnderscoreSize: Smallint;
fwdUnderscorePosition: Smallint;
fwdStrikeoutSize: Smallint;
fwdStrikeoutPosition: Smallint;
chFirstChar: Byte;
chLastChar: Byte;
chDefaultChar: Byte;
chBreakChar: Byte;
wcFirstChar: WideChar;
wcLastChar: WideChar;
wcDefaultChar: WideChar;
wcBreakChar: WideChar;
ptlBaseline: POINTL;
ptlAspect: POINTL;
ptlCaret: POINTL;
rclFontBox: RECTL;
achVendId: array[0..3] of Byte;
cKerningPairs: DWORD;
ulPanoseCulture: DWORD;
panose: PANOSE;
end;const POINTL = extern struct {
x: i32,
y: i32,
};
const RECTL = extern struct {
left: i32,
top: i32,
right: i32,
bottom: i32,
};
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 PRINTIFI32 = extern struct {
cjThis: u32,
cjIfiExtra: u32,
dpwszFamilyName: i32,
dpwszStyleName: i32,
dpwszFaceName: i32,
dpwszUniqueName: i32,
dpFontSim: i32,
lEmbedId: i32,
lItalicAngle: i32,
lCharBias: i32,
dpCharSets: i32,
jWinCharSet: u8,
jWinPitchAndFamily: u8,
usWinWeight: u16,
flInfo: u32,
fsSelection: u16,
fsType: u16,
fwdUnitsPerEm: i16,
fwdLowestPPEm: i16,
fwdWinAscender: i16,
fwdWinDescender: i16,
fwdMacAscender: i16,
fwdMacDescender: i16,
fwdMacLineGap: i16,
fwdTypoAscender: i16,
fwdTypoDescender: i16,
fwdTypoLineGap: i16,
fwdAveCharWidth: i16,
fwdMaxCharInc: i16,
fwdCapHeight: i16,
fwdXHeight: i16,
fwdSubscriptXSize: i16,
fwdSubscriptYSize: i16,
fwdSubscriptXOffset: i16,
fwdSubscriptYOffset: i16,
fwdSuperscriptXSize: i16,
fwdSuperscriptYSize: i16,
fwdSuperscriptXOffset: i16,
fwdSuperscriptYOffset: i16,
fwdUnderscoreSize: i16,
fwdUnderscorePosition: i16,
fwdStrikeoutSize: i16,
fwdStrikeoutPosition: i16,
chFirstChar: u8,
chLastChar: u8,
chDefaultChar: u8,
chBreakChar: u8,
wcFirstChar: u16,
wcLastChar: u16,
wcDefaultChar: u16,
wcBreakChar: u16,
ptlBaseline: POINTL,
ptlAspect: POINTL,
ptlCaret: POINTL,
rclFontBox: RECTL,
achVendId: [4]u8,
cKerningPairs: u32,
ulPanoseCulture: u32,
panose: PANOSE,
};type
POINTL {.bycopy.} = object
x: int32
y: int32
RECTL {.bycopy.} = object
left: int32
top: int32
right: int32
bottom: int32
PANOSE {.bycopy.} = object
bFamilyType: uint8
bSerifStyle: uint8
bWeight: uint8
bProportion: uint8
bContrast: uint8
bStrokeVariation: uint8
bArmStyle: uint8
bLetterform: uint8
bMidline: uint8
bXHeight: uint8
PRINTIFI32 {.bycopy.} = object
cjThis: uint32
cjIfiExtra: uint32
dpwszFamilyName: int32
dpwszStyleName: int32
dpwszFaceName: int32
dpwszUniqueName: int32
dpFontSim: int32
lEmbedId: int32
lItalicAngle: int32
lCharBias: int32
dpCharSets: int32
jWinCharSet: uint8
jWinPitchAndFamily: uint8
usWinWeight: uint16
flInfo: uint32
fsSelection: uint16
fsType: uint16
fwdUnitsPerEm: int16
fwdLowestPPEm: int16
fwdWinAscender: int16
fwdWinDescender: int16
fwdMacAscender: int16
fwdMacDescender: int16
fwdMacLineGap: int16
fwdTypoAscender: int16
fwdTypoDescender: int16
fwdTypoLineGap: int16
fwdAveCharWidth: int16
fwdMaxCharInc: int16
fwdCapHeight: int16
fwdXHeight: int16
fwdSubscriptXSize: int16
fwdSubscriptYSize: int16
fwdSubscriptXOffset: int16
fwdSubscriptYOffset: int16
fwdSuperscriptXSize: int16
fwdSuperscriptYSize: int16
fwdSuperscriptXOffset: int16
fwdSuperscriptYOffset: int16
fwdUnderscoreSize: int16
fwdUnderscorePosition: int16
fwdStrikeoutSize: int16
fwdStrikeoutPosition: int16
chFirstChar: uint8
chLastChar: uint8
chDefaultChar: uint8
chBreakChar: uint8
wcFirstChar: uint16
wcLastChar: uint16
wcDefaultChar: uint16
wcBreakChar: uint16
ptlBaseline: POINTL
ptlAspect: POINTL
ptlCaret: POINTL
rclFontBox: RECTL
achVendId: array[4, uint8]
cKerningPairs: uint32
ulPanoseCulture: uint32
panose: PANOSEstruct POINTL
{
int x;
int y;
}
struct RECTL
{
int left;
int top;
int right;
int bottom;
}
struct PANOSE
{
ubyte bFamilyType;
ubyte bSerifStyle;
ubyte bWeight;
ubyte bProportion;
ubyte bContrast;
ubyte bStrokeVariation;
ubyte bArmStyle;
ubyte bLetterform;
ubyte bMidline;
ubyte bXHeight;
}
struct PRINTIFI32
{
uint cjThis;
uint cjIfiExtra;
int dpwszFamilyName;
int dpwszStyleName;
int dpwszFaceName;
int dpwszUniqueName;
int dpFontSim;
int lEmbedId;
int lItalicAngle;
int lCharBias;
int dpCharSets;
ubyte jWinCharSet;
ubyte jWinPitchAndFamily;
ushort usWinWeight;
uint flInfo;
ushort fsSelection;
ushort fsType;
short fwdUnitsPerEm;
short fwdLowestPPEm;
short fwdWinAscender;
short fwdWinDescender;
short fwdMacAscender;
short fwdMacDescender;
short fwdMacLineGap;
short fwdTypoAscender;
short fwdTypoDescender;
short fwdTypoLineGap;
short fwdAveCharWidth;
short fwdMaxCharInc;
short fwdCapHeight;
short fwdXHeight;
short fwdSubscriptXSize;
short fwdSubscriptYSize;
short fwdSubscriptXOffset;
short fwdSubscriptYOffset;
short fwdSuperscriptXSize;
short fwdSuperscriptYSize;
short fwdSuperscriptXOffset;
short fwdSuperscriptYOffset;
short fwdUnderscoreSize;
short fwdUnderscorePosition;
short fwdStrikeoutSize;
short fwdStrikeoutPosition;
ubyte chFirstChar;
ubyte chLastChar;
ubyte chDefaultChar;
ubyte chBreakChar;
wchar wcFirstChar;
wchar wcLastChar;
wchar wcDefaultChar;
wchar wcBreakChar;
POINTL ptlBaseline;
POINTL ptlAspect;
POINTL ptlCaret;
RECTL rclFontBox;
ubyte[4] achVendId;
uint cKerningPairs;
uint ulPanoseCulture;
PANOSE panose;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PRINTIFI32 サイズ: 184 バイト(x64)
dim st, 46 ; 4byte整数×46(構造体サイズ 184 / 4 切り上げ)
; cjThis : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; cjIfiExtra : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dpwszFamilyName : INT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dpwszStyleName : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dpwszFaceName : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dpwszUniqueName : INT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dpFontSim : INT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; lEmbedId : INT (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; lItalicAngle : INT (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; lCharBias : INT (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; dpCharSets : INT (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; jWinCharSet : BYTE (+44, 1byte) poke st,44,値 / 値 = peek(st,44)
; jWinPitchAndFamily : BYTE (+45, 1byte) poke st,45,値 / 値 = peek(st,45)
; usWinWeight : WORD (+46, 2byte) wpoke st,46,値 / 値 = wpeek(st,46)
; flInfo : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; fsSelection : WORD (+52, 2byte) wpoke st,52,値 / 値 = wpeek(st,52)
; fsType : WORD (+54, 2byte) wpoke st,54,値 / 値 = wpeek(st,54)
; fwdUnitsPerEm : SHORT (+56, 2byte) wpoke st,56,値 / 値 = wpeek(st,56)
; fwdLowestPPEm : SHORT (+58, 2byte) wpoke st,58,値 / 値 = wpeek(st,58)
; fwdWinAscender : SHORT (+60, 2byte) wpoke st,60,値 / 値 = wpeek(st,60)
; fwdWinDescender : SHORT (+62, 2byte) wpoke st,62,値 / 値 = wpeek(st,62)
; fwdMacAscender : SHORT (+64, 2byte) wpoke st,64,値 / 値 = wpeek(st,64)
; fwdMacDescender : SHORT (+66, 2byte) wpoke st,66,値 / 値 = wpeek(st,66)
; fwdMacLineGap : SHORT (+68, 2byte) wpoke st,68,値 / 値 = wpeek(st,68)
; fwdTypoAscender : SHORT (+70, 2byte) wpoke st,70,値 / 値 = wpeek(st,70)
; fwdTypoDescender : SHORT (+72, 2byte) wpoke st,72,値 / 値 = wpeek(st,72)
; fwdTypoLineGap : SHORT (+74, 2byte) wpoke st,74,値 / 値 = wpeek(st,74)
; fwdAveCharWidth : SHORT (+76, 2byte) wpoke st,76,値 / 値 = wpeek(st,76)
; fwdMaxCharInc : SHORT (+78, 2byte) wpoke st,78,値 / 値 = wpeek(st,78)
; fwdCapHeight : SHORT (+80, 2byte) wpoke st,80,値 / 値 = wpeek(st,80)
; fwdXHeight : SHORT (+82, 2byte) wpoke st,82,値 / 値 = wpeek(st,82)
; fwdSubscriptXSize : SHORT (+84, 2byte) wpoke st,84,値 / 値 = wpeek(st,84)
; fwdSubscriptYSize : SHORT (+86, 2byte) wpoke st,86,値 / 値 = wpeek(st,86)
; fwdSubscriptXOffset : SHORT (+88, 2byte) wpoke st,88,値 / 値 = wpeek(st,88)
; fwdSubscriptYOffset : SHORT (+90, 2byte) wpoke st,90,値 / 値 = wpeek(st,90)
; fwdSuperscriptXSize : SHORT (+92, 2byte) wpoke st,92,値 / 値 = wpeek(st,92)
; fwdSuperscriptYSize : SHORT (+94, 2byte) wpoke st,94,値 / 値 = wpeek(st,94)
; fwdSuperscriptXOffset : SHORT (+96, 2byte) wpoke st,96,値 / 値 = wpeek(st,96)
; fwdSuperscriptYOffset : SHORT (+98, 2byte) wpoke st,98,値 / 値 = wpeek(st,98)
; fwdUnderscoreSize : SHORT (+100, 2byte) wpoke st,100,値 / 値 = wpeek(st,100)
; fwdUnderscorePosition : SHORT (+102, 2byte) wpoke st,102,値 / 値 = wpeek(st,102)
; fwdStrikeoutSize : SHORT (+104, 2byte) wpoke st,104,値 / 値 = wpeek(st,104)
; fwdStrikeoutPosition : SHORT (+106, 2byte) wpoke st,106,値 / 値 = wpeek(st,106)
; chFirstChar : BYTE (+108, 1byte) poke st,108,値 / 値 = peek(st,108)
; chLastChar : BYTE (+109, 1byte) poke st,109,値 / 値 = peek(st,109)
; chDefaultChar : BYTE (+110, 1byte) poke st,110,値 / 値 = peek(st,110)
; chBreakChar : BYTE (+111, 1byte) poke st,111,値 / 値 = peek(st,111)
; wcFirstChar : WCHAR (+112, 2byte) wpoke st,112,値 / 値 = wpeek(st,112)
; wcLastChar : WCHAR (+114, 2byte) wpoke st,114,値 / 値 = wpeek(st,114)
; wcDefaultChar : WCHAR (+116, 2byte) wpoke st,116,値 / 値 = wpeek(st,116)
; wcBreakChar : WCHAR (+118, 2byte) wpoke st,118,値 / 値 = wpeek(st,118)
; ptlBaseline : POINTL (+120, 8byte) varptr(st)+120 を基点に操作(8byte:入れ子/配列)
; ptlAspect : POINTL (+128, 8byte) varptr(st)+128 を基点に操作(8byte:入れ子/配列)
; ptlCaret : POINTL (+136, 8byte) varptr(st)+136 を基点に操作(8byte:入れ子/配列)
; rclFontBox : RECTL (+144, 16byte) varptr(st)+144 を基点に操作(16byte:入れ子/配列)
; achVendId : BYTE (+160, 4byte) varptr(st)+160 を基点に操作(4byte:入れ子/配列)
; cKerningPairs : DWORD (+164, 4byte) st.41 = 値 / 値 = st.41 (lpoke/lpeek も可)
; ulPanoseCulture : DWORD (+168, 4byte) st.42 = 値 / 値 = st.42 (lpoke/lpeek も可)
; panose : PANOSE (+172, 10byte) varptr(st)+172 を基点に操作(10byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global POINTL
#field int x
#field int y
#endstruct
#defstruct global RECTL
#field int left
#field int top
#field int right
#field int bottom
#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 PRINTIFI32
#field int cjThis
#field int cjIfiExtra
#field int dpwszFamilyName
#field int dpwszStyleName
#field int dpwszFaceName
#field int dpwszUniqueName
#field int dpFontSim
#field int lEmbedId
#field int lItalicAngle
#field int lCharBias
#field int dpCharSets
#field byte jWinCharSet
#field byte jWinPitchAndFamily
#field short usWinWeight
#field int flInfo
#field short fsSelection
#field short fsType
#field short fwdUnitsPerEm
#field short fwdLowestPPEm
#field short fwdWinAscender
#field short fwdWinDescender
#field short fwdMacAscender
#field short fwdMacDescender
#field short fwdMacLineGap
#field short fwdTypoAscender
#field short fwdTypoDescender
#field short fwdTypoLineGap
#field short fwdAveCharWidth
#field short fwdMaxCharInc
#field short fwdCapHeight
#field short fwdXHeight
#field short fwdSubscriptXSize
#field short fwdSubscriptYSize
#field short fwdSubscriptXOffset
#field short fwdSubscriptYOffset
#field short fwdSuperscriptXSize
#field short fwdSuperscriptYSize
#field short fwdSuperscriptXOffset
#field short fwdSuperscriptYOffset
#field short fwdUnderscoreSize
#field short fwdUnderscorePosition
#field short fwdStrikeoutSize
#field short fwdStrikeoutPosition
#field byte chFirstChar
#field byte chLastChar
#field byte chDefaultChar
#field byte chBreakChar
#field short wcFirstChar
#field short wcLastChar
#field short wcDefaultChar
#field short wcBreakChar
#field POINTL ptlBaseline
#field POINTL ptlAspect
#field POINTL ptlCaret
#field RECTL rclFontBox
#field byte achVendId 4
#field int cKerningPairs
#field int ulPanoseCulture
#field PANOSE panose
#endstruct
stdim st, PRINTIFI32 ; NSTRUCT 変数を確保
st->cjThis = 100
mes "cjThis=" + st->cjThis