ホーム › Graphics.Printing › UFF_FONTDIRECTORY
UFF_FONTDIRECTORY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSignature | DWORD | 4 | +0 | +0 | フォントディレクトリエントリを識別するシグネチャ。 |
| wSize | WORD | 2 | +4 | +4 | このディレクトリエントリのサイズをバイト単位で示す。 |
| wFontID | WORD | 2 | +6 | +6 | フォントの識別ID。 |
| sGlyphID | SHORT | 2 | +8 | +8 | 関連するグリフセットの識別ID。 |
| wFlags | WORD | 2 | +10 | +10 | フォントの属性を示すフラグ。 |
| dwInstallerSig | DWORD | 4 | +12 | +12 | フォントインストーラーのシグネチャ。 |
| offFontName | DWORD | 4 | +16 | +16 | フォント名文字列への先頭からのバイトオフセット。 |
| offCartridgeName | DWORD | 4 | +20 | +20 | カートリッジ名文字列への先頭からのバイトオフセット。 |
| offFontData | DWORD | 4 | +24 | +24 | フォントデータへの先頭からのバイトオフセット。 |
| offGlyphData | DWORD | 4 | +28 | +28 | グリフデータへの先頭からのバイトオフセット。 |
| offVarData | DWORD | 4 | +32 | +32 | 可変データへの先頭からのバイトオフセット。 |
各言語での定義
#include <windows.h>
// UFF_FONTDIRECTORY (x64 36 / x86 36 バイト)
typedef struct UFF_FONTDIRECTORY {
DWORD dwSignature;
WORD wSize;
WORD wFontID;
SHORT sGlyphID;
WORD wFlags;
DWORD dwInstallerSig;
DWORD offFontName;
DWORD offCartridgeName;
DWORD offFontData;
DWORD offGlyphData;
DWORD offVarData;
} UFF_FONTDIRECTORY;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct UFF_FONTDIRECTORY
{
public uint dwSignature;
public ushort wSize;
public ushort wFontID;
public short sGlyphID;
public ushort wFlags;
public uint dwInstallerSig;
public uint offFontName;
public uint offCartridgeName;
public uint offFontData;
public uint offGlyphData;
public uint offVarData;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure UFF_FONTDIRECTORY
Public dwSignature As UInteger
Public wSize As UShort
Public wFontID As UShort
Public sGlyphID As Short
Public wFlags As UShort
Public dwInstallerSig As UInteger
Public offFontName As UInteger
Public offCartridgeName As UInteger
Public offFontData As UInteger
Public offGlyphData As UInteger
Public offVarData As UInteger
End Structureimport ctypes
from ctypes import wintypes
class UFF_FONTDIRECTORY(ctypes.Structure):
_fields_ = [
("dwSignature", wintypes.DWORD),
("wSize", ctypes.c_ushort),
("wFontID", ctypes.c_ushort),
("sGlyphID", ctypes.c_short),
("wFlags", ctypes.c_ushort),
("dwInstallerSig", wintypes.DWORD),
("offFontName", wintypes.DWORD),
("offCartridgeName", wintypes.DWORD),
("offFontData", wintypes.DWORD),
("offGlyphData", wintypes.DWORD),
("offVarData", wintypes.DWORD),
]#[repr(C)]
pub struct UFF_FONTDIRECTORY {
pub dwSignature: u32,
pub wSize: u16,
pub wFontID: u16,
pub sGlyphID: i16,
pub wFlags: u16,
pub dwInstallerSig: u32,
pub offFontName: u32,
pub offCartridgeName: u32,
pub offFontData: u32,
pub offGlyphData: u32,
pub offVarData: u32,
}import "golang.org/x/sys/windows"
type UFF_FONTDIRECTORY struct {
dwSignature uint32
wSize uint16
wFontID uint16
sGlyphID int16
wFlags uint16
dwInstallerSig uint32
offFontName uint32
offCartridgeName uint32
offFontData uint32
offGlyphData uint32
offVarData uint32
}type
UFF_FONTDIRECTORY = record
dwSignature: DWORD;
wSize: Word;
wFontID: Word;
sGlyphID: Smallint;
wFlags: Word;
dwInstallerSig: DWORD;
offFontName: DWORD;
offCartridgeName: DWORD;
offFontData: DWORD;
offGlyphData: DWORD;
offVarData: DWORD;
end;const UFF_FONTDIRECTORY = extern struct {
dwSignature: u32,
wSize: u16,
wFontID: u16,
sGlyphID: i16,
wFlags: u16,
dwInstallerSig: u32,
offFontName: u32,
offCartridgeName: u32,
offFontData: u32,
offGlyphData: u32,
offVarData: u32,
};type
UFF_FONTDIRECTORY {.bycopy.} = object
dwSignature: uint32
wSize: uint16
wFontID: uint16
sGlyphID: int16
wFlags: uint16
dwInstallerSig: uint32
offFontName: uint32
offCartridgeName: uint32
offFontData: uint32
offGlyphData: uint32
offVarData: uint32struct UFF_FONTDIRECTORY
{
uint dwSignature;
ushort wSize;
ushort wFontID;
short sGlyphID;
ushort wFlags;
uint dwInstallerSig;
uint offFontName;
uint offCartridgeName;
uint offFontData;
uint offGlyphData;
uint offVarData;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; UFF_FONTDIRECTORY サイズ: 36 バイト(x64)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; dwSignature : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; wSize : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; wFontID : WORD (+6, 2byte) wpoke st,6,値 / 値 = wpeek(st,6)
; sGlyphID : SHORT (+8, 2byte) wpoke st,8,値 / 値 = wpeek(st,8)
; wFlags : WORD (+10, 2byte) wpoke st,10,値 / 値 = wpeek(st,10)
; dwInstallerSig : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; offFontName : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; offCartridgeName : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; offFontData : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; offGlyphData : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; offVarData : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global UFF_FONTDIRECTORY
#field int dwSignature
#field short wSize
#field short wFontID
#field short sGlyphID
#field short wFlags
#field int dwInstallerSig
#field int offFontName
#field int offCartridgeName
#field int offFontData
#field int offGlyphData
#field int offVarData
#endstruct
stdim st, UFF_FONTDIRECTORY ; NSTRUCT 変数を確保
st->dwSignature = 100
mes "dwSignature=" + st->dwSignature