Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terminal: change font size dynamically #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hoihu
Copy link
Sponsor

@hoihu hoihu commented May 14, 2016

With this change, the font size is proportional to the viewport, it scales if the browser window is resized.

This helps on high-resolution screens (tested on safari and chrome).

font size is proportional to viewport, so it scales and is better readable on high
resolution screens
@pfalcon
Copy link
Contributor

pfalcon commented May 14, 2016

I actually thought about allowing to switch to bigger terminal size than 80x24, and wonder how this change would interact with that.

@hoihu
Copy link
Sponsor Author

hoihu commented May 14, 2016

It leaves the terminal to 80x24 and just scales the font size.

But auto-resizing the terminal window might also be possible (maybe by using a javascript function).

@dpgeorge
Copy link
Member

You can use ctrl-+ and ctrl-- to change font size, as usual for web pages. Isn't that a better solution?

Then we can make the rows and columns expand to fill the screen, and it'll work for any font size that the user chooses.

@dpgeorge
Copy link
Member

See #6 for an auto resizing patch.

@hoihu
Copy link
Sponsor Author

hoihu commented May 17, 2016

can use ctrl-+ and ctrl-- to change font size,

to have a decent "default viewing" size was the goal. Having it set in pixels is IMO not correct but then I'm not a web expert.

using ctrl+ strikes me as not really user friendly.

@dpgeorge
Copy link
Member

to have a decent "default viewing" size was the goal.

Do you mean terminal size (cols and rows) or font size, or both?

What do you think of #6 (see http://micropython.org/webrepl/index2.html)? How to reconcile an auto font size with auto terminal size?

@hoihu
Copy link
Sponsor Author

hoihu commented May 17, 2016

i havent tested it (still sitting in the train..) but looking forward to trying it out!

@pfalcon
Copy link
Contributor

pfalcon commented May 17, 2016

Having it set in pixels is IMO not correct but then I'm not a web expert.

If it's set in pixels, it comes from the term.js example, that's it. Per #6 (comment) we (I) welcome anyone to make it better, but well, please show/explain that your changes don't make it worse instead (in some sense of "worse"). I'd personally prefer that there was prototyping of file xfer functionality rather than global look&feel changes, which them may need to be changed again (because currently it's too easy to assume "there's terminal widget there, and nothing else").

@hoihu
Copy link
Sponsor Author

hoihu commented May 17, 2016

If it's set in pixels, it comes from the term.js example, that's it

I have made a remark in #6 about that. Yes it's in term.js as default but can be overridden in the html file.

@pfalcon
Copy link
Contributor

pfalcon commented May 17, 2016

I'm not sure I made myself clear - both term.js and majority of webrepl.html come from upstream "term.js" project distribution. If it's set to 11px, it's not because I set it to that, it's because the "term.js" maintainer set it to that, and by default, s/he had a good reason to do so. If you think that another value is better, you in general would need to argue why (it's more or less clear in the case of font size, but still requires testing on various devices, in other cases, it may be less clear).

@martinlombana
Copy link

Yeah, in my case, currently, the font is very small, and I am on a 29 inches Dell monitor (not hight dpi, just regular). But if I change the term.js fontsize, then it messes up the overall structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants