rickparrish / fTelnet

fTelnet: An HTML5 WebSocket client
GNU Affero General Public License v3.0
70 stars 38 forks source link

Request: Make OnFontChange redraw of screen in new codepage optional #14

Open opicron opened 3 years ago

opicron commented 3 years ago

First of all, thank you for such an great telnet client!

I have an board running which makes use of various codepages, even various codepages per screen. When using NetRunner to visit the board I can see both the Amiga and IBM font on the same screen.

I am checking your sourcecode and I see that in crt.ts line 685 there is an OnFontChanged event which triggers the redraw in the new font.

Could we add an switch to prevent redrawing the whole screen in the new codepage?

The board in question is bbs.opicron.eu:23 and the sections are download, queue and newmail if you want to see how I use the codepages :).

Examples: Capture2 Capture1

rickparrish commented 3 years ago

I've just pushed a new version with a SkipRedrawWhenSameFontSize option, so if you set that to true then it'll skip redrawing the entire screen if the new font is the same size as the old font.

Note that a few events force a redraw, for example classic scrollback, selecting text, and possibly others I'm forgetting, so it's not a perfect solution. Hopefully those aren't features users use often though, in which case it should look good for the most part.

It's not updated on the embedded version yet, so if that's what you're using then it's not available yet. I made some other changes today, and want to make sure they haven't broken anything before I update that.

opicron commented 3 years ago

Great thanks for that! When I find the time I will create an docker build for ftelnet to easily deploy various setups. Will await the embedded version for now =).

opicron commented 3 years ago

Still not found the time to make an docker to self host fTelnet, but the embedded still does fine for now. I have made a test at:

https://thawk.nl/theforze-board/

When an new codepage is used in certain sections of the main menu (downloads, queue and new message). The whole font size changes somehow and results in an smaller window than initially drawn. Is this correct behaviour, and can we fix the font size (and skip redraw on code page changes)?

I added the following configuration to the embed script. Following the source code I think that is correct?

Options.SkipRedrawWhenSameFontSize = true;

opicron commented 3 years ago

I partly fixed the rescaling of the font by hardcoding the resolution in css:

@media (min-width: 1200px) { .fTelnetClientContainer { width:1200px !important; height:720px !important; } .fTelnetCrtCanvas { width:1200px !important; } }