Change just the font size in SWT

前端 未结 2 1171
闹比i
闹比i 2020-12-16 11:00

I need to use a larger font for one of the labels.

label.setFont( new Font(display,\"Arial\", 14, SWT.BOLD ) );

but obviously Arial is not

2条回答
  •  半阙折子戏
    2020-12-16 11:36

    I believe you could do something like

    FontData[] fD = label.getFont().getFontData();
    fD[0].setHeight(16);
    label.setFont( new Font(display,fD[0]));
    

    As long as no more than one font is returned, that should work.

提交回复
热议问题