googlecolab / colabtools

Python libraries for Google Colaboratory
Apache License 2.0
2.17k stars 706 forks source link

Font size does not change output #2493

Open stefanoantonel opened 2 years ago

stefanoantonel commented 2 years ago

Describe the current behavior I can change the font size of the cell but the output is not in that font size.

Describe the expected behavior The font size is applied also to the output. Specially important for people with low vision.

What web browser you are using Chrome 96

Additional context Screenshot 2021-12-10 at 14 09 55

katlyn-edwards commented 2 years ago

Indeed - the setting is under "Editor" as it only affects the editor.

If you want all text (including page menus, markdown, and outputs) you can use page-level zoom to increase the fonts.

Is there a use case for wanting both code+outputs to be larger, but not markdown and page chrome (menus/sidebars)?

stefanoantonel commented 2 years ago

Thanks for the reply! Well, the use case would be for my brother that has low vision. Basically he wanted to increase the font size instead of browser zoom because as you can see on the image below, the browser zoom takes a lot of space out of the playground for almost the same font size

Screenshot 2021-12-16 at 18 01 22

I don't know how hard is to implement but it would be a good accessibility feature. I recommend him to use the browser zoom for now.

blois commented 2 years ago

The best approach for now may be to use a pre-execute hook to adjust the font size for each output.

An example of this is:

from IPython.display import HTML
shell = get_ipython()

def adjust_font_size():
  display(HTML('''<style> 
    body {
      font-size: 20px;
    }
  '''))

if adjust_font_size not in shell.events.callbacks['pre_execute']:
  shell.events.register('pre_execute', adjust_font_size)

You just execute that once in the top of the notebook then all subsequent outputs will pick up the size. This isn't ideal for shared notebooks as it requires execution of the cells and affects all readers of the notebook but hopefully it helps some.

nardove commented 1 year ago

It will be great to have the cell output font size as another option in the Editor settings

g-i-o-r-g-i-o commented 2 months ago

Hi, please fix this. The output font size should be defined in the settings!

I can't zoom in and out, because it breaks multiple things: matplotilib images, images themselves...

I use colab on many computers, and fixing the zoom each time is driving me crazy.

Screenshot from 2024-06-22 18-02-26

elesq commented 23 hours ago

Please make the output font size something that can be defined in the settings