FreeBSD Daily Topics

2009年3月2日FreeBSD Java SE 6でIPAフォントを使うための設定、NetBeans IDE 6.5にフォントの設定を反映させる方法

tips

How to use IPA Japanese font on Java SE 6

ports - Diablo JDK16やJDK16、OpenJDK6には日本語フォントとしてIPAフォントを使うという設定がデフォルトでは含まれていないため、それ以外のフォントが日本語の表示に使われたり、場合によっては日本語部分が□□□のように豆腐として表示されることがあります。これを回避するにはIPAフォント(japanese/ipa-ttfonts)をインストールして設定をおこなう必要があります。

  • IPAフォント(japanese/ipa-ttfont⁠⁠-高品位日本語フォント(ゴシック、プロポーショナルゴシック、プロポーショナルUIゴシック、明朝、プロポーショナル明朝)
  • Diablo JDK16(java/diablo-jdk16⁠⁠-バイナリ配付版FreeBSD JDK1.6
  • JDK16(java/jdk16⁠⁠-ソースからビルドするFreeBSD JDK1.6
  • OpenJDK6(java/openjdk6⁠⁠-FreeBSD OpenJDK6

IPAフォントと使いたいJava SE 6のJDKをインストールしたら、次の設定ファイルをそれぞれのパスにコピーします。

リスト fontconfig.properties(FreeBSD OpenJDK6に含まれているfontconfig.properties.srcをベースにIPAフォントの設定を追加したもの)
# 
# Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.  Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#

# Version

# Uses Fedora Core 6 fonts and file paths.
version=1

# Component Font Mappings

dialog.plain.latin-1=DejaVu LGC Sans
dialog.plain.japanese=IPA UIGothic
dialog.plain.korean=Baekmuk Gulim
dialog.plain.chinese-big5=AR PL ShanHeiSun Uni
dialog.plain.chinese-gb18030=AR PL ShanHeiSun Uni

dialog.bold.latin-1=DejaVu LGC Sans Bold
dialog.bold.japanese=IPA UIGothic
dialog.bold.korean=Baekmuk Gulim
dialog.bold.chinese-big5=AR PL ShanHeiSun Uni
dialog.bold.chinese-gb18030=AR PL ShanHeiSun Uni

dialog.italic.latin-1=DejaVu LGC Sans Oblique
dialog.italic.japanese=IPA UIGothic
dialog.italic.korean=Baekmuk Gulim
dialog.italic.chinese-big5=AR PL ShanHeiSun Uni
dialog.italic.chinese-gb18030=AR PL ShanHeiSun Uni

dialog.bolditalic.latin-1=DejaVu LGC Sans Bold Oblique
dialog.bolditalic.japanese=IPA UIGothic
dialog.bolditalic.korean=Baekmuk Gulim
dialog.bolditalic.chinese-big5=AR PL ShanHeiSun Uni
dialog.bolditalic.chinese-gb18030=AR PL ShanHeiSun Uni


sansserif.plain.latin-1=DejaVu LGC Sans
sansserif.plain.japanese=IPA PGothic
sansserif.plain.korean=Baekmuk Gulim
sansserif.plain.chinese-big5=AR PL ShanHeiSun Uni
sansserif.plain.chinese-gb18030=AR PL ShanHeiSun Uni

sansserif.bold.latin-1=DejaVu LGC Sans Bold
sansserif.bold.japanese=IPA PGothic
sansserif.bold.korean=Baekmuk Gulim
sansserif.bold.chinese-big5=AR PL ShanHeiSun Uni
sansserif.bold.chinese-gb18030=AR PL ShanHeiSun Uni

sansserif.italic.latin-1=DejaVu LGC Sans Oblique
sansserif.italic.japanese=IPA PGothic
sansserif.italic.korean=Baekmuk Gulim
sansserif.italic.chinese-big5=AR PL ShanHeiSun Uni
sansserif.italic.chinese-gb18030=AR PL ShanHeiSun Uni

sansserif.bolditalic.latin-1=DejaVu LGC Sans Bold Oblique
sansserif.bolditalic.japanese=IPA PGothic
sansserif.bolditalic.korean=Baekmuk Gulim
sansserif.bolditalic.chinese-big5=AR PL ShanHeiSun Uni
sansserif.bolditalic.chinese-gb18030=AR PL ShanHeiSun Uni


serif.plain.latin-1=DejaVu LGC Serif
serif.plain.japanese=IPA PMincho
serif.plain.korean=Baekmuk Batang
serif.plain.chinese-big5=AR PL ZenKai Uni
serif.plain.chinese-gb18030=AR PL ZenKai Uni

serif.bold.latin-1=DejaVu LGC Serif Bold
serif.bold.japanese=IPA PMincho
serif.bold.korean=Baekmuk Batang
serif.bold.chinese-big5=AR PL ZenKai Uni
serif.bold.chinese-gb18030=AR PL ZenKai Uni

serif.italic.latin-1=DejaVu LGC Serif Oblique
serif.italic.japanese=IPA PMincho
serif.italic.korean=Baekmuk Batang
serif.italic.chinese-big5=AR PL ZenKai Uni
serif.italic.chinese-gb18030=AR PL ZenKai Uni

serif.bolditalic.latin-1=DejaVu LGC Serif Bold Oblique
serif.bolditalic.japanese=IPA PMincho
serif.bolditalic.korean=Baekmuk Batang
serif.bolditalic.chinese-big5=AR PL ZenKai Uni
serif.bolditalic.chinese-gb18030=AR PL ZenKai Uni


monospaced.plain.latin-1=DejaVu LGC Sans Mono
monospaced.plain.japanese=IPA Gothic
monospaced.plain.korean=Baekmuk Gulim
monospaced.plain.chinese-big5=AR PL ShanHeiSun Uni
monospaced.plain.chinese-gb18030=AR PL ShanHeiSun Uni

monospaced.bold.latin-1=DejaVu LGC Sans Mono Bold
monospaced.bold.japanese=IPA Gothic
monospaced.bold.korean=Baekmuk Gulim
monospaced.bold.chinese-big5=AR PL ShanHeiSun Uni
monospaced.bold.chinese-gb18030=AR PL ShanHeiSun Uni

monospaced.italic.latin-1=DejaVu LGC Sans Mono Oblique
monospaced.italic.japanese=IPA Gothic
monospaced.italic.korean=Baekmuk Gulim
monospaced.italic.chinese-big5=AR PL ShanHeiSun Uni
monospaced.italic.chinese-gb18030=AR PL ShanHeiSun Uni

monospaced.bolditalic.latin-1=DejaVu LGC Sans Mono Bold Oblique
monospaced.bolditalic.japanese=IPA Gothic
monospaced.bolditalic.korean=Baekmuk Gulim
monospaced.bolditalic.chinese-big5=AR PL ShanHeiSun Uni
monospaced.bolditalic.chinese-gb18030=AR PL ShanHeiSun Uni


dialoginput.plain.latin-1=DejaVu LGC Sans Mono
dialoginput.plain.japanese=IPA UIGothic
dialoginput.plain.korean=Baekmuk Gulim
dialoginput.plain.chinese-big5=AR PL ShanHeiSun Uni
dialoginput.plain.chinese-gb18030=AR PL ShanHeiSun Uni

dialoginput.bold.latin-1=DejaVu LGC Sans Mono Bold
dialoginput.bold.japanese=IPA UIGothic
dialoginput.bold.korean=Baekmuk Gulim
dialoginput.bold.chinese-big5=AR PL ShanHeiSun Uni
dialoginput.bold.chinese-gb18030=AR PL ShanHeiSun Uni

dialoginput.italic.latin-1=DejaVu LGC Sans Mono Oblique
dialoginput.italic.japanese=IPA UIGothic
dialoginput.italic.korean=Baekmuk Gulim
dialoginput.italic.chinese-big5=AR PL ShanHeiSun Uni
dialoginput.italic.chinese-gb18030=AR PL ShanHeiSun Uni

dialoginput.bolditalic.latin-1=DejaVu LGC Sans Mono Bold Oblique
dialoginput.bolditalic.japanese=IPA UIGothic
dialoginput.bolditalic.korean=Baekmuk Gulim
dialoginput.bolditalic.chinese-big5=AR PL ShanHeiSun Uni
dialoginput.bolditalic.chinese-gb18030=AR PL ShanHeiSun Uni

# Search Sequences

sequence.allfonts=latin-1
sequence.allfonts.Big5=chinese-big5,latin-1
sequence.allfonts.x-euc-jp-bsd=japanese,latin-1
sequence.allfonts.EUC-KR=korean,latin-1
sequence.allfonts.GB18030=chinese-gb18030,latin-1
sequence.fallback=chinese-big5,chinese-gb18030,japanese,korean

# Font File Names

filename.DejaVu_LGC_Sans=/usr/share/fonts/dejavu-lgc/DejaVuLGCSans.ttf
filename.DejaVu_LGC_Sans_Bold=/usr/share/fonts/dejavu-lgc/DejaVuLGCSans-Bold.ttf
filename.DejaVu_LGC_Sans_Oblique=/usr/share/fonts/dejavu-lgc/DejaVuLGCSans-Oblique.ttf
filename.DejaVu_LGC_Sans_Bold_Oblique=/usr/share/fonts/dejavu-lgc/DejaVuLGCSans-BoldOblique.ttf

filename.

おすすめ記事

記事・ニュース一覧