• Stars
    star
    1,281
  • Rank 36,497 (Top 0.8 %)
  • Language
    C++
  • License
    MIT License
  • Created about 8 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple hook tool to change Win32 program font.

FontMod

English 简体中文 繁体中文

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

Proven workable on Telegram Desktop, Kleopatra (Gpg4Win) and Mendeley Desktop.

Usage

Download FontMod{32,64,ARM,ARM64}.dll and rename to one of following:
dinput8.dll, dinput.dll, dsound.dll, d3d9.dll, d3d11.dll, ddraw.dll, winmm.dll, version.dll, d3d8.dll (d3d8.dll is 32bit only).
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

#gdiplus:
#  SimSun:
#    replace: Microsoft YaHei
#  Microsoft YaHei:
#    size: 72.0
#    style: regular
##    style: 0
#    unit: point
##    unit: 3

#gdipGFFSansSerif: Calibri
#gdipGFFSerif: Times New Roman
#gdipGFFMonospace: Consolas

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.

  • gdiplus Replace GDI+ font. Due to limitation of GDI+, you can only replace a font with another (SimSun -> Microsoft YaHei), or change the style of a font.

    • key ("SimSun"): Font name to modify.
    • replace / name: Font name to replace.
    • size: Font size.
    • style: Font style. Possible values are: regular bold italic boldItalic underline strikeout. Or you can just write integer value of FontStyle enumeration.
    • unit: Unit of size. Possible values are: world display pixel point inch document millimeter. Or you can just write integer value of Unit enumeration.
  • gdipGFFSansSerif, gdipGFFSerif, gdipGFFMonospace Replace GDI+ generic font family. (https://docs.microsoft.com/en-us/windows/win32/gdiplus/-gdiplus-fontfamily-flat)

  • 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.

More Repositories

1

AudioPlaybackConnector

Bluetooth audio playback (A2DP Sink) connector for Windows 10 2004+
C++
707
star
2

win32-darkmode

Example application shows how to use undocumented dark mode API introduced in Windows 10 1809.
C++
408
star
3

ClashXW

This project aims to implement a program with same function as ClashX, running in Windows.
C++
138
star
4

NoScreenCap

Disable screen capture for any window in Windows.
C++
82
star
5

openwrt-minieap

Shell
77
star
6

bilibili-api

Python
57
star
7

FakeSSHServer

A fake ssh server written in Python. Uses Paramiko.
Python
40
star
8

luci-proto-minieap

Lua
40
star
9

UWPToyVpn

A UWP VPN plugin sample.
C++
39
star
10

AppXLauncher

C++
21
star
11

ImmersiveContextMenu

C++
20
star
12

ProjectionAwake

Keep computer awake when projecting
C++
19
star
13

openwrt-official-builds-fullcone

Shell
19
star
14

Mi6-MIPay-Systemless

Bring MI Pay to MIUI Global.
Shell
15
star
15

SingleExeXamlIsland

C++
13
star
16

odl

OneDrive Directory Lister
JavaScript
10
star
17

magisk-bluetoothhidenabler

Shell
9
star
18

marysue-py

Python
9
star
19

VCMPBrowser

A new VCMP browser.
C++
9
star
20

disqusjs-proxy

Disqus API Proxy in Node.js
JavaScript
6
star
21

WebUnifying

HTML
6
star
22

NitroFans4Afterburner

MSI Afterburner fan speed plugin for Acer Nitro Laptops. Does NOT require NitroSense installed.
C++
6
star
23

Mi6-MIRoaming-Systemless

Bring MI Roaming (chinese version) to MIUI Global.
Shell
5
star
24

vcmpconv

HTML
5
star
25

yafakeitbot

Yet Another Fakeit Bot
Python
4
star
26

FileMod

C++
4
star
27

magisk-permissionreviewenabler

Shell
4
star
28

vcmp-python-plugin

Python binding plugin for VC:MP.
C++
4
star
29

sniproxy-socks

Dockerfile
4
star
30

ga-pageview

JavaScript
3
star
31

magisk-runtimeoverlaytemplate

Template for building Android Runtime Resource Overlay magisk module
Shell
3
star
32

mTorrent-PT-Helper

TypeScript
3
star
33

manhuagui-dl

Download comics from manhuagui.
Python
3
star
34

openwrt-vlmcsd

Makefile
2
star
35

magisk-MiuiDevSignHider

Shell
2
star
36

lxf-wiki-getter

抓取 廖雪峰的官方网站 http://www.liaoxuefeng.com/ 上教程的 Python 脚本
Python
1
star
37

lib7zdec

7zip decode code from LZMA SDK.
C
1
star
38

vcmp-squirrel-mmdb

C
1
star
39

openwrt-ssr

Shell
1
star
40

vcmp-python-demo

Squirrel
1
star
41

flarum-ext-usercard-uid

JavaScript
1
star