-[8.5b4] Reverting to old default font

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2ghisler(Author)
the tab widths would get unpredictable. Segoe UI 9 gives similar widths as Microsoft Sans Serif, 8.
Could you explain why this is necessary. I thought the new default font would be used only if there is no existing font settings or font-dependent settings like tab settings.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50541
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The problem is that I need to use some kind of default tab widths for new installations, and for the case that the user hasn't saved the font. They are stored as multiples of the font's average character width.
Author of Total Commander
https://www.ghisler.com
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

Sorry for missing something obvious, but what tab widths? Tabs above file panels? Something else?
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Average text width of the system font (and other fonts) can be obtained by using GetTextMetrics function - see tmAveCharWidth member of TEXTMETRIC structure.

So TC could use system font, unless it's too wide.
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2ghisler(Author)
Is it possible to use GetTextMetrics in order to calculate default tab widths?

And is it possible to use this function to get proper tab widths when changing font settings (especially size)?
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Sob,
Column widths.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Sob
Power Member
Power Member
Posts: 945
Joined: 2005-01-19, 17:33 UTC

Post by *Sob »

I don't get it. When I test TC with different fonts, by starting it with ini containing only:

Code: Select all

[AllResolutions]
FontSize=<size>
FontName=<name>
it has no problem setting correct column widths, no matter how crazy font I use. In this case "correct" means that the contents (extensions, dates, ...) fits correctly. Sometimes not all columns fit in panel, when the font is too big/wide, but if there isn't enough space, then there simply isn't enough space, period.

Where exactly is the difference between this (any custom font) and system font? It's just the matter of where TC gets it from.

When I run this simple program below (binary and source included), it shows me Tahoma for Classic theme, Courier Sans MS when I select it as system font, Segoe UI for standard Aero, or for some third-party Aero theme the name of its font (some strange one I never heard before). It's what TC needs (size is there too), or am I missing something?

Code: Select all

MIME-Version: 1.0
Content-Type: application/octet-stream; name="sysfont.7z"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="sysfont.7z"

N3q8ryccAANJmyC8ewMAAAAAAAAjAAAAAAAAABuWF5zgAdgBTl0AEZkIpoKZuMWHIx0UR9T27rMG
6qNBU0V4NlAdeKeBw9XMAxHb7PHz2xmhMJqlFbmHQoHBeWrOJDB28UMek9jhxgO/GKtkZa2A+AO2
CrOCYEGh4TjC+T3ssFDMY2v75RTORLufkKTda+UPpZ8Xy1rv377BsrpugOGrxjCxuTQswpbKRLj/
TaTeuCCQan8dUs0renYrTF23HMwFSAvvIEsKm/DDQ332R4pAeR5UwYnKbIDsLTTMMlrOTr9DGDfp
IIGhYUKqjjFswg89KKzTh+gONQQ98srFK4wO7P3GYumnTo93rsksrt9EJ1aux2mtHZhUH8EwsZJS
0/0+Ausr0Mvr0bYJRCpEZR1yYbYbK8uvaBwdN8dU0OQpqYrSQeusmUfldXssAn7GhcxCWIiRMNHA
FwePSrzU0lqjn0W1zPFNdL/eXAcGyXkMZr9BAXgcAADgB/8Bb10AJpaOcAAX9+wFu+r0/5QBL0Tv
fOb1skt4BMvR6HvW2Z7CPl77UePEVJRIrv0lIlfV7jrTmoQioL68N+nm796CU+jvz+whNNABTrYB
5/PK7gxZwj81kBtMMMKUk62oi7BOuWBzxzLdKthpC69rLA9BSrpnjiuIuNVXISLJ3pSnYEMutUfc
xNzmh47dD8ooPfubl9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