ysc3839 / FontMod

Simple hook tool to change Win32 program font.
MIT License
1.29k stars 62 forks source link

Telegram 2.8.5+ don't allow any .dll-s near Telegram.exe #73

Closed TaciturnShadow closed 3 years ago

TaciturnShadow commented 3 years ago

https://github.com/telegramdesktop/tdesktop/commit/5b2db4112fc4d5c9759685bb457ec0106b3bba1a Since Telegram 2.8.5 FontMod is not loaded. Any ways to fix?

Kirrrr commented 3 years ago

Double it. Telegram ignores FontMod's dll under any proposed mimic name. FontMod doesn't load, debug log doesn't work.

Kirrrr commented 3 years ago

Well... Just found good enough (for me) workaround via Registry FontSubstitutes (my OS is Windows 10). Here is the tweaked part (I prefer old-styled pixel-hinted fonts like Arial or Tahoma):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]
"DAOpenSansRegular"="Arial"
"DAOpenSansRegularItalic"="Arial"
"DAOpenSansSemibold"="Arial"
"DAOpenSansSemiboldItalic"="Arial"
"DAVazirMedium"="Arial"
"DAVazirRegular"="Arial"

(Telegram must be restarted after Registry tweaking)

Font names are taken from Telegram's boot log 'log.txt'. Looks like it fixes everyting, except monospaced font. Under Win10 Telegram uses system font 'Consolas' for monospaced text, so you can substitute it too (for 'Lucida Console' or 'Courier New', e.g.), but it will affect many applications compared to substitution of Telegram-specific 'DA...' fonts.

ysc3839 commented 3 years ago

This issue was reported some days ago (#70) and can not be fixed. A solution is to use third-party dll injector.

ysc3839 commented 3 years ago

If you are using Microsoft Store version of Telegram (link), you can try my project AppXLauncher. Download exe here, put FontMod64.dll next to the exe and create AppXLauncher.json with following content:

{
    "PackageFamilyName": "TelegramMessengerLLP.TelegramDesktop_t4vj0pshhgkwm",
    "AppId": "Telegram.TelegramDesktop.Store",
    "InjectDll": "FontMod64.dll",
    "Persistent": true,
    "KillRunning": false
}

When Persistent is turned on, after open AppXLauncher.exe the first time, you can just open Telegram in Start Menu, without needing to open AppXLauncher.exe. Notice that these files can not be moved or deleted. If you moved and unable open Telegram, or want to uninstall, just change Persistent to false and open AppXLauncher.exe once.

Rongronggg9 commented 3 years ago

There is an unofficial Telegram Desktop called 64Gram (formerly Telegram Desktop x64). It provides Windows 64bit build with some enhancements, including allowing fontmod dll.