Chromeで汚い日本語フォントを直す方法
in

Chromeはすごく速くて快適なんだけど、デフォルトのままだと日本語が汚くて仕方がない。そこで、Meiryoフォントを使うように設定する。

  • 右上のスパナアイコンをクリック
  • Options
  • Under the Hood タブ
  • スクロールして下の方に行き、Change font and language settingsボタンを押す
  • 面倒なので全部Meiryoフォントを指定

これでほとんどのサイトで日本語がMeiryoフォントで表示される。ところが稀にFont-Familyで変なフォントを指定しているサイトがある。例えばこれ↓

http://wiredvision.jp/

このサイトでは日本語が汚くなってしまう。そこでフォント指定がされていても強制的にMeiryoにするChrome Extensionを紹介。

http://cpplover.blogspot.com/2010/02/chrome-5-beta-font-family-serif.html

上記を参考に一部だけ変更した。元ネタとの違いは特定のページ(wiredvisionが含まれるURL)のみで強制的にフォントを変えること。これによって、他のまともに見えるページには影響がない。強制的にすべてフォントを変えると、英文フォントなど一部、きれいに表示されなくなってしまうので、URLを限定している。

Manifest.jsonはこんな感じ。

{
       
"name": "Disable Ugly Font",
       
"version": "1.0",
       
"description": "Disable bold and italic",

       
"permissions": [
       
"http://*/*",
       
"https://*/*"
       
],

       
"content_scripts": [
                {
                       
"matches" : [
                               
"http://*/*",
                               
"https://*/*"
                       
],
                       
"js" : ["disable-ugly-font.js"],
                       
"all_frames" : true
               
}
        ]
}

disable-ugly-font.jsをこんな感じで。

(function()
{
    var
url = document.location.href;
    if(
url.indexOf("wiredvision") != -1)
    {
        var
style = document.createElement("style") ;
       
style.setAttribute("id", "hito-disable-ugly-style") ;
       
style.appendChild(
               
document.createTextNode( "* { font-family : 'Meiryo' !important ; font-weight : normal !important ; font-style : normal !important ;}" )
                ) ;
       
document.getElementsByTagName("head").item(0).appendChild(style) ;
    }
})();

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <code> <cite> <ul> <ol> <li> <dl> <dt> <dd> <p>
  • Lines and paragraphs break automatically.
  • Link to Amazon products with: [amazon product_id inline|full|thumbnail]. Example: [amazon 1590597559 thumbnail]
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Images can be added to this post.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.