Issue #389 Selecting font face while characters import

Issue #701 Importing from TTF file
Improved Font panel / Font embed dialog
Reloading installed fonts for other than windows systems
Removed xito Table Layout, using Oracle Table Layout instead
This commit is contained in:
Jindra Petřík
2014-10-25 20:58:32 +02:00
parent 1985ccb594
commit 8fd683d019
25 changed files with 665 additions and 4835 deletions
@@ -16,30 +16,44 @@
*/
package com.jpexs.decompiler.flash.gui;
import com.jpexs.decompiler.flash.configuration.Configuration;
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.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.FontFormatException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.io.File;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;
import java.util.Vector;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.filechooser.FileFilter;
/**
*
@@ -49,27 +63,38 @@ public class FontEmbedDialog extends AppDialog implements ActionListener {
private static final String ACTION_OK = "OK";
private static final String ACTION_CANCEL = "CANCEL";
private static final String ACTION_LOAD_FROM_DISK = "LOAD_FROM_DISK";
private static final int SAMPLE_MAX_LENGTH = 50;
private final JComboBox<String> sourceFont;
private final JComboBox<String> familyNamesSelection;
private final JComboBox<String> faceSelection;
private final JCheckBox[] rangeCheckboxes;
private final String rangeNames[];
private final JLabel[] rangeSamples;
private final JTextField individualCharsField;
private boolean result = false;
private JLabel individialSample;
private final int style;
private JLabel individialSample;
private Font customFont;
private final JCheckBox allCheckbox;
private final JCheckBox updateTextsCheckbox;
public String getSelectedFont() {
return sourceFont.getSelectedItem().toString();
public Font getSelectedFont() {
if (ttfFileRadio.isSelected() && customFont != null) {
return customFont;
}
return FontTag.installedFonts.get(familyNamesSelection.getSelectedItem().toString()).get(faceSelection.getSelectedItem().toString());
}
public boolean hasUpdateTexts(){
return updateTextsCheckbox.isSelected();
}
public Set<Integer> getSelectedChars() {
Set<Integer> chars = new TreeSet<>();
Font f = new Font(getSelectedFont(), style, new JLabel().getFont().getSize());
for (int i = 0; i < rangeCheckboxes.length; i++) {
if (rangeCheckboxes[i].isSelected()) {
Font f = getSelectedFont();
if(allCheckbox.isSelected()){
for (int i = 0; i < rangeCheckboxes.length; i++) {
int codes[] = CharacterRanges.rangeCodes(i);
for (int c : codes) {
if (f.canDisplay(c)) {
@@ -77,40 +102,135 @@ public class FontEmbedDialog extends AppDialog implements ActionListener {
}
}
}
}
String indStr = individualCharsField.getText();
for (int i = 0; i < indStr.length(); i++) {
if (f.canDisplay(indStr.codePointAt(i))) {
chars.add(indStr.codePointAt(i));
}else{
for (int i = 0; i < rangeCheckboxes.length; i++) {
if (rangeCheckboxes[i].isSelected()) {
int codes[] = CharacterRanges.rangeCodes(i);
for (int c : codes) {
if (f.canDisplay(c)) {
chars.add(c);
}
}
}
}
String indStr = individualCharsField.getText();
for (int i = 0; i < indStr.length(); i++) {
if (f.canDisplay(indStr.codePointAt(i))) {
chars.add(indStr.codePointAt(i));
}
}
}
return chars;
}
public FontEmbedDialog(String selectedFont, String selectedChars, int style) {
private JRadioButton ttfFileRadio;
private JRadioButton installedRadio;
private void updateFaceSelection(){
faceSelection.setModel( new DefaultComboBoxModel<>(new Vector<String>(FontTag.installedFonts.get(familyNamesSelection.getSelectedItem().toString()).keySet())));
}
public FontEmbedDialog(String selectedFamily, String selectedFace, String selectedChars) {
setSize(900, 600);
this.style = style;
setDefaultCloseOperation(HIDE_ON_CLOSE);
setTitle(translate("dialog.title"));
Container cnt = getContentPane();
cnt.setLayout(new BoxLayout(cnt, BoxLayout.Y_AXIS));
JPanel selFontPanel = new JPanel(new FlowLayout());
installedRadio = new JRadioButton(translate("installed"));
ttfFileRadio = new JRadioButton(translate("ttffile.noselection"));
ButtonGroup bg = new ButtonGroup();
bg.add(installedRadio);
bg.add(ttfFileRadio);
installedRadio.setSelected(true);
individialSample = new JLabel();
sourceFont = new JComboBox<>(new Vector<>(FontTag.fontNames));
sourceFont.setSelectedItem(selectedFont);
cnt.add(sourceFont);
familyNamesSelection = new JComboBox<>(new Vector<String>(new TreeSet<String>(FontTag.installedFonts.keySet())));
familyNamesSelection.setSelectedItem(selectedFamily);
faceSelection = new JComboBox<>();
updateFaceSelection();
faceSelection.setSelectedItem(selectedFace);
JButton loadFromDiskButton = new JButton(View.getIcon("open16"));
loadFromDiskButton.setToolTipText(translate("button.loadfont"));
loadFromDiskButton.addActionListener(this);
loadFromDiskButton.setActionCommand(ACTION_LOAD_FROM_DISK);
selFontPanel.add(installedRadio);
selFontPanel.add(familyNamesSelection);
selFontPanel.add(faceSelection);
selFontPanel.add(ttfFileRadio);
selFontPanel.add(loadFromDiskButton);
installedRadio.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
updateCheckboxes();
}
}
});
ttfFileRadio.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
if (ttfFileRadio.isSelected()) {
if (customFont == null) {
if (loadFromDisk()) {
updateCheckboxes();
} else {
installedRadio.setSelected(true);
}
} else {
updateCheckboxes();
}
}
}
}
});
cnt.add(selFontPanel);
JPanel rangesPanel = new JPanel();
rangesPanel.setLayout(new BoxLayout(rangesPanel, BoxLayout.Y_AXIS));
int rc = CharacterRanges.rangeCount();
final int rc = CharacterRanges.rangeCount();
rangeCheckboxes = new JCheckBox[rc];
rangeSamples = new JLabel[rc];
rangeNames = new String[rc];
allCheckbox = new JCheckBox(translate("allcharacters"));
allCheckbox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if(e.getStateChange() == ItemEvent.SELECTED){
for (int i = 0; i < rc; i++) {
rangeCheckboxes[i].setEnabled(false);
}
individualCharsField.setEnabled(false);
}else if(e.getStateChange() == ItemEvent.DESELECTED){
for (int i = 0; i < rc; i++) {
rangeCheckboxes[i].setEnabled(true);
}
individualCharsField.setEnabled(true);
}
}
});
JPanel rangeRowPanel = new JPanel();
rangeRowPanel.setLayout(new BorderLayout());
rangeRowPanel.add(allCheckbox,BorderLayout.WEST);
rangeRowPanel.setAlignmentX(0);
rangesPanel.add(rangeRowPanel);
for (int i = 0; i < rc; i++) {
rangeNames[i] = CharacterRanges.rangeName(i);
rangeSamples[i] = new JLabel("");
rangeCheckboxes[i] = new JCheckBox(rangeNames[i]);
JPanel rangeRowPanel = new JPanel();
rangeRowPanel = new JPanel();
rangeRowPanel.setLayout(new BoxLayout(rangeRowPanel, BoxLayout.X_AXIS));
rangeRowPanel.add(rangeCheckboxes[i]);
rangeRowPanel.add(Box.createHorizontalGlue());
@@ -127,8 +247,18 @@ public class FontEmbedDialog extends AppDialog implements ActionListener {
individualCharsField.setPreferredSize(new Dimension(100, individualCharsField.getPreferredSize().height));
individialSample = new JLabel();
specialPanel.add(individualCharsField);
updateTextsCheckbox = new JCheckBox(AppStrings.translate("font.updateTexts"));
JPanel utPanel = new JPanel(new FlowLayout());
utPanel.add(updateTextsCheckbox);
cnt.add(specialPanel);
cnt.add(individialSample);
cnt.add(utPanel);
JPanel buttonsPanel = new JPanel(new FlowLayout());
JButton okButton = new JButton(AppStrings.translate("button.ok"));
@@ -145,7 +275,15 @@ public class FontEmbedDialog extends AppDialog implements ActionListener {
setModalityType(ModalityType.APPLICATION_MODAL);
individualCharsField.setText(selectedChars);
getRootPane().setDefaultButton(okButton);
sourceFont.addItemListener(new ItemListener() {
familyNamesSelection.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
updateFaceSelection();
updateCheckboxes();
}
});
faceSelection.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
updateCheckboxes();
@@ -162,7 +300,7 @@ public class FontEmbedDialog extends AppDialog implements ActionListener {
private void updateIndividual() {
String chars = individualCharsField.getText();
Font f = new Font(getSelectedFont(), style, new JLabel().getFont().getSize());
Font f = getSelectedFont();
String visibleChars = "";
for (int i = 0; i < chars.length(); i++) {
if (f.canDisplay(chars.codePointAt(i))) {
@@ -173,9 +311,10 @@ public class FontEmbedDialog extends AppDialog implements ActionListener {
}
private void updateCheckboxes() {
String fontStr = sourceFont.getSelectedItem().toString();
Font f = new Font(fontStr, style, new JLabel().getFont().getSize());
Font f = getSelectedFont().deriveFont(12f);
int rc = CharacterRanges.rangeCount();
Set<Integer> allChars=new HashSet<>();
for (int i = 0; i < rc; i++) {
rangeNames[i] = CharacterRanges.rangeName(i);
int codes[] = CharacterRanges.rangeCodes(i);
@@ -183,6 +322,7 @@ public class FontEmbedDialog extends AppDialog implements ActionListener {
String sample = "";
for (int c = 0; c < codes.length; c++) {
if (f.canDisplay(codes[c])) {
allChars.add(codes[c]);
if (avail < SAMPLE_MAX_LENGTH) {
sample += "" + (char) codes[c];
}
@@ -193,6 +333,7 @@ public class FontEmbedDialog extends AppDialog implements ActionListener {
rangeSamples[i].setFont(f);
rangeCheckboxes[i].setText(translate("range.description").replace("%available%", "" + avail).replace("%name%", rangeNames[i]).replace("%total%", "" + codes.length));
}
allCheckbox.setText(translate("allcharacters").replace("%available%", ""+allChars.size()));
individialSample.setFont(f);
updateIndividual();
}
@@ -208,9 +349,52 @@ public class FontEmbedDialog extends AppDialog implements ActionListener {
result = false;
setVisible(false);
break;
case ACTION_LOAD_FROM_DISK:
if (customFont != null) {
if (loadFromDisk()) {
updateCheckboxes();
}
}
ttfFileRadio.setSelected(true);
break;
}
}
private boolean loadFromDisk() {
JFileChooser fc = new JFileChooser();
fc.setCurrentDirectory(new File(Configuration.lastOpenDir.get()));
FileFilter ttfFilter = new FileFilter() {
@Override
public boolean accept(File f) {
return (f.getName().toLowerCase().endsWith(".ttf")) || (f.isDirectory());
}
@Override
public String getDescription() {
return translate("filter.ttf");
}
};
fc.setFileFilter(ttfFilter);
fc.setAcceptAllFileFilterUsed(true);
JFrame f = new JFrame();
View.setWindowIcon(f);
int returnVal = fc.showOpenDialog(f);
if (returnVal == JFileChooser.APPROVE_OPTION) {
Configuration.lastOpenDir.set(Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath());
File selfile = Helper.fixDialogFile(fc.getSelectedFile());
try {
customFont = Font.createFont(Font.TRUETYPE_FONT, selfile);
ttfFileRadio.setText(translate("ttffile.selection").replace("%fontname%", customFont.getName()).replace("%filename%", selfile.getName()));
return true;
} catch (FontFormatException ex) {
JOptionPane.showMessageDialog(this, translate("error.invalidfontfile"), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
} catch (IOException ex) {
JOptionPane.showMessageDialog(this, translate("error.cannotreadfontfile"), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);
}
}
return false;
}
public boolean display() {
result = false;
setVisible(true);
@@ -1,607 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.8" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<Events>
<EventHandler event="componentResized" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="formComponentResized"/>
</Events>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" alignment="0" pref="473" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" alignment="0" pref="415" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
<Properties>
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
</Properties>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel2">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="importTTFButton" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="387" max="32767" attributes="0"/>
</Group>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jPanel1" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel11" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="fontSelection" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel10" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="fontAddCharactersField" min="-2" pref="150" max="-2" attributes="0"/>
</Group>
<Component id="fontEmbedButton" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="buttonEdit" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="buttonSave" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="buttonCancel" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="100" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="fontAddCharsButton" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="updateTextsCheckBox" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="buttonPreviewFont" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="315" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace pref="341" max="32767" attributes="0"/>
<Component id="importTTFButton" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="85" max="-2" attributes="0"/>
</Group>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel10" alignment="3" max="32767" attributes="0"/>
<Component id="fontAddCharactersField" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="fontAddCharsButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="updateTextsCheckBox" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="fontSelection" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonPreviewFont" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="fontEmbedButton" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="78" max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="buttonEdit" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonSave" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonCancel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="jPanel1">
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="font.name" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="23" weightX="0.0" weightY="1.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="fontNameLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="value.unknown" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[250, 14]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[250, 14]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[250, 14]"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="0" insetsRight="6" anchor="23" weightX="1.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="fontName.name" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="8" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="23" weightX="0.0" weightY="1.0"/>
</Constraint>
</Constraints>
</Component>
<Container class="javax.swing.JScrollPane" name="fontDisplayNameScrollPane">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
<Property name="horizontalScrollBar" type="javax.swing.JScrollBar" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="null"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="0" insetsRight="6" anchor="23" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="fontDisplayNameTextArea">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="columns" type="int" value="20"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="new JLabel().getFont()" type="code"/>
</Property>
<Property name="lineWrap" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="value.unknown" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="wrapStyleWord" type="boolean" value="true"/>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[250, 16]"/>
</Property>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="fontName.copyright" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="23" weightX="0.0" weightY="1.0"/>
</Constraint>
</Constraints>
</Component>
<Container class="javax.swing.JScrollPane" name="fontCopyrightScrollPane">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
<Property name="horizontalScrollBar" type="javax.swing.JScrollBar" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="null"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="0" insetsRight="6" anchor="23" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="fontCopyrightTextArea">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="columns" type="int" value="20"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="new JLabel().getFont()" type="code"/>
</Property>
<Property name="lineWrap" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="value.unknown" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="wrapStyleWord" type="boolean" value="true"/>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[250, 16]"/>
</Property>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="font.isbold" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="23" weightX="0.0" weightY="1.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JCheckBox" name="fontIsBoldCheckBox">
<Properties>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="0" insetsRight="6" anchor="23" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="font.isitalic" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="4" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="23" weightX="0.0" weightY="1.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JCheckBox" name="fontIsItalicCheckBox">
<Properties>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="4" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="0" insetsRight="6" anchor="23" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel6">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="font.ascent" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="5" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="23" weightX="0.0" weightY="1.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="fontAscentLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="value.unknown" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="5" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="0" insetsRight="6" anchor="23" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="font.descent" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="6" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="23" weightX="0.0" weightY="1.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="fontDescentLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="value.unknown" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="6" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="0" insetsRight="6" anchor="23" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel8">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="font.leading" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="7" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="23" weightX="0.0" weightY="1.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="fontLeadingLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="value.unknown" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="7" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="0" insetsRight="6" anchor="23" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel9">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="font.characters" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="0" gridY="8" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="23" weightX="0.0" weightY="1.0"/>
</Constraint>
</Constraints>
</Component>
<Container class="javax.swing.JScrollPane" name="fontCharactersScrollPane">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
</Property>
<Property name="horizontalScrollBarPolicy" type="int" value="31"/>
<Property name="horizontalScrollBar" type="javax.swing.JScrollBar" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="null"/>
</Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="8" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="6" insetsBottom="0" insetsRight="6" anchor="23" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
<Component class="javax.swing.JTextArea" name="fontCharactersTextArea">
<Properties>
<Property name="editable" type="boolean" value="false"/>
<Property name="columns" type="int" value="20"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="new JLabel().getFont()" type="code"/>
</Property>
<Property name="lineWrap" type="boolean" value="true"/>
<Property name="wrapStyleWord" type="boolean" value="true"/>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[250, 16]"/>
</Property>
<Property name="opaque" type="boolean" value="false"/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="jLabel10">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="font.characters.add" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
</AuxValues>
</Component>
<Component class="javax.swing.JTextField" name="fontAddCharactersField">
</Component>
<Component class="javax.swing.JButton" name="fontAddCharsButton">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="button.ok" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="fontAddCharsButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="updateTextsCheckBox">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="font.updateTexts" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel11">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="font.source" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="fontSelection">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="getModel()" type="code"/>
</Property>
<Property name="selectedItem" type="java.lang.Object" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="FontTag.defaultFontName" type="code"/>
</Property>
</Properties>
<Events>
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="fontSelectionItemStateChanged"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="fontEmbedButton">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="button.font.embed" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="fontEmbedButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonEdit">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/jpexs/decompiler/flash/gui/graphics/edit16.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="button.edit" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonEditActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonSave">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/jpexs/decompiler/flash/gui/graphics/save16.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="button.save" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonSaveActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonCancel">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/com/jpexs/decompiler/flash/gui/graphics/cancel16.png"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="button.cancel" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonCancelActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonPreviewFont">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/MainFrame.properties" key="button.preview" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonPreviewFontActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="importTTFButton">
<Properties>
<Property name="text" type="java.lang.String" value="Import TTF"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="importTTFButtonActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
</Container>
</SubComponents>
</Form>
+287 -358
View File
@@ -18,30 +18,37 @@ package com.jpexs.decompiler.flash.gui;
import com.jpexs.decompiler.flash.SWF;
import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.helpers.FontHelper;
import com.jpexs.decompiler.flash.tags.DefineFontNameTag;
import com.jpexs.decompiler.flash.tags.Tag;
import com.jpexs.decompiler.flash.tags.base.FontTag;
import com.jpexs.decompiler.flash.tags.base.TextTag;
import com.jpexs.decompiler.flash.treeitems.TreeItem;
import com.jpexs.helpers.Helper;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.FontFormatException;
import java.awt.font.FontRenderContext;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.BorderFactory;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.filechooser.FileFilter;
import layout.TableLayout;
/**
*
@@ -70,8 +77,12 @@ public class FontPanel extends javax.swing.JPanel {
fontTag = null;
}
private ComboBoxModel<String> getModel() {
return new DefaultComboBoxModel<>(FontTag.fontNamesArray);
private ComboBoxModel<String> getFamilyModel() {
return new DefaultComboBoxModel<>(new Vector<String>(new TreeSet<String>(FontTag.installedFonts.keySet())));
}
private ComboBoxModel<String> getNameModel(String family) {
return new DefaultComboBoxModel<>(new Vector<String>(FontTag.installedFonts.get(family).keySet()));
}
private void setEditable(boolean editable) {
@@ -119,7 +130,7 @@ public class FontPanel extends javax.swing.JPanel {
for (int ic : selChars) {
char c = (char) ic;
if (oldchars.indexOf((int) c) > -1) {
int opt = 0; //yes
int opt; //yes
if (!(yestoall || notoall)) {
opt = View.showOptionDialog(null, translate("message.font.add.exists").replace("%char%", "" + c), translate("message.warning"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, yesno, translate("button.yes"));
if (opt == 2) {
@@ -133,6 +144,8 @@ public class FontPanel extends javax.swing.JPanel {
opt = 0; //yes
} else if (notoall) {
opt = 1; //no
} else {
opt = 1;
}
if (opt == 1) {
@@ -185,35 +198,59 @@ public class FontPanel extends javax.swing.JPanel {
fontLeadingLabel.setText(ft.getLeading() == -1 ? translate("value.unknown") : "" + ft.getLeading());
String chars = ft.getCharacters(swf.tags);
fontCharactersTextArea.setText(chars);
setAllowSave(false);
String key = swf.getShortFileName() + "_" + ft.getFontId() + "_" + ft.getFontName();
if (swf.sourceFontsMap.containsKey(ft.getFontId())) {
fontSelection.setSelectedItem(swf.sourceFontsMap.get(ft.getFontId()));
} else if (Configuration.getFontPairs().containsKey(key)) {
fontSelection.setSelectedItem(Configuration.getFontPairs().get(key));
} else if (Configuration.getFontPairs().containsKey(ft.getFontName())) {
fontSelection.setSelectedItem(Configuration.getFontPairs().get(ft.getFontName()));
if (swf.sourceFontFamiliesMap.containsKey(ft.getFontId())) {
fontFamilyNameSelection.setSelectedItem(swf.sourceFontFamiliesMap.get(ft.getFontId()));
} else if (Configuration.getFontIdToFamilyMap().containsKey(key)) {
fontFamilyNameSelection.setSelectedItem(Configuration.getFontIdToFamilyMap().get(key));
} else if (Configuration.getFontIdToFamilyMap().containsKey(ft.getFontName())) {
fontFamilyNameSelection.setSelectedItem(Configuration.getFontIdToFamilyMap().get(ft.getFontName()));
} else {
fontSelection.setSelectedItem(FontTag.findInstalledFontName(ft.getFontName()));
fontFamilyNameSelection.setSelectedItem(FontTag.findInstalledFontFamily(ft.getFontName()));
}
if (swf.sourceFontFacesMap.containsKey(ft.getFontId())) {
fontFaceSelection.setSelectedItem(swf.sourceFontFacesMap.get(ft.getFontId()));
} else if (Configuration.getFontIdToFaceMap().containsKey(key)) {
fontFaceSelection.setSelectedItem(Configuration.getFontIdToFaceMap().get(key));
} else if (Configuration.getFontIdToFaceMap().containsKey(ft.getFontName())) {
fontFaceSelection.setSelectedItem(Configuration.getFontIdToFaceMap().get(ft.getFontName()));
} else {
java.util.Map<String, Font> faces = FontTag.installedFonts.get(fontFamilyNameSelection.getSelectedItem().toString());
boolean found = false;
for (String face : faces.keySet()) {
Font f = faces.get(face);
if (f.isBold() == ft.isBold() && f.isItalic() == ft.isItalic()) {
found = true;
fontFaceSelection.setSelectedItem(face);
break;
}
}
if (!found) {
fontFaceSelection.setSelectedItem("");
}
}
setAllowSave(true);
setEditable(false);
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
private static void addTableSpaces(TableLayout tl, double size) {
int cols = tl.getNumColumn();
int rows = tl.getNumRow();
for (int x = 0; x <= cols; x++) {
tl.insertColumn(x * 2, size);
}
for (int y = 0; y <= rows; y++) {
tl.insertRow(y * 2, size);
}
}
jScrollPane1 = new javax.swing.JScrollPane();
jPanel2 = new javax.swing.JPanel();
jPanel1 = new javax.swing.JPanel();
javax.swing.JLabel jLabel1 = new javax.swing.JLabel();
private void initComponents() {
addCharsPanel = new javax.swing.JPanel();
fontParamsPanel = new javax.swing.JPanel();
fontNameLabel = new javax.swing.JLabel();
javax.swing.JLabel jLabel2 = new javax.swing.JLabel();
javax.swing.JScrollPane fontDisplayNameScrollPane = new javax.swing.JScrollPane();
fontDisplayNameTextArea = new javax.swing.JTextArea();
javax.swing.JLabel jLabel3 = new javax.swing.JLabel();
@@ -232,58 +269,44 @@ public class FontPanel extends javax.swing.JPanel {
javax.swing.JLabel jLabel9 = new javax.swing.JLabel();
fontCharactersScrollPane = new javax.swing.JScrollPane();
fontCharactersTextArea = new javax.swing.JTextArea();
javax.swing.JLabel jLabel10 = new javax.swing.JLabel();
javax.swing.JLabel fontCharsAddLabel = new javax.swing.JLabel();
fontAddCharactersField = new javax.swing.JTextField();
fontAddCharsButton = new javax.swing.JButton();
updateTextsCheckBox = new javax.swing.JCheckBox();
jLabel11 = new javax.swing.JLabel();
fontSelection = new javax.swing.JComboBox();
fontSourceLabel = new javax.swing.JLabel();
fontFamilyNameSelection = new javax.swing.JComboBox<>();
fontFaceSelection = new javax.swing.JComboBox<>();
fontEmbedButton = new javax.swing.JButton();
buttonEdit = new javax.swing.JButton();
buttonSave = new javax.swing.JButton();
buttonCancel = new javax.swing.JButton();
buttonPreviewFont = new javax.swing.JButton();
importTTFButton = new javax.swing.JButton();
addComponentListener(new java.awt.event.ComponentAdapter() {
@Override
public void componentResized(java.awt.event.ComponentEvent evt) {
formComponentResized(evt);
}
});
jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
TableLayout tlFontParamsPanel;
fontParamsPanel.setLayout(tlFontParamsPanel = new TableLayout(new double[][]{
{TableLayout.PREFERRED, TableLayout.FILL},
{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED,}
}));
jPanel1.setLayout(new java.awt.GridBagLayout());
JLabel fontNameLabLabel = new JLabel();
fontNameLabLabel.setText(AppStrings.translate("font.name")); // NOI18N
fontParamsPanel.add(fontNameLabLabel, "0,0,R");
java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("com/jpexs/decompiler/flash/gui/locales/MainFrame"); // NOI18N
jLabel1.setText(bundle.getString("font.name")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.weighty = 1.0;
jPanel1.add(jLabel1, gridBagConstraints);
fontNameLabel.setText(bundle.getString("value.unknown")); // NOI18N
fontNameLabel.setText(AppStrings.translate("value.unknown")); // NOI18N
fontNameLabel.setMaximumSize(new java.awt.Dimension(250, 14));
fontNameLabel.setMinimumSize(new java.awt.Dimension(250, 14));
fontNameLabel.setPreferredSize(new java.awt.Dimension(250, 14));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 0;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 6);
jPanel1.add(fontNameLabel, gridBagConstraints);
fontParamsPanel.add(fontNameLabel, "1,0");
jLabel2.setText(bundle.getString("fontName.name")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1;
gridBagConstraints.ipadx = 8;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.weighty = 1.0;
jPanel1.add(jLabel2, gridBagConstraints);
JLabel fontNameNameLabLabel = new JLabel();
fontNameNameLabLabel.setText(AppStrings.translate("fontName.name")); // NOI18N
fontParamsPanel.add(fontNameNameLabLabel, "0,1,R");
fontDisplayNameScrollPane.setBorder(null);
fontDisplayNameScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
@@ -293,27 +316,16 @@ public class FontPanel extends javax.swing.JPanel {
fontDisplayNameTextArea.setColumns(20);
fontDisplayNameTextArea.setFont(new JLabel().getFont());
fontDisplayNameTextArea.setLineWrap(true);
fontDisplayNameTextArea.setText(bundle.getString("value.unknown")); // NOI18N
fontDisplayNameTextArea.setText(AppStrings.translate("value.unknown")); // NOI18N
fontDisplayNameTextArea.setWrapStyleWord(true);
fontDisplayNameTextArea.setMinimumSize(new java.awt.Dimension(250, 16));
fontDisplayNameTextArea.setOpaque(false);
fontDisplayNameScrollPane.setViewportView(fontDisplayNameTextArea);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 6);
jPanel1.add(fontDisplayNameScrollPane, gridBagConstraints);
fontParamsPanel.add(fontDisplayNameScrollPane, "1,1");
jLabel3.setText(bundle.getString("fontName.copyright")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 2;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.weighty = 1.0;
jPanel1.add(jLabel3, gridBagConstraints);
jLabel3.setText(AppStrings.translate("fontName.copyright")); // NOI18N
fontParamsPanel.add(jLabel3, "0,2,R");
fontCopyrightScrollPane.setBorder(null);
fontCopyrightScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
@@ -323,107 +335,48 @@ public class FontPanel extends javax.swing.JPanel {
fontCopyrightTextArea.setColumns(20);
fontCopyrightTextArea.setFont(new JLabel().getFont());
fontCopyrightTextArea.setLineWrap(true);
fontCopyrightTextArea.setText(bundle.getString("value.unknown")); // NOI18N
fontCopyrightTextArea.setText(AppStrings.translate("value.unknown")); // NOI18N
fontCopyrightTextArea.setWrapStyleWord(true);
fontCopyrightTextArea.setMinimumSize(new java.awt.Dimension(250, 16));
fontCopyrightTextArea.setOpaque(false);
fontCopyrightScrollPane.setViewportView(fontCopyrightTextArea);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 6);
jPanel1.add(fontCopyrightScrollPane, gridBagConstraints);
fontParamsPanel.add(fontCopyrightScrollPane, "1,2");
jLabel4.setText(bundle.getString("font.isbold")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.weighty = 1.0;
jPanel1.add(jLabel4, gridBagConstraints);
jLabel4.setText(AppStrings.translate("font.isbold")); // NOI18N
fontParamsPanel.add(jLabel4, "0,3,R");
fontIsBoldCheckBox.setEnabled(false);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 3;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 6);
jPanel1.add(fontIsBoldCheckBox, gridBagConstraints);
jLabel5.setText(bundle.getString("font.isitalic")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 4;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.weighty = 1.0;
jPanel1.add(jLabel5, gridBagConstraints);
fontParamsPanel.add(fontIsBoldCheckBox, "1,3");
jLabel5.setText(AppStrings.translate("font.isitalic")); // NOI18N
fontParamsPanel.add(jLabel5, "0,4,R");
fontIsItalicCheckBox.setEnabled(false);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 4;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 6);
jPanel1.add(fontIsItalicCheckBox, gridBagConstraints);
fontParamsPanel.add(fontIsItalicCheckBox, "1,4");
jLabel6.setText(bundle.getString("font.ascent")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 5;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.weighty = 1.0;
jPanel1.add(jLabel6, gridBagConstraints);
jLabel6.setText(AppStrings.translate("font.ascent")); // NOI18N
fontParamsPanel.add(jLabel6, "0,5,R");
fontAscentLabel.setText(bundle.getString("value.unknown")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 5;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 6);
jPanel1.add(fontAscentLabel, gridBagConstraints);
fontAscentLabel.setText(AppStrings.translate("value.unknown")); // NOI18N
fontParamsPanel.add(fontAscentLabel, "1,5");
jLabel7.setText(bundle.getString("font.descent")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 6;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.weighty = 1.0;
jPanel1.add(jLabel7, gridBagConstraints);
jLabel7.setText(AppStrings.translate("font.descent")); // NOI18N
fontParamsPanel.add(jLabel7, "0,6,R");
fontDescentLabel.setText(bundle.getString("value.unknown")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 6;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 6);
jPanel1.add(fontDescentLabel, gridBagConstraints);
fontDescentLabel.setText(AppStrings.translate("value.unknown")); // NOI18N
fontParamsPanel.add(fontDescentLabel, "1,6");
jLabel8.setText(bundle.getString("font.leading")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 7;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.weighty = 1.0;
jPanel1.add(jLabel8, gridBagConstraints);
jLabel8.setText(AppStrings.translate("font.leading")); // NOI18N
fontParamsPanel.add(jLabel8, "0,7,R");
fontLeadingLabel.setText(bundle.getString("value.unknown")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 7;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 6);
jPanel1.add(fontLeadingLabel, gridBagConstraints);
fontLeadingLabel.setText(AppStrings.translate("value.unknown")); // NOI18N
fontParamsPanel.add(fontLeadingLabel, "1,7");
jLabel9.setText(bundle.getString("font.characters")); // NOI18N
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 8;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.weighty = 1.0;
jPanel1.add(jLabel9, gridBagConstraints);
jLabel9.setText(AppStrings.translate("font.characters")); // NOI18N
fontParamsPanel.add(jLabel9, "0,8,R");
fontCharactersScrollPane.setBorder(null);
fontCharactersScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
@@ -437,173 +390,128 @@ public class FontPanel extends javax.swing.JPanel {
fontCharactersTextArea.setMinimumSize(new java.awt.Dimension(250, 16));
fontCharactersTextArea.setOpaque(false);
fontCharactersScrollPane.setViewportView(fontCharactersTextArea);
fontParamsPanel.add(fontCharactersScrollPane, "1,8");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 8;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 6);
jPanel1.add(fontCharactersScrollPane, gridBagConstraints);
fontCharsAddLabel.setText(AppStrings.translate("font.characters.add")); // NOI18N
jLabel10.setText(bundle.getString("font.characters.add")); // NOI18N
fontAddCharsButton.setText(bundle.getString("button.ok")); // NOI18N
fontAddCharsButton.setText(AppStrings.translate("button.ok")); // NOI18N
fontAddCharsButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
fontAddCharsButtonActionPerformed(evt);
}
});
updateTextsCheckBox.setText(bundle.getString("font.updateTexts")); // NOI18N
updateTextsCheckBox.setText(AppStrings.translate("font.updateTexts")); // NOI18N
jLabel11.setText(bundle.getString("font.source")); // NOI18N
fontSourceLabel.setText(AppStrings.translate("font.source")); // NOI18N
fontSelection.setModel(getModel());
fontSelection.setSelectedItem(FontTag.defaultFontName);
fontSelection.addItemListener(new java.awt.event.ItemListener() {
fontFamilyNameSelection.setModel(getFamilyModel());
fontFamilyNameSelection.setSelectedItem(FontTag.defaultFontName);
fontFaceSelection.setModel(getNameModel((String) fontFamilyNameSelection.getSelectedItem()));
fontFamilyNameSelection.addItemListener(new java.awt.event.ItemListener() {
@Override
public void itemStateChanged(java.awt.event.ItemEvent evt) {
fontSelectionItemStateChanged(evt);
fontFamilySelectionItemStateChanged();
}
});
fontEmbedButton.setText(bundle.getString("button.font.embed")); // NOI18N
fontFaceSelection.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent evt) {
fontFaceSelectionItemStateChanged();
}
});
fontEmbedButton.setText(AppStrings.translate("button.font.embed")); // NOI18N
fontEmbedButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
fontEmbedButtonActionPerformed(evt);
}
});
buttonEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jpexs/decompiler/flash/gui/graphics/edit16.png"))); // NOI18N
buttonEdit.setText(bundle.getString("button.edit")); // NOI18N
buttonEdit.setText(AppStrings.translate("button.edit")); // NOI18N
buttonEdit.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonEditActionPerformed(evt);
}
});
buttonSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jpexs/decompiler/flash/gui/graphics/save16.png"))); // NOI18N
buttonSave.setText(bundle.getString("button.save")); // NOI18N
buttonSave.setText(AppStrings.translate("button.save")); // NOI18N
buttonSave.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonSaveActionPerformed(evt);
}
});
buttonCancel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jpexs/decompiler/flash/gui/graphics/cancel16.png"))); // NOI18N
buttonCancel.setText(bundle.getString("button.cancel")); // NOI18N
buttonCancel.setText(AppStrings.translate("button.cancel")); // NOI18N
buttonCancel.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonCancelActionPerformed(evt);
}
});
buttonPreviewFont.setText(bundle.getString("button.preview")); // NOI18N
buttonPreviewFont.setText(AppStrings.translate("button.preview")); // NOI18N
buttonPreviewFont.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonPreviewFontActionPerformed(evt);
}
});
importTTFButton.setText("Import TTF");
importTTFButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
importTTFButtonActionPerformed(evt);
}
});
TableLayout tlAddCharsPanel;
addCharsPanel.setLayout(tlAddCharsPanel = new TableLayout(new double[][]{
{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED},
{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}
}));
addCharsPanel.setBorder(BorderFactory.createRaisedBevelBorder());
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(importTTFButton)
.addContainerGap(387, Short.MAX_VALUE))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel11)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(fontSelection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(fontAddCharactersField, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(fontEmbedButton))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(buttonEdit)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(buttonSave)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(buttonCancel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(fontAddCharsButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(updateTextsCheckBox))
.addComponent(buttonPreviewFont))
.addGap(315, 315, 315)))
.addContainerGap()))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addContainerGap(341, Short.MAX_VALUE)
.addComponent(importTTFButton)
.addGap(85, 85, 85))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(fontAddCharactersField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(fontAddCharsButton)
.addComponent(updateTextsCheckBox))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel11)
.addComponent(fontSelection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonPreviewFont)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(fontEmbedButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 78, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(buttonEdit)
.addComponent(buttonSave)
.addComponent(buttonCancel))
.addContainerGap()))
);
addCharsPanel.add(fontCharsAddLabel, "0,0,R");
addCharsPanel.add(fontAddCharactersField, "1,0,2,0");
addCharsPanel.add(fontAddCharsButton, "3,0");
addCharsPanel.add(fontEmbedButton, "4,0");
jScrollPane1.setViewportView(jPanel2);
addCharsPanel.add(fontSourceLabel, "0,1,R");
addCharsPanel.add(fontFamilyNameSelection, "1,1");
addCharsPanel.add(fontFaceSelection, "2,1");
addCharsPanel.add(buttonPreviewFont, "3,1");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 473, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 415, Short.MAX_VALUE)
);
}// </editor-fold>//GEN-END:initComponents
addCharsPanel.add(updateTextsCheckBox, "0,2,2,2");
private void fontAddCharsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fontAddCharsButtonActionPerformed
JPanel buttonsPanel = new JPanel(new FlowLayout());
buttonsPanel.add(buttonEdit);
buttonsPanel.add(buttonSave);
buttonsPanel.add(buttonCancel);
TableLayout tlAll;
setLayout(tlAll = new TableLayout(new double[][]{
{TableLayout.FILL},
{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}
}));
add(fontParamsPanel, "0,0");
add(buttonsPanel, "0,1");
add(addCharsPanel, "0,2");
addTableSpaces(tlAddCharsPanel, 10);
addTableSpaces(tlFontParamsPanel, 10);
addTableSpaces(tlAll, 10);
}
private void labsize(JLabel lab) {
lab.setPreferredSize(new Dimension(lab.getFontMetrics(lab.getFont()).stringWidth(lab.getText()) + 30, lab.getPreferredSize().height));
lab.setMinimumSize(lab.getPreferredSize());
}
private void fontAddCharsButtonActionPerformed(java.awt.event.ActionEvent evt) {
String newchars = fontAddCharactersField.getText();
TreeItem item = mainPanel.tagTree.getCurrentTreeItem();
@@ -612,47 +520,69 @@ public class FontPanel extends javax.swing.JPanel {
for (int c = 0; c < newchars.length(); c++) {
selChars.add(newchars.codePointAt(c));
}
fontAddChars((FontTag) item, selChars, new Font(fontSelection.getSelectedItem().toString(),Font.PLAIN,12));
fontAddChars((FontTag) item, selChars, FontTag.installedFonts.get(fontFamilyNameSelection.getSelectedItem().toString()).get(fontFaceSelection.getSelectedItem().toString()));
fontAddCharactersField.setText("");
mainPanel.reload(true);
}
}//GEN-LAST:event_fontAddCharsButtonActionPerformed
private void fontEmbedButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fontEmbedButtonActionPerformed
}
private void fontEmbedButtonActionPerformed(java.awt.event.ActionEvent evt) {
TreeItem item = mainPanel.tagTree.getCurrentTreeItem();
if (item instanceof FontTag) {
FontTag ft = (FontTag) item;
FontEmbedDialog fed = new FontEmbedDialog(fontSelection.getSelectedItem().toString(), fontAddCharactersField.getText(), ft.getFontStyle());
if (fed.display()) {
FontEmbedDialog fed = new FontEmbedDialog(fontFamilyNameSelection.getSelectedItem().toString(), fontFaceSelection.getSelectedItem().toString(), fontAddCharactersField.getText());
if (fed.display()) {
Set<Integer> selChars = fed.getSelectedChars();
if (!selChars.isEmpty()) {
String selFont = fed.getSelectedFont();
fontSelection.setSelectedItem(selFont);
fontAddChars(ft, selChars, new Font(selFont,Font.PLAIN,10));
fontAddCharactersField.setText("");
mainPanel.reload(true);
Font selFont = fed.getSelectedFont();
updateTextsCheckBox.setSelected(fed.hasUpdateTexts());
fontFamilyNameSelection.setSelectedItem(selFont.getName());
fontFaceSelection.setSelectedItem(FontHelper.getFontFace(selFont));
fontAddChars(ft, selChars, selFont);
fontAddCharactersField.setText("");
mainPanel.reload(true);
}
}
}
}//GEN-LAST:event_fontEmbedButtonActionPerformed
}
private void fontSelectionItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_fontSelectionItemStateChanged
private boolean allowSave = true;
private synchronized void setAllowSave(boolean v) {
allowSave = v;
}
private synchronized void savePair() {
if (!allowSave) {
return;
}
TreeItem item = mainPanel.tagTree.getCurrentTreeItem();
if (item instanceof FontTag) {
FontTag f = (FontTag) item;
SWF swf = f.getSwf();
String selectedSystemFont = (String) fontSelection.getSelectedItem();
swf.sourceFontsMap.put(f.getFontId(), selectedSystemFont);
Configuration.addFontPair(swf.getShortFileName(), f.getFontId(), f.getFontName(), selectedSystemFont);
String selectedFamily = (String) fontFamilyNameSelection.getSelectedItem();
String selectedFace = (String) fontFaceSelection.getSelectedItem();
swf.sourceFontFamiliesMap.put(f.getFontId(), selectedFamily);
swf.sourceFontFacesMap.put(f.getFontId(), selectedFace);
Configuration.addFontPair(swf.getShortFileName(), f.getFontId(), f.getFontName(), selectedFamily, selectedFace);
}
}//GEN-LAST:event_fontSelectionItemStateChanged
}
private void buttonEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonEditActionPerformed
private void fontFamilySelectionItemStateChanged() {
savePair();
fontFaceSelection.setModel(getNameModel((String) fontFamilyNameSelection.getSelectedItem()));
}
private void fontFaceSelectionItemStateChanged() {
savePair();
}
private void buttonEditActionPerformed(java.awt.event.ActionEvent evt) {
setEditable(true);
}//GEN-LAST:event_buttonEditActionPerformed
}
private void buttonSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSaveActionPerformed
private void buttonSaveActionPerformed(java.awt.event.ActionEvent evt) {
if (fontTag.isBoldEditable()) {
fontTag.setBold(fontIsBoldCheckBox.isSelected());
}
@@ -660,76 +590,76 @@ public class FontPanel extends javax.swing.JPanel {
fontTag.setItalic(fontIsItalicCheckBox.isSelected());
}
setEditable(false);
}//GEN-LAST:event_buttonSaveActionPerformed
}
private void buttonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCancelActionPerformed
private void buttonCancelActionPerformed(java.awt.event.ActionEvent evt) {
showFontTag(fontTag);
setEditable(false);
}//GEN-LAST:event_buttonCancelActionPerformed
}
private void buttonPreviewFontActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPreviewFontActionPerformed
String selectedSystemFont = (String) fontSelection.getSelectedItem();
new FontPreviewDialog(null, true, new Font(selectedSystemFont, fontTag.getFontStyle(), 1024)).setVisible(true);
}//GEN-LAST:event_buttonPreviewFontActionPerformed
private void buttonPreviewFontActionPerformed(java.awt.event.ActionEvent evt) {
String familyName = (String) fontFamilyNameSelection.getSelectedItem();
String face = (String) fontFaceSelection.getSelectedItem();
new FontPreviewDialog(null, true, FontTag.installedFonts.get(familyName).get(face)).setVisible(true);
}
private void formComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentResized
jPanel1.updateUI();
}//GEN-LAST:event_formComponentResized
private void formComponentResized(java.awt.event.ComponentEvent evt) {
fontParamsPanel.updateUI();
}
private void importTTFButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importTTFButtonActionPerformed
private void importTTFButtonActionPerformed(java.awt.event.ActionEvent evt) {
TreeItem item = mainPanel.tagTree.getCurrentTreeItem();
if (item instanceof FontTag) {
FontTag ft = (FontTag) item;
JFileChooser fc = new JFileChooser();
fc.setCurrentDirectory(new File(Configuration.lastOpenDir.get()));
FileFilter ttfFilter = new FileFilter() {
@Override
public boolean accept(File f) {
return (f.getName().toLowerCase().endsWith(".ttf")) || (f.isDirectory());
}
FontTag ft = (FontTag) item;
@Override
public String getDescription() {
return "TTF files";
}
};
fc.setFileFilter(ttfFilter);
fc.setAcceptAllFileFilterUsed(false);
JFrame fr = new JFrame();
View.setWindowIcon(fr);
int returnVal = fc.showOpenDialog(fr);
if (returnVal == JFileChooser.APPROVE_OPTION) {
Configuration.lastOpenDir.set(Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath());
File selfile = Helper.fixDialogFile(fc.getSelectedFile());
Set<Integer> selChars = new HashSet<>();
try {
Font f = Font.createFont(Font.TRUETYPE_FONT, selfile);
int required[] = new int[]{0x0001, 0x0000, 0x000D, 0x0020};
loopi:for(char i=0;i<Character.MAX_VALUE;i++){
for(int r:required){
if(r==i){
continue loopi;
}
}
if(f.canDisplay((int)i)){
selChars.add((int)i);
}
JFileChooser fc = new JFileChooser();
fc.setCurrentDirectory(new File(Configuration.lastOpenDir.get()));
FileFilter ttfFilter = new FileFilter() {
@Override
public boolean accept(File f) {
return (f.getName().toLowerCase().endsWith(".ttf")) || (f.isDirectory());
}
fontAddChars(ft,selChars, f);
mainPanel.reload(true);
} catch (FontFormatException ex) {
JOptionPane.showMessageDialog(mainPanel, "Invalid TTF font");
} catch (IOException ex) {
Logger.getLogger(FontPanel.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}//GEN-LAST:event_importTTFButtonActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
@Override
public String getDescription() {
return "TTF files";
}
};
fc.setFileFilter(ttfFilter);
fc.setAcceptAllFileFilterUsed(false);
JFrame fr = new JFrame();
View.setWindowIcon(fr);
int returnVal = fc.showOpenDialog(fr);
if (returnVal == JFileChooser.APPROVE_OPTION) {
Configuration.lastOpenDir.set(Helper.fixDialogFile(fc.getSelectedFile()).getParentFile().getAbsolutePath());
File selfile = Helper.fixDialogFile(fc.getSelectedFile());
Set<Integer> selChars = new HashSet<>();
try {
Font f = Font.createFont(Font.TRUETYPE_FONT, selfile);
int required[] = new int[]{0x0001, 0x0000, 0x000D, 0x0020};
loopi:
for (char i = 0; i < Character.MAX_VALUE; i++) {
for (int r : required) {
if (r == i) {
continue loopi;
}
}
if (f.canDisplay((int) i)) {
selChars.add((int) i);
}
}
fontAddChars(ft, selChars, f);
mainPanel.reload(true);
} catch (FontFormatException ex) {
JOptionPane.showMessageDialog(mainPanel, "Invalid TTF font");
} catch (IOException ex) {
Logger.getLogger(FontPanel.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}
private javax.swing.JButton buttonCancel;
private javax.swing.JButton buttonEdit;
private javax.swing.JButton buttonPreviewFont;
@@ -747,12 +677,11 @@ public class FontPanel extends javax.swing.JPanel {
private javax.swing.JCheckBox fontIsItalicCheckBox;
private javax.swing.JLabel fontLeadingLabel;
private javax.swing.JLabel fontNameLabel;
private javax.swing.JComboBox fontSelection;
private javax.swing.JButton importTTFButton;
private javax.swing.JLabel jLabel11;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JComboBox<String> fontFamilyNameSelection;
private javax.swing.JComboBox<String> fontFaceSelection;
private javax.swing.JLabel fontSourceLabel;
private javax.swing.JPanel fontParamsPanel;
private javax.swing.JPanel addCharsPanel;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JCheckBox updateTextsCheckBox;
// End of variables declaration//GEN-END:variables
}
@@ -48,13 +48,13 @@ public class FontPreviewDialog extends AppDialog {
initComponents();
View.setWindowIcon(this);
labelSample12.setFont(font.deriveFont(Font.PLAIN, 12));
labelSample18.setFont(font.deriveFont(Font.PLAIN, 18));
labelSample24.setFont(font.deriveFont(Font.PLAIN, 24));
labelSample36.setFont(font.deriveFont(Font.PLAIN, 36));
labelSample48.setFont(font.deriveFont(Font.PLAIN, 48));
labelSample60.setFont(font.deriveFont(Font.PLAIN, 60));
labelSample72.setFont(font.deriveFont(Font.PLAIN, 72));
labelSample12.setFont(font.deriveFont(12f));
labelSample18.setFont(font.deriveFont(18f));
labelSample24.setFont(font.deriveFont(24f));
labelSample36.setFont(font.deriveFont(36f));
labelSample48.setFont(font.deriveFont(48f));
labelSample60.setFont(font.deriveFont(60f));
labelSample72.setFont(font.deriveFont(72f));
comboBoxSampleTexts.setSelectedIndex(Configuration.guiFontPreviewSampleText.get(0));
if (Configuration.guiFontPreviewWidth.hasValue()) {
int width = Configuration.guiFontPreviewWidth.get();
@@ -1906,11 +1906,11 @@ public final class MainPanel extends JPanel implements ActionListener, TreeSelec
if (textTag.setFormattedText(new MissingCharacterHandler() {
@Override
public boolean handle(FontTag font, char character) {
String fontName = font.getSwf().sourceFontsMap.get(font.getFontId());
String fontName = font.getSwf().sourceFontFamiliesMap.get(font.getFontId());
if (fontName == null) {
fontName = font.getFontName();
}
fontName = FontTag.findInstalledFontName(fontName);
fontName = FontTag.findInstalledFontFamily(fontName);
Font f = new Font(fontName, font.getFontStyle(), 18);
if (!f.canDisplay(character)) {
View.showMessageDialog(null, translate("error.font.nocharacter").replace("%char%", "" + character), translate("error"), JOptionPane.ERROR_MESSAGE);
@@ -16,3 +16,11 @@
range.description = %name% (%available% of %total% characters)
dialog.title = Font embedding
label.individual = Individual characters:
button.loadfont = Load font from disk...
filter.ttf = True Type Font files (*.ttf)
error.invalidfontfile = Invalid font file
error.cannotreadfontfile = Cannot read font file
installed = Installed:
ttffile.noselection = TTF file: <select>
ttffile.selection = TTF file: %fontname% (%filename%)
allcharacters = All characters (%available% characters)
@@ -16,3 +16,11 @@
range.description = %name% (%available% z %total% znak\u016f)
dialog.title = Vlo\u017een\u00ed p\u00edsma
label.individual = Individu\u00e1ln\u00ed znaky:
button.loadfont = Na\u010d\u00edst p\u00edsmo z disku...
filter.ttf = Soubory p\u00edsma True Type (*.ttf)
error.invalidfontfile = Neplatn\u00fd soubor p\u00edsma
error.cannotreadfontfile = Nelze na\u010d\u00edst soubor p\u00edsma
installed = Nainstalov\u00e1no:
ttffile.noselection = TTF soubor: <select>
ttffile.selection = TTF soubor: %fontname% (%filename%)
allcharacters = V\u0161echny znaky (%available% znak\u016f)