設定で付属フォントを選ぶとエラー

Issue #769 resolved
暗黒 騎士 created an issue

今更ながら現在のPyではフォントを同梱しないようになっていることに気づきました。

以前、自分も完全削除を試みて、簡易設定の付属フォントを指定していると設定を開いた瞬間フリーズする(フォントが存在しないため)keyエラーが回避できないので断念したという経緯があったので確認したのですが、やはり同種の問題が起こっているようです。

稀だとは思いますが、スキン側で設定してあったり既に設定しまった場合、ライトユーザーだと設定ダイアログを開けなくなるので、正式版に残るバグとしては結構重大ではないかと考えます。

検討の方、よろしくお願いします。

DateTime: 2019-03-20 20:39:43
Traceback (most recent call last):
  File ".\cw\dialog\settings.py", line 3477, in OnCellChangeBase
  File ".\cw\dialog\settings.py", line 3465, in _select_base
  File ".\cw\dialog\settings.py", line 3507, in get_basefontface
KeyError: 'gothic'

Comments (7)

  1. k4nagatsuki repo owner

    pull request #2416

    ご報告ありがとうございます。以下のように修正しました。

    1. IPAフォントがある場合のみ[標準フォント]を選択可能にする。
    2. 標準フォントが選択されているのにIPAフォントが消えている場合はエラー表示にする。
    3. IPAフォントも代替フォントも見つからない場合は起動時にエラーダイアログを出す。
  2. 暗黒 騎士 reporter

    「スキン側で基本フォントのTypeが設定されている場合」があるので、少なくともgothicなど基本5種のkeyエラー自体を塞がないと不味いように思います。

    最新版で基本フォントに[gothic]等が入ったスキンに変更しようとするとフリーズし、プロセスがゾンビ化するようです。

  3. k4nagatsuki repo owner

    すみませんがどういう意味かよく分かりません。

    どういうデータでフリーズするかXMLデータを貼り付けていただけませんか?

  4. 暗黒 騎士 reporter
    skin.xml 
    
    …
      <FontGothic />
      <FontPGothic />
      <Fonts>
       <Font bold="True" expandedbold="True" italic="False" key="ccardname" pixels="12" type="gothic" />
       </Fonts>
      </Settings>
     </Skin>
    
    --------------------------------------------------
    Version : 3.2 (64-bit) / 2019-03-21 11:05:13
    DateTime: 2019-03-21 12:16:23
    Traceback (most recent call last):
      File ".\cw\setting.py", line 2799, in get_res
      File ".\cw\setting.py", line 1753, in create_font
      File ".\cw\setting.py", line 1711, in get_fontfromtype
    KeyError: 'gothic'
    
    リソース [Font/pcard_name] の読み込みに失敗しました。
    Traceback (most recent call last):
      File ".\cw\thread.py", line 803, in run
      File ".\cw\thread.py", line 824, in _run
      File ".\cw\thread.py", line 839, in main_loop
      File ".\cw\eventhandler.py", line 104, in run
      File ".\cw\eventhandler.py", line 374, in lclick_event
      File ".\cw\sprite\statusbar.py", line 1377, in lclick_event
      File ".\cw\eventhandler.py", line 506, in f2key_event
      File ".\cw\thread.py", line 1736, in call_modaldlg
      File ".\cw\thread.py", line 839, in main_loop
      File ".\cw\eventhandler.py", line 121, in run
      File ".\cw\eventhandler.py", line 759, in executing_event
      File ".\cw\thread.py", line 539, in update_skin
      File ".\cw\thread.py", line 654, in update_scale
      File ".\cw\data.py", line 239, in update_scale
      File ".\cw\sprite\card.py", line 563, in update_scale
      File ".\cw\sprite\card.py", line 596, in update_image
      File ".\cw\image.py", line 772, in get_image
    AttributeError: 'NoneType' object has no attribute 'render'
    
  5. 暗黒 騎士 reporter

    無事変更できるようになったのを確認しました。

    対応ありがとうございました。

  6. Log in to comment