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

Commit

Permalink
Allow setting font name and size
Browse files Browse the repository at this point in the history
Fixes #4
  • Loading branch information
JIghtuse authored and bfredl committed Apr 14, 2016
1 parent 16e2059 commit 368ba50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions neovim_gui/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
@click.option('--notify', '-n', default=False, is_flag=True)
@click.option('--listen', '-l')
@click.option('--connect', '-c')
@click.option('--font', '-f', default=('Monospace', 13), nargs=2)
@click.option('--profile',
default='disable',
type=click.Choice(['ncalls', 'tottime', 'percall', 'cumtime',
'name', 'disable']))
@click.pass_context
def main(ctx, prog, notify, listen, connect, profile):
def main(ctx, prog, notify, listen, connect, font, profile):
"""Entry point."""
address = connect or listen

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

from .gtk_ui import GtkUI
ui = GtkUI()
ui = GtkUI(font)
bridge = UIBridge()
bridge.connect(nvim, ui, profile if profile != 'disable' else None, notify)

Expand Down
6 changes: 3 additions & 3 deletions neovim_gui/gtk_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ class GtkUI(object):

"""Gtk+ UI class."""

def __init__(self):
def __init__(self, font):
"""Initialize the UI instance."""
self._redraw_arg = None
self._foreground = -1
self._background = -1
self._font_size = 13
self._font_name = 'Monospace'
self._font_name = font[0]
self._font_size = font[1]
self._screen = None
self._attrs = None
self._busy = False
Expand Down

0 comments on commit 368ba50

Please sign in to comment.