ラベル Font の投稿を表示しています。 すべての投稿を表示
ラベル Font の投稿を表示しています。 すべての投稿を表示

2016年3月26日土曜日

rxvt-unicodeのフォント再設定

.Xresourceの設定


今の .Xresource 設定です。

URxvt*termName:         xterm-256color
URxvt*depth:            24
URxvt*saveLIne:         300000
URxvt*geometry:         120x35
URxvt*perl-ext-common:  default,matcher,clipboard-osc
!URxvt*perl-ext-common: default,matcher,clipboard-osc,xim-onthespot
URxvt*inputMethod:      uim
URxvt*imLocale:         en_US.UTF-8
!URxvt*preeditType:     OnTheSpot
!URxvt*preeditType:     OverTheSpot
URxvt*url-launcher:     chromium
URxvt*matcher*button:   1

URxvt*foreground:       #B2B2B2
URxvt*background:       #202020
!URxvt*background:      black

URxvt*color0:           #2e3436
URxvt*color1:           #cc0000
URxvt*color2:           #4edc4e
URxvt*color3:           #c4a000
URxvt*color4:           #3465a4
URxvt*color5:           #75507b
URxvt*color6:           #06989a
URxvt*color7:           AntiqueWhite
URxvt*color8:           Grey25
URxvt*color9:           Red
URxvt*color10:          #00ff00
URxvt*color11:          Yellow
URxvt*color12:          #5c5cff
URxvt*color13:          Magenta
URxvt*color14:          Cyan
URxvt*color15:          White

URxvt*lefterSpace:      -1
URxvt*lineSpace: 0

URxvt.font:              xft:Terminus:pixelsize=14:antialiase=true,xft:Ricty:pixelsize=14:antialiase=true
URxvt.boldfont:          xft:Terminus:piselsize=14:antialiase=true:bold,xft:Ricty:pixelsize=14:bold:antialiase=true
URxvt.italicfont:        xft:Terminus:piselsize=14:antialiase=true:italic,xft:Ricty:pixelsize=14:italic:antialiase=true
URxvt.bolditalicfont:    xft:Terminus:piselsize=14:antialiase=true:bold:italic,xft:Ricty:pixelsize=14:bold:italic:antialiase=true
URxvt.imFont:            -xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso10646-1

Powerlineを使っているのでTerminusを優先にしています。RictyにPowerlineのパッチを適用しても良いのですが好みの感じにならなかったので、こうしてます。pixelsize=14とかなり文字は小さいので辛いって人はサイズ大きくすると良いかも。またTerminusを最初に持ってきていてpixselsize=14だとrxvt-unicode (urxvt) だと日本語変換 (OnTheSpot) で変換出来ないので imFont を設定しています。

しかし、どうしてか Ricty にパッチあててもうまくいかないんだよな。

2015年6月2日火曜日

w3mでの乱れ

muttなどでHTMLメールを表示するときに使う、それだけじゃないけれどw3mですがrxvt-unicodeで定義しているフォントが全てXFTだと画像の表示が乱れるので、以下のように設定しています。

URxvt.font:              x:9x15,xft:Ricty:size=12:antialiase=true
URxvt.boldFont:          xft:Ricty:bold:size=12:antialiase=true
URxvt.italicFont:        xft:Ricty:italic:size=12:antialiase=true
URxvt.bolditalicFont:    xft:Ricty:bold:italic:size=12:antialiase=true

9x15とビットマップフォントを混ぜているのがポイントです。これでw3mで画像を表示しても乱れること無く描写されます。フォントサイズもちょうど良いと個人的には思っています。 他に良い方法があるって人は教えてください。

Android Mのフォント

Android Mのプレビューが発表されましたが日本語フォントが変更になっています。今まではモトヤフォントが使われていましたが、Android MからはNoto Sansフォントが利用されるようになるようです。

