ttyx icon indicating copy to clipboard operation
ttyx copied to clipboard

Issue: Change Font

Open gitkalz opened this issue 7 years ago • 3 comments

Hi There,

This is great.. Thanks for your effort in bringing back the simplicity of tty.js and giving it a new life..

Do you know how can I customize the font size and color on the terminal.. In tty.js era, I just used a user.css file to indicate my font and color settings, however this seem not working with xterm.js. I see that xterm.js uses xterm.css however i cannot find relevant block to apply my font settings.

You may feel free to close this issue if you see it not relevant. Thanks again for your time and Great Work!

gitkalz avatar May 01 '18 15:05 gitkalz

Yep.... It’s a legitimate issue. I prefer the old css way also. Alas, xterm.js doesnt do it that way. There are APIs in xterm.js to do this, but I should probably include an example user.js that does it. I did this for my own live instance and its tricky because it wont auto load fonts.

risacher avatar Jun 01 '18 22:06 risacher

I think I'll put the background color and fonts into the preferences.

In the meanwhile, the current code in github has fonts hardcoded at line 632 of static/ttyx-client.js:

https://github.com/risacher/ttyx/blob/master/static/ttyx-client.js#L632

risacher avatar Jun 04 '18 13:06 risacher

added fontSize and fontFamily to config.json options.

I think the colors are customizable too from that file, but poorly documented what they mean.

risacher avatar Jun 05 '18 18:06 risacher