Synchronize Compare display font bug

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

Post Reply
User avatar
mame
Junior Member
Junior Member
Posts: 54
Joined: 2011-12-03, 18:48 UTC
Location: Everywhere

Synchronize Compare display font bug

Post by *mame »

I think I discovered a very annoying bug that's never been fixed (I'm not sure if it has been found/reported before). I really hope this is not Windows bug because if so, I'm not sure if it can be fixed.

First encounter: Windows Vista, TC version 7.5 I think. Last tested version: 8.00 beta 11, still have the bug. Affected: Windows Vista, Windows 7, both 32 and 64 bit. It only happened ONLY if you have logged out and re-login Windows session.

:arrow: Select a file in left pane, different file exists in right pane (say, a patched or modified file). Select Synchronize. Choose Select by content. Compare file. Press Ctrl+F3 (Binary ticked). Default Terminal 9px font will become *very tiny*, still readable though.

I chose Terminal font by default (also TC default, ASCII mode) because it shows most characters not shown in ANSI/Unicode fonts, especially when viewing binary files. (ANSI fonts will display just empty spaces, boxes or dots instead)

Lister does display properly, by the way. I've thought for some time (since Vista release!) that it's Vista/7 bug but, come to think again, since Lister (ASCII mode) does display properly (text mode, hex mode), how come synchronize window have a corrupted display. If it's Windows, then F3 (Lister) will be affected as well. Might be the code about the sync window only.

P/S: Tried with some other variation of Terminal font. One is called 'Perfect DOS VGA 437.ttf'. Doesn't display the symptom. But I believe you don't want to carry and install some alien font into every system with portable TC.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Default Terminal 9px font will become *very tiny*, still readable though.
Not confirmed - screenshot please!
Author of Total Commander
https://www.ghisler.com
User avatar
mame
Junior Member
Junior Member
Posts: 54
Joined: 2011-12-03, 18:48 UTC
Location: Everywhere

Post by *mame »

Sorry, I've intended to post screenshot but since I just registered, so I have to wait. Here it is:

Image: http://s10.postimage.org/630nyal8p/tc_font_bug.png

OS:
First two: Windows 2008 Server R2, SP1, TC8b11x64 (via MSTSC)
Second two: Windows XP Pro, SP3, TC8b11x32 (for comparison)
Last edited by mame on 2011-12-05, 04:46 UTC, edited 3 times in total.
User avatar
mame
Junior Member
Junior Member
Posts: 54
Joined: 2011-12-03, 18:48 UTC
Location: Everywhere

Post by *mame »

Windows 7 Home Premium, SP1. TC 7.56a (first two)
Windows 7 Home Premium, SP1. TC 8.00 b11 (second two)

Image: http://s11.postimage.org/cmfk56q77/before_after.png
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I think that I know what happens: It seems that Windows is using font substitution, because you chose a DOS font (OEM encoding), but TC is needing a Windows font to show Unicode.

Try using Fixedsys instead of Terminal.
Author of Total Commander
https://www.ghisler.com
User avatar
mame
Junior Member
Junior Member
Posts: 54
Joined: 2011-12-03, 18:48 UTC
Location: Everywhere

Post by *mame »

Try using Fixedsys instead of Terminal.
Thanks but no. Believe me I tried :)

Reasons being:

1. Fixedsys is ugly compared to Terminal. And it lacks some (lots!) in comparison (chars 0x7F-0x9F, except 0x91 and 0x92 all looks the same!)

2. Fixedsys already defaulted in Lister ANSI mode (A) but to dump binary/hex, one should use OEM/ASCII mode (S).
Reason behind this: I've been using NC/VC in DOS for 10+ years, F3/Hex shows most of the 255 chars. Under Linux, UNIX or OSX terminals, there's no OEM/ASCII mode available (or I'm lazy/don't know how) so I have to live with ANSI unicode characters, and that sucks -- a lot of same-looking chars. Sometimes I even dumped those OS binaries in Windows to view using TC (WINE works fine anyway, Windows 2000/XP emulation perhaps?)

3. Explained above, Terminal font does display differect OEM/ASCII bytes as unique chars, while none of ANSI fonts does AFAIK. 00-FF was, is 256 chars and will never grow beyond that, unless humanity discovered a new kind of Mathematics (00-ZZ or something). OEM/ASCII symbols was perfect and complete work while ANSI/Unicode never was (still being developed, eg. Right-to-Left; Arabic-Aramaic-Hebrew, Far-east languages, certain Cyrillic, Sanskrit etc). And there's just too many variations in Unicode inviting more unexpected results or bugs. Hence my choice, OEM/ASCII font, no bugs (supposed to be).

