Forum Archive

Increase Console Font size

OI

Is it possible to increase the size of the fonts used in the console? I am using an iPad Pro and the standard fonts are pretty small, at least to me, I know in the edit I can change the fonts in settings but I did not see anything regarding the console, thanks

Webmaster4o

console.set_font does what you're looking for.

OI

@Webmaster4o said:

console.set_font does what you're looking for.

Thank you, will this be a command I will do at the console bottom line? will this be a permanent even if I close Pythonista?

Webmaster4o

@OI no, it won't be permanent. What you can do to make it semi-permanent is to create a file in site-packages called pythonista-startup.py. This will be run every time you launch pythonista. If you put your font setting in this file, then your change will be more permanent. Of course, other scripts can still change this setting with console.set_font

OI

@Webmaster4o said:

@OI no, it won't be permanent. What you can do to make it semi-permanent is to create a file in site-packages called pythonista-startup.py. This will be run every time you launch pythonista. If you put your font setting in this file, then your change will be more permanent. Of course, other scripts can still change this setting with console.set_font

Thanks, I was looking for the console.py file to look into the standard parameters for name and size, but did not find it, do you know where can I get that information, I need the default name and size parameters and what are the possible values,

Webmaster4o

@OI No, there's nothing like console.get_font(). There might have been someone with this question before, search the forums. I may be misremembering.

Webmaster4o

@OI Yes, I remembered correctly. @JonB had a solution here. Code you can use to get current name and size is

from objc_util import *

app=ObjCClass('UIApplication').sharedApplication()
d=app.delegate()
cvc=d.consoleViewController()

cvc.view()
font=cvc.outputFont()
print font
OI

thanks, I found the default font is Menlo-Regular 14pt, I have create the following script:

import console
console.set_font("Menlo-Regular", 18)

It works fine if I execute the script myself, but if I save it in site-packages as pythonista-startup.py, nonetheless it doesn't work after I restart Pythonista, it always default to 14pt, are you sure that's the correct file name?

OI

found it on the documentation is pythonista_startup.py, thanks a lot