ホーム › Graphics.Printing › UNIFM_HDR
UNIFM_HDR
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | このフォントメトリックヘッダー全体のサイズをバイト単位で示す。 |
| dwVersion | DWORD | 4 | +4 | +4 | ヘッダー構造のバージョン番号。 |
| ulDefaultCodepage | DWORD | 4 | +8 | +8 | フォントの既定コードページ。 |
| lGlyphSetDataRCID | INT | 4 | +12 | +12 | グリフセットデータのリソースID。 |
| loUnidrvInfo | DWORD | 4 | +16 | +16 | UNIDRVINFOへの先頭からのバイトオフセット。 |
| loIFIMetrics | DWORD | 4 | +20 | +20 | IFIメトリクスへの先頭からのバイトオフセット。 |
| loExtTextMetric | DWORD | 4 | +24 | +24 | 拡張テキストメトリクスへの先頭からのバイトオフセット。 |
| loWidthTable | DWORD | 4 | +28 | +28 | 文字幅テーブルへの先頭からのバイトオフセット。 |
| loKernPair | DWORD | 4 | +32 | +32 | カーニングペアデータへの先頭からのバイトオフセット。 |
| dwReserved | DWORD | 8 | +36 | +36 | 予約フィールド。0に設定する。 |
各言語での定義
#include <windows.h>
// UNIFM_HDR (x64 44 / x86 44 バイト)
typedef struct UNIFM_HDR {
DWORD dwSize;
DWORD dwVersion;
DWORD ulDefaultCodepage;
INT lGlyphSetDataRCID;
DWORD loUnidrvInfo;
DWORD loIFIMetrics;
DWORD loExtTextMetric;
DWORD loWidthTable;
DWORD loKernPair;
DWORD dwReserved[2];
} UNIFM_HDR;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct UNIFM_HDR
{
public uint dwSize;
public uint dwVersion;
public uint ulDefaultCodepage;
public int lGlyphSetDataRCID;
public uint loUnidrvInfo;
public uint loIFIMetrics;
public uint loExtTextMetric;
public uint loWidthTable;
public uint loKernPair;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public uint[] dwReserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure UNIFM_HDR
Public dwSize As UInteger
Public dwVersion As UInteger
Public ulDefaultCodepage As UInteger
Public lGlyphSetDataRCID As Integer
Public loUnidrvInfo As UInteger
Public loIFIMetrics As UInteger
Public loExtTextMetric As UInteger
Public loWidthTable As UInteger
Public loKernPair As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public dwReserved() As UInteger
End Structureimport ctypes
from ctypes import wintypes
class UNIFM_HDR(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwVersion", wintypes.DWORD),
("ulDefaultCodepage", wintypes.DWORD),
("lGlyphSetDataRCID", ctypes.c_int),
("loUnidrvInfo", wintypes.DWORD),
("loIFIMetrics", wintypes.DWORD),
("loExtTextMetric", wintypes.DWORD),
("loWidthTable", wintypes.DWORD),
("loKernPair", wintypes.DWORD),
("dwReserved", wintypes.DWORD * 2),
]#[repr(C)]
pub struct UNIFM_HDR {
pub dwSize: u32,
pub dwVersion: u32,
pub ulDefaultCodepage: u32,
pub lGlyphSetDataRCID: i32,
pub loUnidrvInfo: u32,
pub loIFIMetrics: u32,
pub loExtTextMetric: u32,
pub loWidthTable: u32,
pub loKernPair: u32,
pub dwReserved: [u32; 2],
}import "golang.org/x/sys/windows"
type UNIFM_HDR struct {
dwSize uint32
dwVersion uint32
ulDefaultCodepage uint32
lGlyphSetDataRCID int32
loUnidrvInfo uint32
loIFIMetrics uint32
loExtTextMetric uint32
loWidthTable uint32
loKernPair uint32
dwReserved [2]uint32
}type
UNIFM_HDR = record
dwSize: DWORD;
dwVersion: DWORD;
ulDefaultCodepage: DWORD;
lGlyphSetDataRCID: Integer;
loUnidrvInfo: DWORD;
loIFIMetrics: DWORD;
loExtTextMetric: DWORD;
loWidthTable: DWORD;
loKernPair: DWORD;
dwReserved: array[0..1] of DWORD;
end;const UNIFM_HDR = extern struct {
dwSize: u32,
dwVersion: u32,
ulDefaultCodepage: u32,
lGlyphSetDataRCID: i32,
loUnidrvInfo: u32,
loIFIMetrics: u32,
loExtTextMetric: u32,
loWidthTable: u32,
loKernPair: u32,
dwReserved: [2]u32,
};type
UNIFM_HDR {.bycopy.} = object
dwSize: uint32
dwVersion: uint32
ulDefaultCodepage: uint32
lGlyphSetDataRCID: int32
loUnidrvInfo: uint32
loIFIMetrics: uint32
loExtTextMetric: uint32
loWidthTable: uint32
loKernPair: uint32
dwReserved: array[2, uint32]struct UNIFM_HDR
{
uint dwSize;
uint dwVersion;
uint ulDefaultCodepage;
int lGlyphSetDataRCID;
uint loUnidrvInfo;
uint loIFIMetrics;
uint loExtTextMetric;
uint loWidthTable;
uint loKernPair;
uint[2] dwReserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; UNIFM_HDR サイズ: 44 バイト(x64)
dim st, 11 ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwVersion : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ulDefaultCodepage : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lGlyphSetDataRCID : INT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; loUnidrvInfo : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; loIFIMetrics : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; loExtTextMetric : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; loWidthTable : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; loKernPair : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; dwReserved : DWORD (+36, 8byte) varptr(st)+36 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global UNIFM_HDR
#field int dwSize
#field int dwVersion
#field int ulDefaultCodepage
#field int lGlyphSetDataRCID
#field int loUnidrvInfo
#field int loIFIMetrics
#field int loExtTextMetric
#field int loWidthTable
#field int loKernPair
#field int dwReserved 2
#endstruct
stdim st, UNIFM_HDR ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize