From d6e3b5834a994a842375dc1b2c2cd6017cff4498 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 7 Sep 2020 09:42:57 +1000 Subject: [PATCH] AP_MSP: change font to fix arrows and added --font and --list-fonts --- libraries/AP_MSP/Tools/msposd.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/AP_MSP/Tools/msposd.py b/libraries/AP_MSP/Tools/msposd.py index bc44acf44d..cf1776491d 100755 --- a/libraries/AP_MSP/Tools/msposd.py +++ b/libraries/AP_MSP/Tools/msposd.py @@ -21,6 +21,8 @@ import math parser = argparse.ArgumentParser(description='ArduPilot MSP FPV viewer') parser.add_argument('--port', default="tcp:localhost:5763", help="port to listen on, can be serial port or tcp:IP:port") +parser.add_argument('--font', help="font to use", default="freesans") +parser.add_argument('--list-fonts', action="store_true", default=False, help="show list of system fonts") args = parser.parse_args() @@ -244,7 +246,9 @@ def receive_data(): return msp.parseMspData(buf) -font = pygame.font.Font('freesansbold.ttf', 12) +if args.list_fonts: + print(sorted(pygame.font.get_fonts())) +font = pygame.font.SysFont(args.font, 12) def run(): last_display_t = time.time()