Font included in package

This commit is contained in:
9and3r
2014-08-02 16:57:12 +02:00
parent dd1e6a4c40
commit bc3e3c50e8
5 changed files with 6 additions and 3 deletions

View File

@@ -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

Binary file not shown.

View File

@@ -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:

View File

@@ -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

Binary file not shown.