Win32 API 日本語リファレンス
ホームDevices.Display › IFIEXTRA

IFIEXTRA

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

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

フィールド

フィールドサイズx64x86説明
ulIdentifierDWORD4+0+00 に設定してください。このメンバーは、Windows NT 4.0 において GDI が Type1 フォントを識別するために使用していました。
dpFontSigINT4+4+4

IFIMETRICS 構造体の先頭から FONTSIGNATURE 構造体 (Microsoft Windows SDK のドキュメントで説明されています) までのオフセットをバイト単位で指定します。複数の文字セットをサポートしない場合、ドライバーはこのメンバーを 0 に設定してください。

FONTSIGNATURE 内の文字セット情報は、IFIMETRICS の dpCharSets メンバーが指す文字セット配列に格納された情報と整合している必要があります。

cigDWORD4+8+8

グリフインデックスをサポートするフォント内の、異なるグリフの数を指定します。フォントのグリフハンドルは 0 から (cig-1) までの連続した値になります。OpenType フォントの場合、この値は maxp テーブルの numGlyphs の値に格納されています。

グリフハンドルが連続していないフォントでは、このメンバーを 0 に設定してください。このメンバーを 0 に設定したフォントでは、Windows SDK のグリフインデックス API が動作しないことに注意してください。

dpDesignVectorINT4+12+12IFIMETRICS 構造体の先頭から、このフォントの DESIGNVECTOR 構造体までのオフセットです。ドライバーは、このフォントがマルチプルマスターフォントである場合にのみ dpDesignVector を設定してください。DESIGNVECTOR 構造体については、Windows SDK のドキュメントで説明されています。
dpAxesInfoWINT4+16+16IFIMETRICS 構造体の先頭から、このフォントの AXESINFOW 構造体までのオフセットです。ドライバーは、このフォントがマルチプルマスターフォントである場合にのみ dpAxesInfoW を設定してください。AXESINFOW 構造体については、Windows SDK のドキュメントで説明されています。
aulReservedDWORD4+20+20予約済みであり、ドライバーは無視してください。

公式ドキュメント

IFIEXTRA 構造体は、GDI が使用できる、指定されたタイプフェイスに関する追加情報を定義します。

解説(Remarks)

この構造体を使用する場合、メモリ上では IFIMETRICS 構造体の下に配置されます。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// IFIEXTRA  (x64 24 / x86 24 バイト)
typedef struct IFIEXTRA {
    DWORD ulIdentifier;
    INT dpFontSig;
    DWORD cig;
    INT dpDesignVector;
    INT dpAxesInfoW;
    DWORD aulReserved[1];
} IFIEXTRA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IFIEXTRA
{
    public uint ulIdentifier;
    public int dpFontSig;
    public uint cig;
    public int dpDesignVector;
    public int dpAxesInfoW;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public uint[] aulReserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IFIEXTRA
    Public ulIdentifier As UInteger
    Public dpFontSig As Integer
    Public cig As UInteger
    Public dpDesignVector As Integer
    Public dpAxesInfoW As Integer
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public aulReserved() As UInteger
End Structure
import ctypes
from ctypes import wintypes

class IFIEXTRA(ctypes.Structure):
    _fields_ = [
        ("ulIdentifier", wintypes.DWORD),
        ("dpFontSig", ctypes.c_int),
        ("cig", wintypes.DWORD),
        ("dpDesignVector", ctypes.c_int),
        ("dpAxesInfoW", ctypes.c_int),
        ("aulReserved", wintypes.DWORD * 1),
    ]
#[repr(C)]
pub struct IFIEXTRA {
    pub ulIdentifier: u32,
    pub dpFontSig: i32,
    pub cig: u32,
    pub dpDesignVector: i32,
    pub dpAxesInfoW: i32,
    pub aulReserved: [u32; 1],
}
import "golang.org/x/sys/windows"

type IFIEXTRA struct {
	ulIdentifier uint32
	dpFontSig int32
	cig uint32
	dpDesignVector int32
	dpAxesInfoW int32
	aulReserved [1]uint32
}
type
  IFIEXTRA = record
    ulIdentifier: DWORD;
    dpFontSig: Integer;
    cig: DWORD;
    dpDesignVector: Integer;
    dpAxesInfoW: Integer;
    aulReserved: array[0..0] of DWORD;
  end;
const IFIEXTRA = extern struct {
    ulIdentifier: u32,
    dpFontSig: i32,
    cig: u32,
    dpDesignVector: i32,
    dpAxesInfoW: i32,
    aulReserved: [1]u32,
};
type
  IFIEXTRA {.bycopy.} = object
    ulIdentifier: uint32
    dpFontSig: int32
    cig: uint32
    dpDesignVector: int32
    dpAxesInfoW: int32
    aulReserved: array[1, uint32]
struct IFIEXTRA
{
    uint ulIdentifier;
    int dpFontSig;
    uint cig;
    int dpDesignVector;
    int dpAxesInfoW;
    uint[1] aulReserved;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IFIEXTRA サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; ulIdentifier : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dpFontSig : INT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; cig : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dpDesignVector : INT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dpAxesInfoW : INT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; aulReserved : DWORD (+20, 4byte)  varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IFIEXTRA
    #field int ulIdentifier
    #field int dpFontSig
    #field int cig
    #field int dpDesignVector
    #field int dpAxesInfoW
    #field int aulReserved 1
#endstruct

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