import ascent, descent leading

This commit is contained in:
Jindra Petřík
2021-02-28 23:01:20 +01:00
parent 91c6a5df2c
commit 3ec8ab1f91
10 changed files with 160 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ import com.jpexs.decompiler.flash.tags.base.FontTag;
import com.jpexs.decompiler.flash.tags.font.CharacterRanges;
import com.jpexs.helpers.Helper;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
@@ -80,6 +81,8 @@ public class FontEmbedDialog extends AppDialog {
private final JCheckBox allCheckbox;
private final JCheckBox importAscentDescentLeadingCheckBox;
public Font getSelectedFont() {
if (ttfFileRadio.isSelected() && customFont != null) {
return customFont;
@@ -87,6 +90,10 @@ public class FontEmbedDialog extends AppDialog {
return ((FontFace) faceSelection.getSelectedItem()).font;
}
public boolean isImportAscentDescentLeading() {
return importAscentDescentLeadingCheckBox.isSelected();
}
public Set<Integer> getSelectedChars() {
Set<Integer> chars = new TreeSet<>();
Font f = getSelectedFont();
@@ -128,7 +135,7 @@ public class FontEmbedDialog extends AppDialog {
faceSelection.setModel(FontPanel.getFaceModel((FontFamily) familyNamesSelection.getSelectedItem()));
}
public FontEmbedDialog(FontFace selectedFace, String selectedChars) {
public FontEmbedDialog(boolean hasLayout, FontFace selectedFace, String selectedChars) {
setSize(900, 600);
setDefaultCloseOperation(HIDE_ON_CLOSE);
setTitle(translate("dialog.title"));
@@ -248,6 +255,12 @@ public class FontEmbedDialog extends AppDialog {
cnt.add(specialPanel);
cnt.add(individialSample);
importAscentDescentLeadingCheckBox = new JCheckBox(translate("ascentdescentleading"));
importAscentDescentLeadingCheckBox.setAlignmentX(Component.CENTER_ALIGNMENT);
if (hasLayout) {
cnt.add(importAscentDescentLeadingCheckBox);
}
JPanel buttonsPanel = new JPanel(new FlowLayout());
JButton okButton = new JButton(AppStrings.translate("button.ok"));
okButton.addActionListener(this::okButtonActionPerformed);