omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    console input font size

    Pythonista
    3
    4
    1122
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • huub
      huub last edited by

      console.set_font sets the size of the OUTPUT font. I like that a lot as a larger font size is easier on my eyes. However, is there a way to increase the size of the font in the INPUT line ( the line above the keyboard)?

      stephen cvp 2 Replies Last reply Reply Quote 0
      • stephen
        stephen @huub last edited by

        @huub ive givin this a really good try.. and i cannot seem to get this one.. i know some font is controlled soley on system wide setings and i did not see input font in NSUserDefaults if you change your ios font scalevdoes it change for thevInput Field?

        1 Reply Last reply Reply Quote 0
        • cvp
          cvp @huub last edited by cvp

          @huub Quick and dirty as usual, but seems to work. You can surely make it nicer and use it as Pythonista tool.

          from objc_util import *
          @on_main_thread
          def FindConsoleInput():
          	global console_tv
          	win = ObjCClass('UIApplication').sharedApplication().keyWindow()
          	main_view = win.rootViewController().view() 
          	ret = '' 
          	next_is_console = False
          	def analyze(v,indent):
          		global next_is_console
          		ret = None
          		for sv in v.subviews():
          			if 'UILabel' in str(sv._get_objc_classname()):
          				if str(sv.text()) == '>':
          					next_is_console = sv
          				else:
          					next_is_console = False
          			elif 'OMTextEditorView' in str(sv._get_objc_classname()):	
          				if next_is_console:
          					return sv
          			ret = analyze(sv,indent+'  ')
          			if ret:
          				return ret
          	ret = analyze(main_view,'')
          	return ret
          	
          @on_main_thread
          def main():
          	ev = FindConsoleInput()
          	
          	PA2UITheme = ObjCClass('PA2UITheme')
          	theme_dict = PA2UITheme.sharedTheme().themeDict().mutableCopy()
          	theme_dict.autorelease()
          	theme_dict['font-family'] = 'Menlo-Regular'
          	theme_dict['font-size'] = 40
          	
          	OMSyntaxHighlighterTheme = ObjCClass('OMSyntaxHighlighterTheme')
          	theme = OMSyntaxHighlighterTheme.alloc().initWithDictionary_(theme_dict)
          	theme.autorelease()
          	ev.setTheme_(theme)
          	
          if __name__ == '__main__':
          	main() 
          

          stephen 1 Reply Last reply Reply Quote 1
          • stephen
            stephen @cvp last edited by

            @cvp

            i know im fresh new to Objc but i spent hours tying anything i could find... 🤓😁💪 outstanding!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB Forums | Contributors