Skip to content

MyGetStockObject 方法遗漏了 DEFAULT_GUI_FONT #77

@yzy

Description

@yzy

jdk 的 jawt.dll 中使用 DEFAULT_GUI_FONT 检索默认字体,源码(awt_DesktopProperties.cpp)参考 :

            SetFontProperty(dc, ANSI_FIXED_FONT, TEXT("win.ansiFixed.font"), 1.0f);
            SetFontProperty(dc, ANSI_VAR_FONT, TEXT("win.ansiVar.font"), 1.0f);
            SetFontProperty(dc, DEVICE_DEFAULT_FONT, TEXT("win.deviceDefault.font"), 1.0f);
            SetFontProperty(dc, DEFAULT_GUI_FONT, TEXT("win.defaultGUI.font"), invScaleY);
            SetFontProperty(dc, OEM_FIXED_FONT, TEXT("win.oemFixed.font"), 1.0f);
            SetFontProperty(dc, SYSTEM_FONT, TEXT("win.system.font"), 1.0f);
            SetFontProperty(dc, SYSTEM_FIXED_FONT, TEXT("win.systemFixed.font"), 1.0f);

而 FontMod.cpp MyGetStockObject 方法中遗漏了此项,导致jdk中使用 FontMod 时开启 fixGSOFont 选项也没有效果。

HGDIOBJ WINAPI MyGetStockObject(int i)
{
	switch (i)
	{
	case OEM_FIXED_FONT:
	case ANSI_FIXED_FONT:
	case ANSI_VAR_FONT:
	case SYSTEM_FONT:
	case DEVICE_DEFAULT_FONT:
	case SYSTEM_FIXED_FONT:
		return newGSOFont;
	}
	return addrGetStockObject(i);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions