Use path of __file__ to indicate where the font is stored
This commit is contained in:
parent
b65b451c60
commit
0b8ca5257f
|
@ -1,5 +1,6 @@
|
||||||
import pyglet
|
import pyglet
|
||||||
import PySimpleGUI as sg
|
import PySimpleGUI as sg
|
||||||
|
import os
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Demo - Using pyglet to get custom fonts into PySimpleGUI
|
Demo - Using pyglet to get custom fonts into PySimpleGUI
|
||||||
|
@ -17,8 +18,11 @@ import PySimpleGUI as sg
|
||||||
http://scripts.sil.org/OFL
|
http://scripts.sil.org/OFL
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pyglet.font.add_file(r".\OpenFlame.ttf")
|
font_file = os.path.join(os.path.dirname(__file__), "OpenFlame.ttf")
|
||||||
|
|
||||||
|
pyglet.font.add_file(font_file)
|
||||||
|
|
||||||
|
# sg.execute_command_subprocess(font_file)
|
||||||
font1 = ("Open Flame", 40) # Note - use the font "face name" not the filename when specifying the font
|
font1 = ("Open Flame", 40) # Note - use the font "face name" not the filename when specifying the font
|
||||||
font2 = ("Courier New", 40)
|
font2 = ("Courier New", 40)
|
||||||
font3 = ("Helvetica", 40)
|
font3 = ("Helvetica", 40)
|
||||||
|
|
Loading…
Reference in New Issue