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

FONTINFO

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

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

フィールド

フィールドサイズx64x86説明
cjThisDWORD4+0+0この構造体のバイトサイズ。
flCapsDWORD4+4+4フォント機能フラグ(FM_INFO_*)。
cGlyphsSupportedDWORD4+8+8サポートするグリフ数。
cjMaxGlyph1DWORD4+12+121bppグリフの最大バイトサイズ。
cjMaxGlyph4DWORD4+16+164bppグリフの最大バイトサイズ。
cjMaxGlyph8DWORD4+20+208bppグリフの最大バイトサイズ。
cjMaxGlyph32DWORD4+24+2432bppグリフの最大バイトサイズ。

各言語での定義

#include <windows.h>

// FONTINFO  (x64 28 / x86 28 バイト)
typedef struct FONTINFO {
    DWORD cjThis;
    DWORD flCaps;
    DWORD cGlyphsSupported;
    DWORD cjMaxGlyph1;
    DWORD cjMaxGlyph4;
    DWORD cjMaxGlyph8;
    DWORD cjMaxGlyph32;
} FONTINFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FONTINFO
{
    public uint cjThis;
    public uint flCaps;
    public uint cGlyphsSupported;
    public uint cjMaxGlyph1;
    public uint cjMaxGlyph4;
    public uint cjMaxGlyph8;
    public uint cjMaxGlyph32;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FONTINFO
    Public cjThis As UInteger
    Public flCaps As UInteger
    Public cGlyphsSupported As UInteger
    Public cjMaxGlyph1 As UInteger
    Public cjMaxGlyph4 As UInteger
    Public cjMaxGlyph8 As UInteger
    Public cjMaxGlyph32 As UInteger
End Structure
import ctypes
from ctypes import wintypes

class FONTINFO(ctypes.Structure):
    _fields_ = [
        ("cjThis", wintypes.DWORD),
        ("flCaps", wintypes.DWORD),
        ("cGlyphsSupported", wintypes.DWORD),
        ("cjMaxGlyph1", wintypes.DWORD),
        ("cjMaxGlyph4", wintypes.DWORD),
        ("cjMaxGlyph8", wintypes.DWORD),
        ("cjMaxGlyph32", wintypes.DWORD),
    ]
#[repr(C)]
pub struct FONTINFO {
    pub cjThis: u32,
    pub flCaps: u32,
    pub cGlyphsSupported: u32,
    pub cjMaxGlyph1: u32,
    pub cjMaxGlyph4: u32,
    pub cjMaxGlyph8: u32,
    pub cjMaxGlyph32: u32,
}
import "golang.org/x/sys/windows"

type FONTINFO struct {
	cjThis uint32
	flCaps uint32
	cGlyphsSupported uint32
	cjMaxGlyph1 uint32
	cjMaxGlyph4 uint32
	cjMaxGlyph8 uint32
	cjMaxGlyph32 uint32
}
type
  FONTINFO = record
    cjThis: DWORD;
    flCaps: DWORD;
    cGlyphsSupported: DWORD;
    cjMaxGlyph1: DWORD;
    cjMaxGlyph4: DWORD;
    cjMaxGlyph8: DWORD;
    cjMaxGlyph32: DWORD;
  end;
const FONTINFO = extern struct {
    cjThis: u32,
    flCaps: u32,
    cGlyphsSupported: u32,
    cjMaxGlyph1: u32,
    cjMaxGlyph4: u32,
    cjMaxGlyph8: u32,
    cjMaxGlyph32: u32,
};
type
  FONTINFO {.bycopy.} = object
    cjThis: uint32
    flCaps: uint32
    cGlyphsSupported: uint32
    cjMaxGlyph1: uint32
    cjMaxGlyph4: uint32
    cjMaxGlyph8: uint32
    cjMaxGlyph32: uint32
struct FONTINFO
{
    uint cjThis;
    uint flCaps;
    uint cGlyphsSupported;
    uint cjMaxGlyph1;
    uint cjMaxGlyph4;
    uint cjMaxGlyph8;
    uint cjMaxGlyph32;
}

HSP用 定義

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

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

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