Nexus 5にプレビューを導入してみたのですが端末の言語設定が英語だと相変わらず中華フォントで表示されちゃいました。日本語フォントで表示出来れば良いんですけどね。
まあ、設定ファイルを変更するだけといえばそれだけなんですけどねぇ。

2015年4月30日木曜日

urxvt(rxvt-unicode)でw3mの画像がうまく描画されない

現象としてはタイトルのまんまなのですが、urxvt(rxvt-unicode)でw3mを利用すると、画像の描画が乱れます。前はこんな事なかったのになぁ。と思いながら問題なかったときから何を変更したかを、考えていました。

そして、変更したポイントが分かりました。前はurxvtの設定をビットマップフォントを指定していたんですが、xftでフォント指定するようになってから、この現象になったんです。そこで以下のようにフォント設定を変更してみました。

URxvt.font:              x:9x15, xft:Ricty:size=12:antialiase=true
URxvt.boldFont:          xft:Ricty:bold:size=12:antialiase=true
URxvt.italicFont:        xft:Ricty:italic:size=12:antialiase=true
URxvt.bolditalicFont:    xft:Ricty:bold:italic:size=12:antialiase=true

フォントの指定部分で pcf フォントである 9x15.pcf.gz を指定してみました。この状態でw3mを起動して画像表示すると綺麗に画像が表示されました。
実はこれ、長く悩んでいたんです。


やっとすっきりしました。ちなみに pcfフォントを指定していますが、見た感じは綺麗だと個人的には思っているので納得してます。

2015年4月29日水曜日

もう知っていると思いますが…

フォント定義ファイルの書き換えを紹介していますが、システムファイルを書き換えると OTA で新バージョンの Android が降ってきてもアップデート出来ないので注意してくださいね。

もちろん sideload も失敗します。

2015年3月16日月曜日

Android 5.1 従来のフォントの変更方法では不十分だった。のでやり直し。

前回と同じ方法でやったのですが。句読点が半角になっていたのでその修正版です。当然の事ながら、自己責任でお願いします/。私の環境ではこれでシステム言語を英語にしえても日本語フォントが表示出来る要になってます。

変更箇所はボールド体で表現したのですが見にくかったら連絡ください。
2015-03-17 間違ったものを記載していたので更新しています。

まずは fonts.xml

<?xml version="1.0" encoding="utf-8"?>
<!--
    NOTE: this is the newer (L) version of the system font configuration,
    supporting richer weight selection. Some apps will expect the older
    version, so please keep system_fonts.xml and fallback_fonts.xml in sync
    with any changes, even though framework will only read this file.

    All fonts withohut names are added to the default list. Fonts are chosen
    based on a match: full BCP-47 language tag including script, then just
    language, and finally order (the first font containing the glyph).

    Order of appearance is also the tiebreaker for weight matching. This is
    the reason why the 900 weights of Roboto precede the 700 weights - we
    prefer the former when an 800 weight is requested. Since bold spans
    effectively add 300 to the weight, this ensures that 900 is the bold
    paired with the 500 weight, ensuring adequate contrast.
-->
<familyset version="22">
    <!-- first font is default -->
    <family name="sans-serif">
        <font weight="100" style="normal">Roboto-Thin.ttf</font>
        <font weight="100" style="italic">Roboto-ThinItalic.ttf</font>
        <font weight="300" style="normal">Roboto-Light.ttf</font>
        <font weight="300" style="italic">Roboto-LightItalic.ttf</font>
        <font weight="400" style="normal">Roboto-Regular.ttf</font>
        <font weight="400" style="italic">Roboto-Italic.ttf</font>
        <font weight="500" style="normal">Roboto-Medium.ttf</font>
        <font weight="500" style="italic">Roboto-MediumItalic.ttf</font>
        <font weight="900" style="normal">Roboto-Black.ttf</font>
        <font weight="900" style="italic">Roboto-BlackItalic.ttf</font>
        <font weight="700" style="normal">Roboto-Bold.ttf</font>
        <font weight="700" style="italic">Roboto-BoldItalic.ttf</font>
    </family>

    <!-- Note that aliases must come after the fonts they reference. -->
    <alias name="sans-serif-thin" to="sans-serif" weight="100" />
    <alias name="sans-serif-light" to="sans-serif" weight="300" />
    <alias name="sans-serif-medium" to="sans-serif" weight="500" />
    <alias name="sans-serif-black" to="sans-serif" weight="900" />
    <alias name="arial" to="sans-serif" />
    <alias name="helvetica" to="sans-serif" />
    <alias name="tahoma" to="sans-serif" />
    <alias name="verdana" to="sans-serif" />

    <family name="sans-serif-condensed">
        <font weight="300" style="normal">RobotoCondensed-Light.ttf</font>
        <font weight="300" style="italic">RobotoCondensed-LightItalic.ttf</font>
        <font weight="400" style="normal">RobotoCondensed-Regular.ttf</font>
        <font weight="400" style="italic">RobotoCondensed-Italic.ttf</font>
        <font weight="700" style="normal">RobotoCondensed-Bold.ttf</font>
        <font weight="700" style="italic">RobotoCondensed-BoldItalic.ttf</font>
    </family>
    <alias name="sans-serif-condensed-light" to="sans-serif-condensed" weight="300" />

    <family name="serif">
        <font weight="400" style="normal">NotoSerif-Regular.ttf</font>
        <font weight="700" style="normal">NotoSerif-Bold.ttf</font>
        <font weight="400" style="italic">NotoSerif-Italic.ttf</font>
        <font weight="700" style="italic">NotoSerif-BoldItalic.ttf</font>
    </family>
    <alias name="times" to="serif" />
    <alias name="times new roman" to="serif" />
    <alias name="palatino" to="serif" />
    <alias name="georgia" to="serif" />
    <alias name="baskerville" to="serif" />
    <alias name="goudy" to="serif" />
    <alias name="fantasy" to="serif" />
    <alias name="ITC Stone Serif" to="serif" />

    <family name="monospace">
        <font weight="400" style="normal">DroidSansMono.ttf</font>
    </family>
    <alias name="sans-serif-monospace" to="monospace" />
    <alias name="monaco" to="monospace" />

    <family name="serif-monospace">
        <font weight="400" style="normal">CutiveMono.ttf</font>
    </family>
    <alias name="courier" to="serif-monospace" />
    <alias name="courier new" to="serif-monospace" />

    <family name="casual">
        <font weight="400" style="normal">ComingSoon.ttf</font>
    </family>

    <family name="cursive">
        <font weight="400" style="normal">DancingScript-Regular.ttf</font>
        <font weight="700" style="normal">DancingScript-Bold.ttf</font>
    </family>

    <family name="sans-serif-smallcaps">
        <font weight="400" style="normal">CarroisGothicSC-Regular.ttf</font>
    </family>

    <!-- fallback fonts -->
    <family variant="elegant">
        <font weight="400" style="normal">NotoNaskh-Regular.ttf</font>
        <font weight="700" style="normal">NotoNaskh-Bold.ttf</font>
    </family>
    <family variant="compact">
        <font weight="400" style="normal">NotoNaskhUI-Regular.ttf</font>
        <font weight="700" style="normal">NotoNaskhUI-Bold.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansEthiopic-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansEthiopic-Bold.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansHebrew-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansHebrew-Bold.ttf</font>
    </family>
    <family variant="elegant">
        <font weight="400" style="normal">NotoSansThai-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansThai-Bold.ttf</font>
    </family>
    <family variant="compact">
        <font weight="400" style="normal">NotoSansThaiUI-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansThaiUI-Bold.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansArmenian-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansArmenian-Bold.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansGeorgian-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansGeorgian-Bold.ttf</font>
    </family>
    <family variant="elegant">
        <font weight="400" style="normal">NotoSansDevanagari-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansDevanagari-Bold.ttf</font>
    </family>
    <family variant="compact">
        <font weight="400" style="normal">NotoSansDevanagariUI-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansDevanagariUI-Bold.ttf</font>
    </family>
    <!-- Gujarati should come after Devanagari -->
    <family variant="elegant">
        <font weight="400" style="normal">NotoSansGujarati-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansGujarati-Bold.ttf</font>
    </family>
    <family variant="compact">
        <font weight="400" style="normal">NotoSansGujaratiUI-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansGujaratiUI-Bold.ttf</font>
    </family>
    <!-- Gurmukhi should come after Devanagari -->
    <family variant="elegant">
        <font weight="400" style="normal">NotoSansGurmukhi-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansGurmukhi-Bold.ttf</font>
    </family>
    <family variant="compact">
        <font weight="400" style="normal">NotoSansGurmukhiUI-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansGurmukhiUI-Bold.ttf</font>
    </family>
    <family variant="elegant">
        <font weight="400" style="normal">NotoSansTamil-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansTamil-Bold.ttf</font>
    </family>
    <family variant="compact">
        <font weight="400" style="normal">NotoSansTamilUI-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansTamilUI-Bold.ttf</font>
    </family>
    <family variant="elegant">
        <font weight="400" style="normal">NotoSansMalayalam-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansMalayalam-Bold.ttf</font>
    </family>
    <family variant="compact">
        <font weight="400" style="normal">NotoSansMalayalamUI-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansMalayalamUI-Bold.ttf</font>
    </family>
    <family variant="elegant">
        <font weight="400" style="normal">NotoSansBengali-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansBengali-Bold.ttf</font>
    </family>
    <family variant="compact">
        <font weight="400" style="normal">NotoSansBengaliUI-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansBengaliUI-Bold.ttf</font>
    </family>
    <family variant="elegant">
        <font weight="400" style="normal">NotoSansTelugu-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansTelugu-Bold.ttf</font>
    </family>
    <family variant="compact">
        <font weight="400" style="normal">NotoSansTeluguUI-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansTeluguUI-Bold.ttf</font>
    </family>
    <family variant="elegant">
        <font weight="400" style="normal">NotoSansKannada-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansKannada-Bold.ttf</font>
    </family>
    <family variant="compact">
        <font weight="400" style="normal">NotoSansKannadaUI-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansKannadaUI-Bold.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansSinhala-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansSinhala-Bold.ttf</font>
    </family>
    <family variant="elegant">
        <font weight="400" style="normal">NotoSansKhmer-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansKhmer-Bold.ttf</font>
    </family>
    <family variant="compact">
        <font weight="400" style="normal">NotoSansKhmerUI-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansKhmerUI-Bold.ttf</font>
    </family>
    <family variant="elegant">
        <font weight="400" style="normal">NotoSansLao-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansLao-Bold.ttf</font>
    </family>
    <family variant="compact">
        <font weight="400" style="normal">NotoSansLaoUI-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansLaoUI-Bold.ttf</font>
    </family>
    <family variant="elegant">
        <font weight="400" style="normal">NotoSansMyanmar-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansMyanmar-Bold.ttf</font>
    </family>
    <family variant="compact">
        <font weight="400" style="normal">NotoSansMyanmarUI-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansMyanmarUI-Bold.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansThaana-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansThaana-Bold.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansCham-Regular.ttf</font>
        <font weight="700" style="normal">NotoSansCham-Bold.ttf</font>
    </family>
    <family lang="ja">
        <font weight="400" style="normal">NotoSansJP-Regular.otf</font>
    </family>
    <family lang="ja">
        <font weight="400" style="normal">MTLmr3m.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansBalinese-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansBatak-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansBuginese-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansBuhid-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansCanadianAboriginal-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansCherokee-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansCoptic-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansGlagolitic-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansHanunoo-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansJavanese-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansKayahLi-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansLepcha-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansLimbu-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansMeeteiMayek-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansOlChiki-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansRejang-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansSaurashtra-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansSundanese-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansSylotiNagri-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansTagbanwa-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansTaiLe-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansTaiTham-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansTaiViet-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansTifinagh-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansYi-Regular.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">Lohit-Odia.ttf</font>
    </family>
    <family lang="zh-Hans">
        <font weight="400" style="normal">NotoSansHans-Regular.otf</font>
    </family>
    <family lang="zh-Hant">
        <font weight="400" style="normal">NotoSansHant-Regular.otf</font>
    </family>
    <family lang="ko">
        <font weight="400" style="normal">NotoSansKR-Regular.otf</font>
    </family>
    <family>
        <font weight="400" style="normal">NanumGothic.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoSansSymbols-Regular-Subsetted.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">NotoColorEmoji.ttf</font>
    </family>
    <family>
        <font weight="400" style="normal">DroidSansFallback.ttf</font>
    </family>
</familyset>

次に fallback_fonts.xml を編集します。

<?xml version="1.0" encoding="utf-8"?>
<!--
    NOTE: this file is the legacy format, for compatibility with apps. The new,
    more flexible format is fonts.xml. Please keep the two in sync until the legacy
    format can be fully removed.

    Fallback Fonts

    This file specifies the fonts, and the priority order, that will be searched for any
    glyphs not handled by the default fonts specified in /system/etc/system_fonts.xml.
    Each entry consists of a family tag and a list of files (file names) which support that
    family. The fonts for each family are listed in the order of the styles that they
    handle (the order is: regular, bold, italic, and bold-italic). The order in which the
    families are listed in this file represents the order in which these fallback fonts
    will be searched for glyphs that are not supported by the default system fonts (which are
    found in /system/etc/system_fonts.xml).

    Note that there is not nameset for fallback fonts, unlike the fonts specified in
    system_fonts.xml. The ability to support specific names in fallback fonts may be supported
    in the future. For now, the lack of files entries here is an indicator to the system that
    these are fallback fonts, instead of default named system fonts.

    There is another optional file in /vendor/etc/fallback_fonts.xml. That file can be used to
    provide references to other font families that should be used in addition to the default
    fallback fonts. That file can also specify the order in which the fallback fonts should be
    searched, to ensure that a vendor-provided font will be used before another fallback font
    which happens to handle the same glyph.

    Han languages (Chinese, Japanese, and Korean) share a common range of unicode characters;
    their ordering in the fallback or vendor files gives priority to the first in the list.
    Language-specific ordering can be configured by adding a BCP 47-style "lang" attribute to
    a "file" element; fonts matching the language of text being drawn will be prioritised over
    all others.
-->
<familyset>
    <family>
        <fileset>
            <file variant="elegant">NotoNaskh-Regular.ttf</file>
            <file variant="elegant">NotoNaskh-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="compact">NotoNaskhUI-Regular.ttf</file>
            <file variant="compact">NotoNaskhUI-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansEthiopic-Regular.ttf</file>
            <file>NotoSansEthiopic-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansHebrew-Regular.ttf</file>
            <file>NotoSansHebrew-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="elegant">NotoSansThai-Regular.ttf</file>
            <file variant="elegant">NotoSansThai-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="compact">NotoSansThaiUI-Regular.ttf</file>
            <file variant="compact">NotoSansThaiUI-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansArmenian-Regular.ttf</file>
            <file>NotoSansArmenian-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansGeorgian-Regular.ttf</file>
            <file>NotoSansGeorgian-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="elegant">NotoSansDevanagari-Regular.ttf</file>
            <file variant="elegant">NotoSansDevanagari-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="compact">NotoSansDevanagariUI-Regular.ttf</file>
            <file variant="compact">NotoSansDevanagariUI-Bold.ttf</file>
        </fileset>
    </family>
    <!-- Gujarati should come after Devanagari -->
    <family>
        <fileset>
            <file variant="elegant">NotoSansGujarati-Regular.ttf</file>
            <file variant="elegant">NotoSansGujarati-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="compact">NotoSansGujaratiUI-Regular.ttf</file>
            <file variant="compact">NotoSansGujaratiUI-Bold.ttf</file>
        </fileset>
    </family>
    <!-- Gurmukhi should come after Devanagari -->
    <family>
        <fileset>
            <file variant="elegant">NotoSansGurmukhi-Regular.ttf</file>
            <file variant="elegant">NotoSansGurmukhi-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="compact">NotoSansGurmukhiUI-Regular.ttf</file>
            <file variant="compact">NotoSansGurmukhiUI-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="elegant">NotoSansTamil-Regular.ttf</file>
            <file variant="elegant">NotoSansTamil-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="compact">NotoSansTamilUI-Regular.ttf</file>
            <file variant="compact">NotoSansTamilUI-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="elegant">NotoSansMalayalam-Regular.ttf</file>
            <file variant="elegant">NotoSansMalayalam-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="compact">NotoSansMalayalamUI-Regular.ttf</file>
            <file variant="compact">NotoSansMalayalamUI-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="elegant">NotoSansBengali-Regular.ttf</file>
            <file variant="elegant">NotoSansBengali-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="compact">NotoSansBengaliUI-Regular.ttf</file>
            <file variant="compact">NotoSansBengaliUI-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="elegant">NotoSansTelugu-Regular.ttf</file>
            <file variant="elegant">NotoSansTelugu-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="compact">NotoSansTeluguUI-Regular.ttf</file>
            <file variant="compact">NotoSansTeluguUI-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="elegant">NotoSansKannada-Regular.ttf</file>
            <file variant="elegant">NotoSansKannada-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="compact">NotoSansKannadaUI-Regular.ttf</file>
            <file variant="compact">NotoSansKannadaUI-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansSinhala-Regular.ttf</file>
            <file>NotoSansSinhala-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="elegant">NotoSansKhmer-Regular.ttf</file>
            <file variant="elegant">NotoSansKhmer-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="compact">NotoSansKhmerUI-Regular.ttf</file>
            <file variant="compact">NotoSansKhmerUI-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="elegant">NotoSansLao-Regular.ttf</file>
            <file variant="elegant">NotoSansLao-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="compact">NotoSansLaoUI-Regular.ttf</file>
            <file variant="compact">NotoSansLaoUI-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="elegant">NotoSansMyanmar-Regular.ttf</file>
            <file variant="elegant">NotoSansMyanmar-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file variant="compact">NotoSansMyanmarUI-Regular.ttf</file>
            <file variant="compact">NotoSansMyanmarUI-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file lang="ja">NotoSansJP-Regular.otf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file lang="ja">MTLmr3m.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansThaana-Regular.ttf</file>
            <file>NotoSansThaana-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansCham-Regular.ttf</file>
            <file>NotoSansCham-Bold.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansBalinese-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansBatak-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansBuginese-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansBuhid-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansCanadianAboriginal-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansCherokee-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansCoptic-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansGlagolitic-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansHanunoo-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansJavanese-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansKayahLi-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansLepcha-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansLimbu-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansMeeteiMayek-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansOlChiki-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansRejang-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansSaurashtra-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansSundanese-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansSylotiNagri-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansTagbanwa-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansTaiLe-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansTaiTham-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansTaiViet-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansTifinagh-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansYi-Regular.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>Lohit-Odia.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file lang="zh-Hans">NotoSansHans-Regular.otf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file lang="zh-Hant">NotoSansHant-Regular.otf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file lang="ko">NotoSansKR-Regular.otf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NanumGothic.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoSansSymbols-Regular-Subsetted.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>NotoColorEmoji.ttf</file>
        </fileset>
    </family>
    <family>
        <fileset>
            <file>DroidSansFallback.ttf</file>
        </fileset>
    </family>
    <!-- Note: complex scripts (i.e. those requiring shaping in Harfbuzz) have
         a cumulative limit of 64k glyphs. Thus, if they are placed after the
         large fonts such as DroidSansFallback, they are likely to render
         incorrectly. Please use caution when putting fonts toward the end of
         the list.
    -->
