Feeling

              三人行,必有我?guī)熝?/p>

             ::  :: 新隨筆 :: 聯系 ::  :: 管理 ::
            185 隨筆 :: 0 文章 :: 392 評論 :: 0 Trackbacks

          Eclipse下的插件開發(fā)如果需要用到什么字體或其他的工具時,盡量避免使用AWT GraphicsEnvironment ,這會導致Vista Aero效果暫停工作。如果有需要得到Font字體列表的話,可以使用SWT的FontList拿到:

           1    public static String[] getSystemFontNames( Comparator comparator )
           2    {
           3        FontData[] fontDatas = (FontData [])Display.getCurrent( ).getFontList( nullfalse );
           4        SortedSet set = new TreeSet(comparator);
           5        for(int i=0;i<fontDatas.length;i++){
           6            set.add( fontDatas[i].getName( ) );
           7        }

           8        fontDatas = ( FontData [] )Display.getCurrent( ).getFontList( nulltrue );
           9        for(int i=0;i<fontDatas.length;i++){
          10            set.add( fontDatas[i].getName( ));
          11        }

          12        String[] fonts = new String[set.size( )];
          13        set.toArray( fonts );
          14        return fonts;
          15    }

          /**
           * Returns <code>FontData</code> objects which describe
           * the fonts that match the given arguments. If the
           * <code>faceName</code> is null, all fonts will be returned.
           *
           * 
          @param faceName the name of the font to look for, or null
           * 
          @param scalable if true only scalable fonts are returned, otherwise only non-scalable fonts are returned.
           * 
          @return the matching font data
           *
           * 
          @exception SWTException <ul>
           *    <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
           * </ul>
           
          */

          public FontData [] getFontList (String faceName, boolean scalable)

          只有注冊用戶登錄后才能發(fā)表評論。


          網站導航:
           
          GitHub |  開源中國社區(qū) |  maven倉庫 |  文件格式轉換 
          主站蜘蛛池模板: 许昌市| 砀山县| 固原市| 淮北市| 博湖县| 沙湾县| 建湖县| 周口市| 阜康市| 金昌市| 谢通门县| 淮阳县| 博乐市| 遵化市| 阿图什市| 丰顺县| 白河县| 健康| 常熟市| 陵川县| 榆林市| 长寿区| 潼南县| 邳州市| 渝北区| 新巴尔虎右旗| 彭州市| 安平县| 香格里拉县| 新郑市| 曲周县| 周口市| 天全县| 明溪县| 轮台县| 花莲市| 保定市| 芮城县| 巨鹿县| 万全县| 卢龙县|