2013/08/17

Python 3.3.2でMatplotlibを動かす

なんか、文字コードのエラーになった。
フォント名に日本語が含まれてると、そりゃasciiじゃ複合できんわな。
というわけで、

c:\Python33\Lib\site-packages\matplotlib\font_manager.py
のエラーでてたとこのasciiをcp932に。
    #  Styles are: italic, oblique, and normal (default)

    sfnt = font.get_sfnt()
    sfnt2 = sfnt.get((1,0,0,2))
    sfnt4 = sfnt.get((1,0,0,4))
    print(sfnt4)
    if sfnt2:
        sfnt2 = sfnt2.decode('ascii').lower()
    else:
        sfnt2 = ''
    if sfnt4:
        sfnt4 = sfnt4.decode('cp932').lower()
    else:
        sfnt4 = ''

解決。