</familyset>

2015年3月14日土曜日

続 Android 5.1 でのフォント、中華フォントだと誤解って文字が変だよね。

Android 5.1 の OTA の場所もわかったので sideload でアップデートしようとしたら、ファイルが書き換えてあるから無理っていわれたのでファクトリーイメージを焼きました。

お馴染みの中華フォントより日本語フォントを優先的に表示するようにしたのですが、ふとしたことから fonts.xml の変更だけでいいのではないか?と思ってやってみたら、概ね問題なかったのですが一部のアプリ(確認したアプリだと OneNote)でひらがなが表示出来ない状態になったので、いまは素直に fonts.xml と fallback_fonts.xml を書き換えて Android 5.1 ライフを満喫しています。

2014年11月14日金曜日

Android 5.0 Lollipop で中華フォントからおさらば

Nexus 5 ユーザなので放っておいたら OTA でアップデートされるんですが、待てなくてファクトリーイメージを適用しました。で、言語設定で「日本語」じゃなく「English」を使っていると「真」とか一部、ぞくに言われる中華フォントの書体で表示されるんですよ。

今回はこれを修正します。タイトルと違って実際はフォントを定義してある XML ファイルの編集です。

デバイスの電源を落してボリュームボタンを押しながら電源ボタンを押しブートローダを起動します。起動したら PC と USB で接続してください。もし USB で接続してデバイスマネージャで認識していないようなら Android SDK をダウンロードしてドライバを入手しましょう。この先で使う fastboot.exe も含まれています。