4. I see no point for viewing Hexadecimal in some Unicode font. Double-byte chars or unicode (on file/disk) still consists of two bytes, not one. While applicable OS/GUI/Application will show one char, in fact it is two. For hex viewing/comparing, unicode is not required. Filecompare or hexdump is no Desktop Publishing requiring complex, proportioned, compatible and pretty fonts.

5. Still doesn't explain why:
- Immediately after Windows login it's being displayed ok (a.k.a. The font is not being substituted, so it does what it does)
- But not after subsequent Windows logins, until reboot (a.k.a. The font is now being substituted -- with-God-knows-what -- for no apparent reason)

I understand that maybe some double-byte OS users (or not, me too sometimes) will want to compare some Unicode or UTF-8/16 text files, and that requires an ANSI/Unicode capable font. The fonts button is already there, but a more flexible choices of mode changing is a welcomed addition, I think (see my suggestion below)

My suggestion/workaround:
Enable two (or more) modes as in Lister in the Compare window. I'm expecting that this might or might not require a lot of work, so I'll understand if I'm not seeing this being implemented soon or never will.

I myself honestly can't figure out whether the fault being by Windows (Vista and above) or TC. The mystery might still remain unknown for some time. So no pressure to your side, I'm just explaining further.

As for me (or anyone else affected):
Try to avoid logging out of local workstation. As I work with servers through remote logins, this seems unavoidable...

Thanks. And sorry if I talked much.
I hereby claim copyright to this message you are now reading,
and for that you owe me a $1 royalty fee each time you read this.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately I could not reproduce your problem with the Terminal font. However, I have a possible workaround for you:

Open the file wincmd.ini and change the line
CompCharSet=255
to
CompCharSet=0

255 sets the OEM charset, while 0 sets ANSI charset. Surprisingly this works fine, although the charset cannot be chosen in the dialog.
Author of Total Commander
https://www.ghisler.com
User avatar
mame
Junior Member
Junior Member
Posts: 54
Joined: 2011-12-03, 18:48 UTC
Location: Everywhere

Post by *mame »

Thank you for the suggestion, but didn't work nevertheless.
(Lister stays ok, only compare window not, gets worse?)

EDIT: Was 255, changed to 0, gets this:

Image: http://s8.postimage.org/u41jcew85/Capture.png

I guess I'll sleep on this for now. Thanks anyway 8)
I hereby claim copyright to this message you are now reading,
and for that you owe me a $1 royalty fee each time you read this.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Sorry, cannot reproduce. :(
Author of Total Commander
https://www.ghisler.com
User avatar
mame
Junior Member
Junior Member
Posts: 54
Joined: 2011-12-03, 18:48 UTC
Location: Everywhere

Post by *mame »

Found out that it is indeed Windows bug, not TC.
Tested some (other) text editors, and confirmed. :x

The only thing 'magical' is that, Lister in F3->ASCII mode doesn't seem to be affected! And that's a good thing.

Anyway, sorry for the trouble.
I hereby claim copyright to this message you are now reading,
and for that you owe me a $1 royalty fee each time you read this.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Ah, thanks for your feedback! Lister uses GetStockObject(OEM_FIXED_FONT,...), when using the default ASCII font, not CreateFont as when choosing a custom font.

So do you get the same problem when choosing Terminal manually in Lister?
Author of Total Commander
https://www.ghisler.com
User avatar
mame
Junior Member
Junior Member
Posts: 54
Joined: 2011-12-03, 18:48 UTC
Location: Everywhere

Post by *mame »

You're welcome.
ghisler(Author) wrote:So do you get the same problem when choosing Terminal manually in Lister?
- Choosing Terminal,9 manually will get the same problem (Terminal,-12,255)
- Re-check Font,ASCII,default will fix that for Lister

I guess GetStockObject(OEM_FIXED_FONT) instead of CreateFont explains a lot, thanks.
I hereby claim copyright to this message you are now reading,
and for that you owe me a $1 royalty fee each time you read this.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Ah, I see, thanks for the tests!
Author of Total Commander
https://www.ghisler.com
Post Reply