Skip to content
Simple hook tool to change Win32 program font.
Branch: master
Clone or download
Latest commit 8b4b824 Apr 6, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
yaml-cpp @ bd7f8c6 Add submodule yaml-cpp. Apr 2, 2019
.gitattributes Readd Resource.rc to enable working-tree-encoding. Apr 6, 2019
.gitignore First version. Aug 30, 2016
.gitmodules
CMakeLists.txt Fix runtime lib type and dependency. Apr 6, 2019
DefConfigFile.hpp Update default config file. Apr 6, 2019
FontMod.cpp Version 2.0 refactor. Apr 6, 2019
FontMod.vcxproj Strip the path to the pdb. Apr 6, 2019
FontMod.vcxproj.filters Version 2.0 refactor. Apr 6, 2019
FontMod.yaml Update default config file. Apr 6, 2019
LICENSE Update copyright. Jun 14, 2018
README.md Update README. Apr 6, 2019
README.zh_CN.md Update README. Apr 6, 2019
README.zh_TW.md Update README. Apr 6, 2019
Resource.rc
Util.hpp Version 2.0 refactor. Apr 6, 2019
resource.h Version 2.0 refactor. Apr 6, 2019
winmm.hpp Version 2.0 refactor. Apr 6, 2019

README.md

FontMod

English 简体中文 繁体中文

Simple hook tool to change Win32 program font. Works with some GDI or Qt based program.

Tested works with Telegram Desktop and Kleopatra (Gpg4Win).

Usage

Download FontMod.dll and rename to winmm.dll, then put in the folder of program exe.
User font: Put fonts in fonts folder to use them directly, don't need to install to system.

Config file

Will create FontMod.yaml on first run. Config file uses UTF-8 encoding. Support UTF-8 BOM.

style: &style
# Remove '#' to override font style
#  size: 0
#  width: 0
#  weight: 0
#  italic: false
#  underLine: false
#  strikeOut: false
#  charSet: 0
#  outPrecision: 0
#  clipPrecision: 0
#  quality: 0
#  pitchAndFamily: 0

fonts:
  SimSun: &zh-cn-font # Chinese (Simplified) fallback font
    replace: Microsoft YaHei
    <<: *style
  PMingLiU: # Chinese (Traditional) fallback font
    replace: Microsoft JhengHei UI
    <<: *style
  MS UI Gothic: # Japanese fallback font
    replace: Yu Gothic UI
    <<: *style
  Gulim: # Korean fallback font
    replace: 맑은 고딕
    <<: *style

fixGSOFont: true # true is to use system UI font
#fixGSOFont: *zh-cn-font # Or replace with user defined font
debug: false
  • fonts

    • key ("SimSun"): Font name to modify.
    • replace / name: Font name to replace.
    • size width weight italic underLine strikeOut charSet outPrecision clipPrecision quality pitchAndFamily: Override original font style. Please refer to MSDN docs. If you don't want to override, delete these items.
  • fixGSOFont Replace GetStockObject font, the options is same as fonts above. If set to true will use SystemParametersInfo to get system font.

  • debug Debug mode (Will log information to FontMod.log).

YAML supports anchors(&) and references (*) (Please refer to Wikipedia), this tool also supports not mandatory Merge Key function in YAML spec. You can reuse data like config file above, and don't need to copy multiple times like JSON.

If you want replace only CJK fonts and keep English font, you need to set key to CJK fallback font. This font may be different in different language environments. (For example in Chinese simplified environment is SimSun), you can use debug mode to find corresponding font.

You can’t perform that action at this time.