Giter Club home page Giter Club logo

Comments (10)

Kyogre avatar Kyogre commented on September 27, 2024 2

Yeah, it works even for the official Telegram Desktop 4.0.2. Here is my regedit config for changing fonts to non-cleartype style (ofcourse you need to disable cleartype in Windows beforehand):

Windows Registry Editor Version 5.00

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

On 1080p screen my fonts look awesomely clear as I think.
On 4K screen my fonts look not so great than via FontMod+quality:3 (method described below), but still better than default.


Also you still can use FontMod (it works for Windows and Wine). Just download FontMod dll version 2.1 (version 3.0.1 won't change fonts) -> rename dll to winmm.dll -> place it in 64Gram folder -> launch 64Gram, so the FontMod.yaml config appears in the folder -> exit 64Gram -> edit fonts in FontMod.yaml -> launch 64Gram.

I even achieved changing fonts to non-cleartype style. Here are the configs for 4K (200% UI scaling) and 1080p screens: FontMod Telegram clear fonts.zip / alternative download link.
P.S. if someone doesn't like bold font I have set in aforementioned 4K config, you can delete "quality" and "size" strings in this fragment:

  DAOpenSansSemibold:
    replace: DAOpenSansSemibold
    quality: 3
    size: 37

thus you will get default Telegram bold font.

upd. Changing font size via FontMod 2.1 stopped working since 64gram version 1.0.64 (tg 4.6.1), discussion is in #81.

from fontmod.

Kyogre avatar Kyogre commented on September 27, 2024 1

How did you find out what font telegram is using? (in case of future changes)

maybe cleaned the Telegram client folder -> launched client from scratch -> opened log.txt file -> looked for messages like Font: from ':/gui/fonts/DAOpenSansRegular.ttf' loaded 'DAOpenSansRegular' ?

from fontmod.

toymil avatar toymil commented on September 27, 2024 1

@Kyogre Thanks!

I got the following lines:

Font: from ':/gui/fonts/DAOpenSansRegular.ttf'              loaded 'DAOpenSansRegular'
Font: from ':/gui/fonts/DAOpenSansRegularItalic.ttf'        loaded 'DAOpenSansRegularItalic'
Font: from ':/gui/fonts/DAOpenSansSemiboldAsBold.ttf'       loaded 'DAOpenSansSemibold'
Font: from ':/gui/fonts/DAOpenSansSemiboldItalicAsBold.ttf' loaded 'DAOpenSansSemiboldItalic'
Font: from ':/gui/fonts/DAVazirRegular.ttf'                 loaded 'DAVazirRegular'
Font: from ':/gui/fonts/DAVazirMediumAsBold.ttf'            loaded 'DAVazirMedium'

and I think OP @rocco-xyz made a mistake, e.g. substitution should use font name DAOpenSansSemiboldItalic not font file name DAOpenSansSemiboldItalicAsBold, which is the reason why OP did not successfully change the bold fonts.

Note: It does not change «ALL» the fonts.

I guess for the non-custom fonts Telegram will just load them from system with font name as query term, like Consolas for Consolas.

from fontmod.

grandsilence avatar grandsilence commented on September 27, 2024 1

All telegram fonts can be found in lib_ui and implementaion of font selection is here.

My final reg version:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]
"DAOpenSans"="Tahoma"
"DAOpenSansBold"="Tahoma"
"DAOpenSansBoldItalic"="Tahoma"
"DAOpenSansRegular"="Tahoma"
"DAOpenSansRegularItalic"="Tahoma"
"DAOpenSansSemibold"="Tahoma"
"DAOpenSansSemiboldItalic"="Tahoma"
"DAVazir"="Tahoma"
"DAVazirBold"="Tahoma"
"DAVazirMedium"="Tahoma"
"DAVazirRegular"="Tahoma"
;; Priority font resolving: "Cascadia Mono", "Consolas", "Liberation Mono", "Menlo", "Courier"
;; Override monospace font:
"Cascadia Mono"="Fixedsys"

from fontmod.

vecheslav avatar vecheslav commented on September 27, 2024 1

Maybe someone will find it helpful.
If you just replace the font, you can get a issue that the line height of the font and emoji are different, so when you add emoji to the text, it is shifted down.

I patched the standard Segoe UI font, fixed vertical metrics.
Now telegram looks perfect for me as on macos.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]
"DAOpenSans"="VSegoe UI"
"DAOpenSansBold"="VSegoe UI Bold"
"DAOpenSansBoldItalic"="VSegoe UI Bold Italic"
"DAOpenSansRegular"="VSegoe UI"
"DAOpenSansRegularItalic"="VSegoe UI Italic"
"DAOpenSansSemibold"="VSegoe UI Semibold"
"DAOpenSansSemiboldItalic"="VSegoe UI Semibold Italic"
"DAVazir"="VSegoe UI"
"DAVazirBold"="VSegoe UI Bold"
"DAVazirMedium"="VSegoe UI Semibold"
"DAVazirRegular"="VSegoe UI"
;; Priority font resolving: "Cascadia Mono", "Consolas", "Liberation Mono", "Menlo", "Courier"
;; Override monospace font:
"Cascadia Mono"="JetBrains Mono"

Patched font
fixed.zip

from fontmod.

vecheslav avatar vecheslav commented on September 27, 2024 1

It seems Telegram updates them font, so the above ones not working anymore.

How to track which font uses Telegram?

Now you can change default font family in chat settings 🥳

from fontmod.

Xm798 avatar Xm798 commented on September 27, 2024

Worked for me, thanks!
On Windows11 21H2 x64
Telegram Desktop 3.6.0 x64

from fontmod.

toymil avatar toymil commented on September 27, 2024

How did you find out what font telegram is using? (in case of future changes)

from fontmod.

toymil avatar toymil commented on September 27, 2024

With some testing, substituting Consolas will change the monospace font in Telegram, despite the higher priority of Monaco or Menlo in the source code:

code, kbd, pre, samp {
    font-family: Menlo,Monaco,Consolas,"Courier New",monospace;
}

Maybe the query term is not Monaco? Just like the query term for Open Sans is DAOpenSansRegular not Open Sans or something more reasonable (again, how did you find out the correct query term for Open Sans?).

This is my registry file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]
"DAOpenSans"="Sarasa UI SC Light"
"DAOpenSansItalic"="Sarasa UI SC Light Italic"
"DAOpenSansRegular"="Sarasa UI SC"
"DAOpenSansRegularItalic"="Sarasa UI SC Italic"
"DAOpenSansSemibold"="Sarasa UI SC Bold"
"DAOpenSansSemiboldItalic"="Sarasa UI SC Bold Italic"
"DAOpenSansBold"="Sarasa UI SC Bold"
"DAOpenSansBoldItalic"="Sarasa UI SC Bold Italic"
"Consolas"="Sarasa Mono SC"

I am using Sarasa UI SC Bold for DAOpenSansSemibold because the semibold variant of Sarasa UI are not visually distinctive enough.

from fontmod.

vacterro avatar vacterro commented on September 27, 2024

It seems Telegram updates them font, so the above ones not working anymore.

How to track which font uses Telegram?

from fontmod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.