我对HTTP服务器aiohttp与蟒蛇-3.6.如何web.Response()通过JSON(来自a dict)返回?
async def api_server(request):
res = {"q": "qqq", "a": "aaa"}
return web.Response(res) # <-- as JSON
Run Code Online (Sandbox Code Playgroud) 对于 Pillow 类ImageDraw(https://pillow.readthedocs.io/en/stable/reference/ImageDraw.html#PIL.ImageDraw.PIL.ImageDraw.ImageDraw.text)我找到了 param features。它可以调整此字体参数:https://learn.microsoft.com/en-us/typography/opentype/spec/featurelist
如何设置字距调整(kern)参数?我不知道语法。
这不是工作:
draw.text((61, 386), text, (0, 0, 0), font=font, features={"kern": 1.0})
Run Code Online (Sandbox Code Playgroud)