cmd.exe を起動して fastboot.exe がある android-sdk-windows-platform\platform-tools に移動します。


  1. Bootloader のロック解除 fastboot.exe oem unlock
  2. 端末に本当に解除するか、という画面が表示されるのでボリュームキーの上を押して「YES」を選択した状態で、電源ボタンを押します。このロック解除でユーザデータは消えてしまいます。
  3. openrecovery-twrp-2.8.l10-hammerhead.img でブートします。
    fastboot.exe boot openrecovery-twrp-2.8.l10-hammerhead.img
  4. カスタムブート画面で起動してくるので「mount」をタッチします。
  5. 「system」にチェックを入れます。
  6. adb pull /system/etc/fonts.xml
  7. adb pull /system/etc/fallback_fonts.xml
  8. adb push fonts.xml /system/etc/fonts.xml
  9. adb push fallback_fonts.xml /system/etc/fallback_fonts.xml
  10. 念の為に「system」を unmount しておく
  11. メニューから再起動
  12. 終り
6, 7 で取り出したファイルをエディタで次の様に編集します。編集した箇所は太字で表記してます。

以前掲載していた方法では不十分で一部の文字で幅は半角になるのでこちらを参照して下さい。

2014年10月29日水曜日

綺麗なフォント Ricty

皆さんターミナルエミュレータのフォントって何にしてますか?

私はどれもしっくりこなくてちょくちょく変えてきたのですが
これぞ決定版みたいなのがありました。それは Ricty という
プログラミング用フォントです。

サイトから特徴を引用すると
  • ラテン文字には Raph Levien 氏の Inconsolata が適用されます。
  • それ以外の文字には Migu 1M が適用されます。美しい M+ とロバストな IPA、そして、itouhiro 氏が改良された視認性の高い日本語文字 (半濁音など) が使用できます。
  • 半角文字と全角文字の横幅の比が 1:2 に調整されています。
  • 全角スペースが可視化されます。
  • 全角のコンマ、ピリオド、コロン、セミコロンが半角のそれぞれに対して差別化されています。
  • en ダッシュ、em ダッシュが破断線のようになります (LaTeX での入力ミス防止のため)。
