mirror of
https://github.com/Febbweiss/mopidy-touchscreen.git
synced 2026-03-04 22:25:39 +00:00
Font included in package
This commit is contained in:
@@ -4,5 +4,6 @@ include LICENSE
|
||||
include MANIFEST.in
|
||||
include README.rst
|
||||
include mopidy_touchscreen/ext.conf
|
||||
include mopidy_touchscreen/icomoon.ttf
|
||||
|
||||
recursive-include tests *.py
|
||||
recursive-include tests *.py
|
||||
|
||||
BIN
mopidy_touchscreen/icomoon.ttf
Normal file
BIN
mopidy_touchscreen/icomoon.ttf
Normal file
Binary file not shown.
@@ -14,6 +14,7 @@ from .dynamic_background import DynamicBackground
|
||||
from .library_screen import LibraryScreen
|
||||
from .menu_screen import MenuScreen
|
||||
|
||||
from pkg_resources import Requirement, resource_filename
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -27,7 +28,7 @@ class ScreenManager():
|
||||
self.background = DynamicBackground()
|
||||
self.current_screen = 0
|
||||
self.base_size = self.size[1] / 8
|
||||
font = os.path.join(os.path.dirname(os.path.realpath(__file__)), "fonts", "icomoon", "fonts", "icomoon.ttf")
|
||||
font = resource_filename(Requirement.parse("mopidy-touchscreen"),"mopidy_touchscreen/icomoon.ttf")
|
||||
self.fonts['base'] = pygame.font.SysFont("verdana", self.base_size)
|
||||
self.fonts['icon'] = pygame.font.Font(font, self.base_size)
|
||||
try:
|
||||
|
||||
@@ -22,7 +22,7 @@ class TouchScreen(pykka.ThreadingActor, core.CoreListener):
|
||||
self.cache_dir = config['touchscreen']['cache_dir']
|
||||
self.fullscreen = config['touchscreen']['fullscreen']
|
||||
pygame.init()
|
||||
pygame.mouse.set_visible(config['touchscreen']['cursor'])
|
||||
self.cursor = config['touchscreen']['cursor']
|
||||
self.screen_manager = ScreenManager(self.screen_size, self.core, self.backend, self.cache_dir)
|
||||
|
||||
def start_thread(self):
|
||||
@@ -31,6 +31,7 @@ class TouchScreen(pykka.ThreadingActor, core.CoreListener):
|
||||
screen = pygame.display.set_mode(self.screen_size, pygame.FULLSCREEN)
|
||||
else:
|
||||
screen = pygame.display.set_mode(self.screen_size)
|
||||
pygame.mouse.set_visible(self.cursor)
|
||||
while self.running:
|
||||
clock.tick(15)
|
||||
screen.blit(self.screen_manager.update(), (0, 0))
|
||||
|
||||
BIN
setuptools-5.4.2.zip
Normal file
BIN
setuptools-5.4.2.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user