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

FONTINFO

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

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

フィールド

フィールドサイズx64x86説明
cjThisDWORD4+0+0この FONTINFO 構造体のサイズをバイト単位で指定します。
flCapsDWORD4+4+4機能フラグのセットです。指定できるフラグは FO_DEVICE_FONTFO_OUTLINE_CAPABLE です。
cGlyphsSupportedDWORD4+8+8フォント内のグリフ数を指定します。
cjMaxGlyph1DWORD4+12+121 ビット/ピクセルでの最大グリフのサイズを指定します。0 以外の値は、1 ビット/ピクセルのビットマップがサポートされていることを意味します。
cjMaxGlyph4DWORD4+16+164 ビット/ピクセルでの最大グリフのサイズを指定します。0 以外の値は、4 ビット/ピクセルのビットマップがサポートされていることを意味します。
cjMaxGlyph8DWORD4+20+208 ビット/ピクセルでの最大グリフのサイズを指定します。0 以外の値は、8 ビット/ピクセルのビットマップがサポートされていることを意味します。
cjMaxGlyph32DWORD4+24+2432 ビット/ピクセルでの最大グリフのサイズを指定します。0 以外の値は、32 ビット/ピクセルのビットマップがサポートされていることを意味します。

公式ドキュメント

FONTINFO 構造体は、特定のフォントに関する情報を格納します。

解説(Remarks)

GDI は FONTOBJ_vGetInfo を通じてこの構造体に書き込み、返します。

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

各言語での定義

#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