Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.

Commit 368ba50

Browse files
JIghtusebfredl
authored andcommitted
Allow setting font name and size
Fixes #4
1 parent 16e2059 commit 368ba50

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

neovim_gui/cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
@click.option('--notify', '-n', default=False, is_flag=True)
1414
@click.option('--listen', '-l')
1515
@click.option('--connect', '-c')
16+
@click.option('--font', '-f', default=('Monospace', 13), nargs=2)
1617
@click.option('--profile',
1718
default='disable',
1819
type=click.Choice(['ncalls', 'tottime', 'percall', 'cumtime',
1920
'name', 'disable']))
2021
@click.pass_context
21-
def main(ctx, prog, notify, listen, connect, profile):
22+
def main(ctx, prog, notify, listen, connect, font, profile):
2223
"""Entry point."""
2324
address = connect or listen
2425

@@ -60,7 +61,7 @@ def main(ctx, prog, notify, listen, connect, profile):
6061
nvim = attach('child', argv=nvim_argv)
6162

6263
from .gtk_ui import GtkUI
63-
ui = GtkUI()
64+
ui = GtkUI(font)
6465
bridge = UIBridge()
6566
bridge.connect(nvim, ui, profile if profile != 'disable' else None, notify)
6667

neovim_gui/gtk_ui.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ class GtkUI(object):
7373

7474
"""Gtk+ UI class."""
7575

76-
def __init__(self):
76+
def __init__(self, font):
7777
"""Initialize the UI instance."""
7878
self._redraw_arg = None
7979
self._foreground = -1
8080
self._background = -1
81-
self._font_size = 13
82-
self._font_name = 'Monospace'
81+
self._font_name = font[0]
82+
self._font_size = font[1]
8383
self._screen = None
8484
self._attrs = None
8585
self._busy = False

0 commit comments

Comments
 (0)