PIL、ImageFont、ImageDraw如何显示粗体字????
时间:2011-06-27
来源:互联网
Python code
这样显示的汉字是不加粗的,那如何显示粗体的汉字呢???
font = ImageFont.truetype("simsun.ttc",24) #simsun.ttc是宋体字库文件,要和本程序放在一个目录下 img0 = Image.new('L',(24,24),0) draw = ImageDraw.Draw(img0) draw.text((0,0),u'你',font=font,fill=256)
这样显示的汉字是不加粗的,那如何显示粗体的汉字呢???
作者: XIANXir 发布时间: 2011-06-27
Bold and italic typefaces are usually separate designs from the
"regular" version, so TrueType/OpenType fonts usually consist of a
number of separate font files.
PIL has no support for synthetic font manipulations (and there's
nothing built in to FreeType either, even if you can simulate some
styles using low-level outline transforms).
这是什么意思??是不是说,我只有通过加载粗体字库才能用ImageFont显示粗体的汉字啊????
可是Windows目录下没有专门的粗体的宋体字库啊???
"regular" version, so TrueType/OpenType fonts usually consist of a
number of separate font files.
PIL has no support for synthetic font manipulations (and there's
nothing built in to FreeType either, even if you can simulate some
styles using low-level outline transforms).
这是什么意思??是不是说,我只有通过加载粗体字库才能用ImageFont显示粗体的汉字啊????
可是Windows目录下没有专门的粗体的宋体字库啊???
作者: XIANXir 发布时间: 2011-06-27
用雅黑吧。有专门粗体文件。
作者: iambic 发布时间: 2011-06-27
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28