Skip to content

Commit

Permalink
Really (?) fix to hi-dpi font issue on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanDunfield committed Dec 29, 2024
1 parent aed9e3f commit 929d8ca
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions python/tkterminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,16 +273,17 @@ def report_callback_exception(self, exc, value, traceback):
self.IP.showtraceback()

def set_font(self, font_choice):
self.normal_font = normal_font = Font(font=font_choice.as_tuple())
self.bold_font = bold_font = Font(font=font_choice.bold().as_tuple())
self.text.config(font=normal_font)
normal_tuple = font_choice.as_tuple()
bold_tuple = font_choice.bold().as_tuple()
normal_font = Font(font=font_choice.as_tuple())
self.char_size = normal_font.measure('M')
self.text.config(font=normal_tuple)
text = self.text
text.tag_config('output', font=normal_font)
text.tag_config('Prompt', foreground='#0000cc', font=normal_font)
text.tag_config('PromptNum', foreground='#0000bb', font=bold_font)
text.tag_config('OutPrompt', foreground='#cc0000', font=normal_font)
text.tag_config('OutPromptNum', foreground='#bb0000', font=bold_font)
text.tag_config('output', font=normal_tuple)
text.tag_config('Prompt', foreground='#0000cc', font=normal_tuple)
text.tag_config('PromptNum', foreground='#0000bb', font=bold_tuple)
text.tag_config('OutPrompt', foreground='#cc0000', font=normal_tuple)
text.tag_config('OutPromptNum', foreground='#bb0000', font=bold_tuple)

def add_blocker(self, window, message):
self.blockers[window] = message
Expand Down

0 comments on commit 929d8ca

Please sign in to comment.