EclipseからSwingアプリを起動すると、フォント構成ファイルの情報が無視される(2)
解析の途中結果。フォント構成ファイルが無視されているわけではないらしい。
import java.awt.Font; import sun.font.Font2D; import sun.font.FontManager; public class FontManagerTest { public static void main(String[] args) { Font2D f2d = FontManager.findFont2D("monospace", Font.BOLD, FontManager.LOGICAL_FALLBACK); System.out.println(f2d); } }
- 普通に起動したとき
** Composite Font: Family=Dialog Name=Dialog.bold style=1 Slot[0]=** TrueType Font: Family=Arial Name=Arial Bold style=1 fileName=C:\WINDOWS\Fonts\ARIALBD.TTF Slot[1]=** TrueType Font: Family=IPAGothicNB Name=IPAGothicNB style=0 fileName=C:\WINDOWS\Fonts\ipagNB.ttf Slot[2]=** TrueType Font: Family=Wingdings Name=Wingdings style=0 fileName=C:\WINDOWS\Fonts\WINGDING.TTF (中略) Slot[8]=** TrueType Font: Family=Lucida Sans Name=Lucida Sans Regular style=0 fileName=C:\Program Files\Java\jdk1.6.0_12\jre\lib\fonts\LucidaSansRegular.ttf Slot[9]=** TrueType Font: Family=Gulim Name=Gulim style=0 fileName=C:\WINDOWS\Fonts\gulim.TTC
- Eclipseから起動したとき
** Composite Font: Family=Dialog Name=Dialog.bold style=1 Slot[0]=** TrueType Font: Family=Arial Name=Arial Bold style=1 fileName=C:\WINDOWS\Fonts\ARIALBD.TTF Slot[1]=** TrueType Font: Family=Wingdings Name=Wingdings style=0 fileName=C:\WINDOWS\Fonts\WINGDING.TTF (中略) Slot[7]=** TrueType Font: Family=Lucida Sans Name=Lucida Sans Regular style=0 fileName=C:\Program Files\Java\jdk1.6.0_12\jre\lib\fonts\LucidaSansRegular.ttf Slot[8]=** TrueType Font: Family=IPAGothicNB Name=IPAGothicNB style=0 fileName=C:\WINDOWS\Fonts\ipagNB.ttf Slot[9]=** TrueType Font: Family=Gulim Name=Gulim style=0 fileName=C:\WINDOWS\Fonts\gulim.TTC
何故かフォントをルックアップする順序が狂ってる……?