missionpinball / mpf-mc

The Mission Pinball Framework Media Controller. Controls graphics, sounds, DMDs, and LCD displays in MPF.
http://missionpinball.org
MIT License
21 stars 42 forks source link

widget_styles don't support bitmap_font #391

Open michael-betz opened 4 years ago

michael-betz commented 4 years ago

my config.yaml

widget_styles:
  text_default:
    bitmap_font: True
    font_name: CG-pixel

slides:
    testSlide:
    - type: text
      text: TEST

slide_player:
  mode_attract_started: testSlide

result:

kivy: Exception while processing RegisteredHandler(callback=<bound method McConfigPlayer.play_from_trigger of McConfigPlayer.widgets>, priority=1, kwargs={}, key=UUID('1d1a423e-565d-4b9e-a980-b80fb095a1de'), condition=None, blocking_facility=None) for event widgets_play
Traceback (most recent call last):
  File "/home/sysop/mpfdev/mpf/mpf/core/events.py", line 662, in _run_handlers
    result = handler.callback(**merged_kwargs)
  File "/home/sysop/mpfdev/mpf-mc/mpfmc/core/mc_config_player.py", line 56, in play_from_trigger
    self.play(settings=settings, context=context, calling_context=calling_context, priority=priority, **kwargs)
  File "/home/sysop/mpfdev/mpf-mc/mpfmc/config_players/widget_player.py", line 147, in play
    self._action_add(s, instance_dict, widget, context, kwargs)
  File "/home/sysop/mpfdev/mpf-mc/mpfmc/config_players/widget_player.py", line 105, in _action_add
    slide.add_widgets_from_library(name=widget, play_kwargs=play_kwargs, **s)
  File "/home/sysop/mpfdev/mpf-mc/mpfmc/uix/slide.py", line 136, in add_widgets_from_library
    play_kwargs=play_kwargs)
  File "/home/sysop/mpfdev/mpf-mc/mpfmc/uix/widget.py", line 909, in create_widget_objects_from_config
    mc=mc, config=widget, key=this_key, play_kwargs=play_kwargs)
  File "/home/sysop/mpfdev/mpf-mc/mpfmc/widgets/text.py", line 96, in __init__
    self._process_text(self.original_text)
  File "/home/sysop/mpfdev/mpf-mc/mpfmc/widgets/text.py", line 204, in _process_text
    self.update_vars_in_text(text)
  File "/home/sysop/mpfdev/mpf-mc/mpfmc/widgets/text.py", line 243, in update_vars_in_text
    self.update_text(text)
  File "/home/sysop/mpfdev/mpf-mc/mpfmc/widgets/text.py", line 264, in update_text
    self._label.texture_update()
  File "/home/sysop/.pyenv/versions/3.6.6/lib/python3.6/site-packages/kivy/uix/label.py", line 413, in texture_update
    self._label.refresh()
  File "/home/sysop/.pyenv/versions/3.6.6/lib/python3.6/site-packages/kivy/core/text/__init__.py", line 759, in refresh
    self.resolve_font_name()
  File "/home/sysop/.pyenv/versions/3.6.6/lib/python3.6/site-packages/kivy/core/text/__init__.py", line 356, in resolve_font_name
    raise IOError('Label: File %r not found' % fontname)
OSError: Label: File 'CG-pixel.ttf' not found

Note that the slide below displays correctly

slides:
    testSlide:
    - type: text
      font_name: CG-pixel
      bitmap_font: True
      text: TEST
gbouthenot commented 1 year ago

I have the exact same problem. mfp-mc 0.56.1