mgs941210
mgs941210
2017-03-23 02:42

javaFX字体加粗/斜体都不能使用

2
  • java

fontFamilyStr = FontUtil.getFxFontName(fontFamilyStr.trim());
switch(fontStyle){
case 0://regular
font=Font.font(fontFamilyStr, FontPosture.REGULAR, fontSize);
break;
case 1://bold
font=Font.font(fontFamilyStr, FontWeight.BOLD, fontSize);
break;
case 2://italic
font=Font.font(fontFamilyStr, FontPosture.ITALIC, fontSize);
break;
case 3://bold_italic
font=Font.font(fontFamilyStr, FontWeight.BOLD, FontPosture.ITALIC,fontSize);
break;
default:
break;
}
return font;

图片说明

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答