Browse Source

Pull request #4789: REPORT-54545 富文本默认字体本地化问题

Merge in DESIGN/design from ~HADES/design:release/10.0 to release/10.0

* commit '7e105b9f160bcfb810525f1b8bcec6cf56441aba':
  REPORT-54545 富文本默认字体本地化问题
zheng-1641779399395
Hades 4 years ago
parent
commit
6e4fc1ed75
  1. 12
      designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java

12
designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java

@ -5,6 +5,7 @@ package com.fr.design.cell.editor;
import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.Utils;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
@ -61,6 +62,11 @@ public class RichTextToolBar extends BasicPane{
private static final Dimension BUTTON_SIZE = new Dimension(24, 20);
/**
* 富文本字体下拉框默认首选字体 非设计器UI界面字体
*/
private static final FRFont DEFAULT_FONT = FRContext.getDefaultValues().getFRFont().applySize(13);
private UIComboBox fontNameComboBox;
private UIComboBox fontSizeComboBox;
private UIToggleButton bold;
@ -153,11 +159,11 @@ public class RichTextToolBar extends BasicPane{
}
private void bindListener(){
FRFont defaultFont = (this.textPane != null) ? FRFont.getInstance(this.textPane.getFont()) : RichTextPane.DEFAUL_FONT;
// 这里下拉框默认选中字体 不由UI界面字体决定 两套不同体系
fontNameComboBox.addItemListener(fontNameItemListener);
fontNameComboBox.setSelectedItem(defaultFont.getFamily());
fontNameComboBox.setSelectedItem(DEFAULT_FONT.getFamily());
fontSizeComboBox.addItemListener(fontSizeItemListener);
fontSizeComboBox.setSelectedItem(scaleDown(defaultFont.getSize()));
fontSizeComboBox.setSelectedItem(scaleDown(DEFAULT_FONT.getSize()));
bold.addActionListener(blodChangeAction);
italic.addActionListener(itaChangeAction);

Loading…
Cancel
Save