と素晴らしい特徴を備えています。
では早速 Gentoo Linux でインストールしましょう。私の環境ではまだ stable になってないので /etc/portage/package.accept_keywords に

media-fonts/ricty ~amd64

と記述しておきます。他にも package.keywords にキーワードを追加する必要があるかもしれませんが上記を同じように追加してください。では、emerge を走らせます。

emerge ricty

とこれだけで終わりです。あとは主にターミナルエミュレータになると思いますが
アプリケーションのフォント設定をして楽しみましょう。

追記: Ricty は可読性を重視するために全角スペースを判断できるようにしてありますが
これはプログラマでない場合はちょっと気になるものになるかもしれません。事実私が
そうでした。

ということで ebuild ファイルを書き換えて再度 emerge します。
--- ricty-3.2.0.ebuild.orig 2014-10-29 03:44:22.556996411 +0900
+++ ricty-3.2.0.ebuild 2014-10-29 03:44:55.358324005 +0900
@@ -31,7 +31,7 @@
 RESTRICT="strip binchecks"

 src_compile() {
- sh ricty_generator.sh \
+ sh ricty_generator.sh -z\
  "${EPREFIX}/usr/share/fonts/inconsolata/Inconsolata.otf" \
  "${EPREFIX}/usr/share/fonts/mix-mplus-ipa/migu-1m-regular.ttf" \
  "${EPREFIX}/usr/share/fonts/mix-mplus-ipa/migu-1m-bold.ttf" || die



変更分との diff の結果です。フォント生成スクリプトに -z オプションを追加している
だけです。ただこのまま emerge ricty とやっても失敗するので (ファイルが変更されているため) 新しいダイジェスト値を求めます。

ebuild /usr/portage/media-fonts/ricty/ricty-3.2.0.ebuild digest

これで新しいダイジェスト値が計算されるのであとは普通に emerge ricty とするだけです。
では、美しいフォント生活をお楽しみください!

2014年10月27日月曜日

rxvt-nicodeの設定

私の rxvt-unicode の設定です。

URxvt*termName: xterm-256color
URxvt*depth: 24
URxvt*saveLIne: 300000
URxvt*geometry: 120x35
URxvt*perl-ext-common: default,matcher,clipboard-osc
!URxvt*perl-ext-common: default,matcher,clipboard-osc,xim-onthespot
URxvt*inputMethod: uim
URxvt*imLocale: en_US.UTF-8
!URxvt*preeditType: OnTheSpot
!URxvt*preeditType: OverTheSpot
URxvt*url-launcher: chromium
URxvt*matcher*button: 1 
URxvt*foreground: #DCDCCD
URxvt*background: #2C2C2C
URxvt*color0: #3F3F3F
URxvt*color1: #705050
URXvt*color2: #60B48A
URxvt*color3: #DFAF8F
URxvt*color4: #9AB9D7
URxvt*color5: #DC8CC4
URxvt*color6: #8CD1D3
URxvt*color7: #DCDCCD
URxvt*color8: #709080
URxvt*color9: #DCA3A3
URxvt*color10: #72D5A2
URxvt*color11: #F0DFAF
URxvt*color12: #94C0F3
URxvt*color13: #EC93D5
URxvt*color14: #93E1E3
URxvt*color15: #FFFFFF
URxvt*lefterSpace: -1 
URxvt.font: xft:Ricty:size=12:antialiase=true
URxvt.boldFont: xft:Ricty:bold:size=12:antialiase=true
URxvt.italicFont: xft:Ricty:italic:size=12:antialiase=true
URxvt.bolditalicFont: xft:Ricty:bold:italic:size=12:antialiase=true
!URxvt.imFont: 7x14
これで快適な日本入力が出きています。インラインで日本語変換するには Unicode フォントを利用しなくてもインストールしてないと -pt root で起動しろと言われてしまいます。パッケージ名忘れたので思い出したら書きます。