<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tanakahisateru</author_name>
  <author_url>https://blog.hatena.ne.jp/tanakahisateru/</author_url>
  <blog_title>なんたらノート第三期ベータ</blog_title>
  <blog_url>https://tanakahisateru.hatenablog.jp/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>PIL(Python Image Libraly)で日本語フォント使おうとすると、ラスタライズ結果がぐちゃぐちゃになることがある。これはハマった。つぶれる条件はどうやら、ビットマップを持つフォントのビットマップが適用される場合のようだ。ビットマップが適用されないぐらい十分大きいサイズで描いて、それを目的のサイズに縮小して問題を回避。アンチエイリアスされた文字を得るのが目的ならこれでOK。 import Image, ImageFont, ImageDraw def imaged_text(text, fontfile, fontsize, color, scale_bias=4): font …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftanakahisateru.hatenablog.jp%2Fentry%2F20081008%2F1223450159&quot; title=&quot;PILでTrueType日本語フォントを使う - なんたらノート第三期ベータ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-10-08 16:15:59</published>
  <title>PILでTrueType日本語フォントを使う</title>
  <type>rich</type>
  <url>https://tanakahisateru.hatenablog.jp/entry/20081008/1223450159</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
