radio.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:SpotifyRadioOrangePiZero 作者: vLX42 项目源码 文件源码
def displaySpoitfyTitle():

    # Write some text.
    text = "    -=SPOTIFY=-        " +  spconnect('metadata','track_name')  +" - " + spconnect('metadata','artist_name')
    #print text

    lines = textwrap.wrap(text, width=24)
    current_h, pad = 0, 0

    font = ImageFont.load_default()
    font2 = ImageFont.truetype('fonts/C&C Red Alert [INET].ttf', 12)
    with canvas(disp) as draw:
        for line in lines:
            w, h = draw.textsize(line, font=font2)
            draw.text(((128 - w) / 2, current_h), line, font=font2, fill=255)
            current_h += h + pad
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号