mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 10:01:08 +00:00
better font name handling
kerning moved to FontHelper
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
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;
|
||||
@@ -37,11 +36,9 @@ 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;
|
||||
@@ -67,8 +64,8 @@ public class FontEmbedDialog extends AppDialog implements ActionListener {
|
||||
|
||||
private static final int SAMPLE_MAX_LENGTH = 50;
|
||||
|
||||
private final JComboBox<String> familyNamesSelection;
|
||||
private final JComboBox<String> faceSelection;
|
||||
private final JComboBox<FontFamily> familyNamesSelection;
|
||||
private final JComboBox<FontFace> faceSelection;
|
||||
private final JCheckBox[] rangeCheckboxes;
|
||||
private final String rangeNames[];
|
||||
private final JLabel[] rangeSamples;
|
||||
@@ -83,7 +80,7 @@ public class FontEmbedDialog extends AppDialog implements ActionListener {
|
||||
if (ttfFileRadio.isSelected() && customFont != null) {
|
||||
return customFont;
|
||||
}
|
||||
return FontTag.installedFonts.get(familyNamesSelection.getSelectedItem().toString()).get(faceSelection.getSelectedItem().toString());
|
||||
return ((FontFace)faceSelection.getSelectedItem()).font;
|
||||
}
|
||||
|
||||
public boolean hasUpdateTexts() {
|
||||
@@ -126,11 +123,11 @@ public class FontEmbedDialog extends AppDialog implements ActionListener {
|
||||
private JRadioButton ttfFileRadio;
|
||||
private JRadioButton installedRadio;
|
||||
|
||||
private void updateFaceSelection() {
|
||||
faceSelection.setModel(new DefaultComboBoxModel<>(new Vector<String>(FontTag.installedFonts.get(familyNamesSelection.getSelectedItem().toString()).keySet())));
|
||||
private void updateFaceSelection() {
|
||||
faceSelection.setModel(FontPanel.getFaceModel((FontFamily)familyNamesSelection.getSelectedItem()));
|
||||
}
|
||||
|
||||
public FontEmbedDialog(String selectedFamily, String selectedFace, String selectedChars) {
|
||||
public FontEmbedDialog(FontFace selectedFace, String selectedChars) {
|
||||
setSize(900, 600);
|
||||
setDefaultCloseOperation(HIDE_ON_CLOSE);
|
||||
setTitle(translate("dialog.title"));
|
||||
@@ -150,8 +147,8 @@ public class FontEmbedDialog extends AppDialog implements ActionListener {
|
||||
installedRadio.setSelected(true);
|
||||
|
||||
individialSample = new JLabel();
|
||||
familyNamesSelection = new JComboBox<>(new Vector<String>(new TreeSet<String>(FontTag.installedFonts.keySet())));
|
||||
familyNamesSelection.setSelectedItem(selectedFamily);
|
||||
familyNamesSelection = new JComboBox<>(FontPanel.getFamilyModel());
|
||||
familyNamesSelection.setSelectedItem(new FontFamily(selectedFace.font));
|
||||
faceSelection = new JComboBox<>();
|
||||
updateFaceSelection();
|
||||
faceSelection.setSelectedItem(selectedFace);
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (C) 2014 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.jpexs.decompiler.flash.gui;
|
||||
|
||||
import java.awt.Font;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class FontFace implements Comparable<FontFace>{
|
||||
public Font font;
|
||||
public FontFace(Font font) {
|
||||
this.font = font;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String face = font.getFontName();
|
||||
String fam = font.getFamily();
|
||||
if(face.startsWith(fam)){
|
||||
face = face.substring(fam.length()).trim();
|
||||
}
|
||||
if(face.startsWith(".")){
|
||||
face=face.substring(1);
|
||||
}
|
||||
return face;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 79 * hash + Objects.hashCode(this.font);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final FontFace other = (FontFace) obj;
|
||||
if (!Objects.equals(this.font, other.font)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(FontFace o) {
|
||||
return font.getFontName().compareTo(o.font.getFontName());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright (C) 2014 JPEXS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.jpexs.decompiler.flash.gui;
|
||||
|
||||
import java.awt.Font;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class FontFamily implements Comparable<FontFamily>{
|
||||
public String familyEn;
|
||||
public String family;
|
||||
|
||||
public FontFamily(Font font){
|
||||
this(font.getFamily(Locale.ENGLISH),font.getFamily());
|
||||
}
|
||||
|
||||
public FontFamily(String familyEn, String family) {
|
||||
this.familyEn = familyEn;
|
||||
this.family = family;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return family;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 89 * hash + Objects.hashCode(this.familyEn);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final FontFamily other = (FontFamily) obj;
|
||||
if (!Objects.equals(this.familyEn, other.familyEn)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(FontFamily o) {
|
||||
return family.compareTo(o.family);
|
||||
}
|
||||
}
|
||||
@@ -18,8 +18,6 @@ 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;
|
||||
@@ -34,6 +32,7 @@ import java.awt.event.ItemListener;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import java.util.Vector;
|
||||
@@ -77,12 +76,22 @@ public class FontPanel extends javax.swing.JPanel {
|
||||
fontTag = null;
|
||||
}
|
||||
|
||||
private ComboBoxModel<String> getFamilyModel() {
|
||||
return new DefaultComboBoxModel<>(new Vector<String>(new TreeSet<String>(FontTag.installedFonts.keySet())));
|
||||
public static ComboBoxModel<FontFamily> getFamilyModel() {
|
||||
Set<FontFamily> famSet=new TreeSet<>();
|
||||
for(Font f:FontTag.installedFontsByName.values()){
|
||||
famSet.add(new FontFamily(f));
|
||||
}
|
||||
return new DefaultComboBoxModel<>(new Vector<FontFamily>(famSet));
|
||||
}
|
||||
|
||||
private ComboBoxModel<String> getNameModel(String family) {
|
||||
return new DefaultComboBoxModel<>(new Vector<String>(FontTag.installedFonts.get(family).keySet()));
|
||||
public static ComboBoxModel<FontFace> getFaceModel(FontFamily family) {
|
||||
|
||||
Set<FontFace> faceSet=new TreeSet<>();
|
||||
for(Font f:FontTag.installedFontsByFamily.get(family.familyEn).values()){
|
||||
faceSet.add(new FontFace(f));
|
||||
}
|
||||
|
||||
return new DefaultComboBoxModel<>(new Vector<FontFace>(faceSet));
|
||||
}
|
||||
|
||||
private void setEditable(boolean editable) {
|
||||
@@ -174,22 +183,10 @@ public class FontPanel extends javax.swing.JPanel {
|
||||
|
||||
public void showFontTag(FontTag ft) {
|
||||
SWF swf = ft.getSwf();
|
||||
fontTag = ft;
|
||||
DefineFontNameTag fontNameTag = null;
|
||||
for (Tag tag : swf.tags) {
|
||||
if (tag instanceof DefineFontNameTag) {
|
||||
DefineFontNameTag dfnt = (DefineFontNameTag) tag;
|
||||
if (dfnt.fontId == ft.getFontId()) {
|
||||
fontNameTag = dfnt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fontNameLabel.setText(ft.getFontName());
|
||||
if (fontNameTag != null) {
|
||||
fontDisplayNameTextArea.setText(fontNameTag.fontName);
|
||||
fontCopyrightTextArea.setText(fontNameTag.fontCopyright);
|
||||
}
|
||||
fontTag = ft;
|
||||
fontNameIntagLabel.setText(ft.getFontNameIntag());
|
||||
fontNameTextArea.setText(ft.getFontName());
|
||||
fontCopyrightTextArea.setText(ft.getFontCopyright());
|
||||
|
||||
fontIsBoldCheckBox.setSelected(ft.isBold());
|
||||
fontIsItalicCheckBox.setSelected(ft.isItalic());
|
||||
@@ -200,37 +197,29 @@ public class FontPanel extends javax.swing.JPanel {
|
||||
fontCharactersTextArea.setText(chars);
|
||||
setAllowSave(false);
|
||||
String key = swf.getShortFileName() + "_" + ft.getFontId() + "_" + 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()));
|
||||
|
||||
String selectedFont = "";
|
||||
|
||||
if (swf.sourceFontNamesMap.containsKey(ft.getFontId())) {
|
||||
selectedFont = swf.sourceFontNamesMap.get(ft.getFontId());
|
||||
} else if (Configuration.getFontToNameMap().containsKey(key)) {
|
||||
selectedFont = Configuration.getFontToNameMap().get(key);
|
||||
} else if (Configuration.getFontToNameMap().containsKey(ft.getFontName())) {
|
||||
selectedFont = Configuration.getFontToNameMap().get(ft.getFontName());
|
||||
} else {
|
||||
fontFamilyNameSelection.setSelectedItem(FontTag.findInstalledFontFamily(ft.getFontName()));
|
||||
selectedFont = FontTag.findInstalledFontName(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("");
|
||||
}
|
||||
|
||||
Font selFont = FontTag.installedFontsByName.get(selectedFont);
|
||||
if(selFont == null){
|
||||
selectedFont = FontTag.findInstalledFontName(ft.getFontName());
|
||||
selFont = FontTag.installedFontsByName.get(selectedFont);
|
||||
}
|
||||
|
||||
fontFamilyNameSelection.setSelectedItem(new FontFamily(selFont));
|
||||
fontFaceSelection.setSelectedItem(new FontFace(selFont));
|
||||
|
||||
|
||||
setAllowSave(true);
|
||||
setEditable(false);
|
||||
}
|
||||
@@ -250,9 +239,9 @@ public class FontPanel extends javax.swing.JPanel {
|
||||
|
||||
addCharsPanel = new javax.swing.JPanel();
|
||||
fontParamsPanel = new javax.swing.JPanel();
|
||||
fontNameLabel = new javax.swing.JLabel();
|
||||
fontNameIntagLabel = new javax.swing.JLabel();
|
||||
javax.swing.JScrollPane fontDisplayNameScrollPane = new javax.swing.JScrollPane();
|
||||
fontDisplayNameTextArea = new javax.swing.JTextArea();
|
||||
fontNameTextArea = new javax.swing.JTextArea();
|
||||
javax.swing.JLabel jLabel3 = new javax.swing.JLabel();
|
||||
javax.swing.JScrollPane fontCopyrightScrollPane = new javax.swing.JScrollPane();
|
||||
fontCopyrightTextArea = new javax.swing.JTextArea();
|
||||
@@ -294,33 +283,33 @@ public class FontPanel extends javax.swing.JPanel {
|
||||
{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED,}
|
||||
}));
|
||||
|
||||
JLabel fontNameLabLabel = new JLabel();
|
||||
fontNameLabLabel.setText(AppStrings.translate("font.name")); // NOI18N
|
||||
fontParamsPanel.add(fontNameLabLabel, "0,0,R");
|
||||
JLabel fontNameIntagLabLabel = new JLabel();
|
||||
fontNameIntagLabLabel.setText(AppStrings.translate("font.name.intag")); // NOI18N
|
||||
fontParamsPanel.add(fontNameIntagLabLabel, "0,0,R");
|
||||
|
||||
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));
|
||||
fontParamsPanel.add(fontNameLabel, "1,0");
|
||||
fontNameIntagLabel.setText(AppStrings.translate("value.unknown")); // NOI18N
|
||||
fontNameIntagLabel.setMaximumSize(new java.awt.Dimension(250, 14));
|
||||
fontNameIntagLabel.setMinimumSize(new java.awt.Dimension(250, 14));
|
||||
fontNameIntagLabel.setPreferredSize(new java.awt.Dimension(250, 14));
|
||||
fontParamsPanel.add(fontNameIntagLabel, "1,0");
|
||||
|
||||
JLabel fontNameNameLabLabel = new JLabel();
|
||||
fontNameNameLabLabel.setText(AppStrings.translate("fontName.name")); // NOI18N
|
||||
fontNameNameLabLabel.setText(AppStrings.translate("font.name")); // NOI18N
|
||||
fontParamsPanel.add(fontNameNameLabLabel, "0,1,R");
|
||||
|
||||
fontDisplayNameScrollPane.setBorder(null);
|
||||
fontDisplayNameScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
fontDisplayNameScrollPane.setHorizontalScrollBar(null);
|
||||
|
||||
fontDisplayNameTextArea.setEditable(false);
|
||||
fontDisplayNameTextArea.setColumns(20);
|
||||
fontDisplayNameTextArea.setFont(new JLabel().getFont());
|
||||
fontDisplayNameTextArea.setLineWrap(true);
|
||||
fontDisplayNameTextArea.setText(AppStrings.translate("value.unknown")); // NOI18N
|
||||
fontDisplayNameTextArea.setWrapStyleWord(true);
|
||||
fontDisplayNameTextArea.setMinimumSize(new java.awt.Dimension(250, 16));
|
||||
fontDisplayNameTextArea.setOpaque(false);
|
||||
fontDisplayNameScrollPane.setViewportView(fontDisplayNameTextArea);
|
||||
fontNameTextArea.setEditable(false);
|
||||
fontNameTextArea.setColumns(20);
|
||||
fontNameTextArea.setFont(new JLabel().getFont());
|
||||
fontNameTextArea.setLineWrap(true);
|
||||
fontNameTextArea.setText(AppStrings.translate("value.unknown")); // NOI18N
|
||||
fontNameTextArea.setWrapStyleWord(true);
|
||||
fontNameTextArea.setMinimumSize(new java.awt.Dimension(250, 16));
|
||||
fontNameTextArea.setOpaque(false);
|
||||
fontDisplayNameScrollPane.setViewportView(fontNameTextArea);
|
||||
|
||||
fontParamsPanel.add(fontDisplayNameScrollPane, "1,1");
|
||||
|
||||
@@ -407,7 +396,7 @@ public class FontPanel extends javax.swing.JPanel {
|
||||
|
||||
fontFamilyNameSelection.setModel(getFamilyModel());
|
||||
fontFamilyNameSelection.setSelectedItem(FontTag.defaultFontName);
|
||||
fontFaceSelection.setModel(getNameModel((String) fontFamilyNameSelection.getSelectedItem()));
|
||||
fontFaceSelection.setModel(getFaceModel((FontFamily)fontFamilyNameSelection.getSelectedItem()));
|
||||
fontFamilyNameSelection.addItemListener(new java.awt.event.ItemListener() {
|
||||
@Override
|
||||
public void itemStateChanged(java.awt.event.ItemEvent evt) {
|
||||
@@ -520,7 +509,7 @@ public class FontPanel extends javax.swing.JPanel {
|
||||
for (int c = 0; c < newchars.length(); c++) {
|
||||
selChars.add(newchars.codePointAt(c));
|
||||
}
|
||||
fontAddChars((FontTag) item, selChars, FontTag.installedFonts.get(fontFamilyNameSelection.getSelectedItem().toString()).get(fontFaceSelection.getSelectedItem().toString()));
|
||||
fontAddChars((FontTag) item, selChars, ((FontFace)fontFaceSelection.getSelectedItem()).font);
|
||||
fontAddCharactersField.setText("");
|
||||
mainPanel.reload(true);
|
||||
}
|
||||
@@ -530,14 +519,14 @@ public class FontPanel extends javax.swing.JPanel {
|
||||
TreeItem item = mainPanel.tagTree.getCurrentTreeItem();
|
||||
if (item instanceof FontTag) {
|
||||
FontTag ft = (FontTag) item;
|
||||
FontEmbedDialog fed = new FontEmbedDialog(fontFamilyNameSelection.getSelectedItem().toString(), fontFaceSelection.getSelectedItem().toString(), fontAddCharactersField.getText());
|
||||
FontEmbedDialog fed = new FontEmbedDialog((FontFace)fontFaceSelection.getSelectedItem(), fontAddCharactersField.getText());
|
||||
if (fed.display()) {
|
||||
Set<Integer> selChars = fed.getSelectedChars();
|
||||
if (!selChars.isEmpty()) {
|
||||
Font selFont = fed.getSelectedFont();
|
||||
updateTextsCheckBox.setSelected(fed.hasUpdateTexts());
|
||||
fontFamilyNameSelection.setSelectedItem(selFont.getName());
|
||||
fontFaceSelection.setSelectedItem(FontHelper.getFontFace(selFont));
|
||||
fontFamilyNameSelection.setSelectedItem(new FontFamily(selFont));
|
||||
fontFaceSelection.setSelectedItem(new FontFace(selFont));
|
||||
fontAddChars(ft, selChars, selFont);
|
||||
fontAddCharactersField.setText("");
|
||||
mainPanel.reload(true);
|
||||
@@ -559,19 +548,17 @@ public class FontPanel extends javax.swing.JPanel {
|
||||
TreeItem item = mainPanel.tagTree.getCurrentTreeItem();
|
||||
if (item instanceof FontTag) {
|
||||
FontTag f = (FontTag) item;
|
||||
SWF swf = f.getSwf();
|
||||
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);
|
||||
SWF swf = f.getSwf();
|
||||
String selectedName = ((FontFace)fontFaceSelection.getSelectedItem()).font.getFontName(Locale.ENGLISH);
|
||||
swf.sourceFontNamesMap.put(f.getFontId(), selectedName);
|
||||
Configuration.addFontPair(swf.getShortFileName(), f.getFontId(), f.getFontName(), selectedName);
|
||||
}
|
||||
}
|
||||
|
||||
private void fontFamilySelectionItemStateChanged() {
|
||||
|
||||
savePair();
|
||||
fontFaceSelection.setModel(getNameModel((String) fontFamilyNameSelection.getSelectedItem()));
|
||||
fontFaceSelection.setModel(getFaceModel((FontFamily)fontFamilyNameSelection.getSelectedItem()));
|
||||
}
|
||||
|
||||
private void fontFaceSelectionItemStateChanged() {
|
||||
@@ -597,10 +584,8 @@ public class FontPanel extends javax.swing.JPanel {
|
||||
setEditable(false);
|
||||
}
|
||||
|
||||
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 buttonPreviewFontActionPerformed(java.awt.event.ActionEvent evt) {
|
||||
new FontPreviewDialog(null, true, ((FontFace)fontFaceSelection.getSelectedItem()).font).setVisible(true);
|
||||
}
|
||||
|
||||
private void formComponentResized(java.awt.event.ComponentEvent evt) {
|
||||
@@ -671,17 +656,18 @@ public class FontPanel extends javax.swing.JPanel {
|
||||
private javax.swing.JTextArea fontCharactersTextArea;
|
||||
private javax.swing.JTextArea fontCopyrightTextArea;
|
||||
private javax.swing.JLabel fontDescentLabel;
|
||||
private javax.swing.JTextArea fontDisplayNameTextArea;
|
||||
private javax.swing.JTextArea fontNameTextArea;
|
||||
private javax.swing.JButton fontEmbedButton;
|
||||
private javax.swing.JCheckBox fontIsBoldCheckBox;
|
||||
private javax.swing.JCheckBox fontIsItalicCheckBox;
|
||||
private javax.swing.JLabel fontLeadingLabel;
|
||||
private javax.swing.JLabel fontNameLabel;
|
||||
private javax.swing.JComboBox<String> fontFamilyNameSelection;
|
||||
private javax.swing.JComboBox<String> fontFaceSelection;
|
||||
private javax.swing.JLabel fontNameIntagLabel;
|
||||
private javax.swing.JComboBox<FontFamily> fontFamilyNameSelection;
|
||||
private javax.swing.JComboBox<FontFace> 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;
|
||||
|
||||
}
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="com/jpexs/decompiler/flash/gui/locales/FontPreviewDialog.properties" key="fontPreview.dialog.title" replaceFormat="java.util.ResourceBundle.getBundle("{bundleNameSlashes}").getString("{key}")"/>
|
||||
</Property>
|
||||
<Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.ComponentChooserEditor">
|
||||
<ComponentRef name="default"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[1024, 512]"/>
|
||||
</Property>
|
||||
|
||||
@@ -878,7 +878,7 @@ public class Main {
|
||||
* @throws IOException
|
||||
*/
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
||||
|
||||
String pluginPath = Configuration.pluginPath.get();
|
||||
if (pluginPath != null && !pluginPath.isEmpty()) {
|
||||
try {
|
||||
|
||||
@@ -1906,13 +1906,12 @@ 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().sourceFontFamiliesMap.get(font.getFontId());
|
||||
String fontName = font.getSwf().sourceFontNamesMap.get(font.getFontId());
|
||||
if (fontName == null) {
|
||||
fontName = font.getFontName();
|
||||
}
|
||||
fontName = FontTag.findInstalledFontFamily(fontName);
|
||||
Font f = new Font(fontName, font.getFontStyle(), 18);
|
||||
if (!f.canDisplay(character)) {
|
||||
}
|
||||
Font f = FontTag.installedFontsByName.get(fontName);
|
||||
if (f == null || !f.canDisplay(character)) {
|
||||
View.showMessageDialog(null, translate("error.font.nocharacter").replace("%char%", "" + character), translate("error"), JOptionPane.ERROR_MESSAGE);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,6 @@ 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.noselection = TTF soubor: <vyberte>
|
||||
ttffile.selection = TTF soubor: %fontname% (%filename%)
|
||||
allcharacters = V\u0161echny znaky (%available% znak\u016f)
|
||||
@@ -16,3 +16,12 @@
|
||||
range.description = %name% (%available% z %total% znak\u00f3w)
|
||||
dialog.title = Osadzanie czcionki
|
||||
label.individual = Indywidualne znaki:
|
||||
|
||||
button.loadfont = Wczytaj czcionk\u0119 z dysku...
|
||||
filter.ttf = Pliki True Type Font (*.ttf)
|
||||
error.invalidfontfile = Nieprawid\u0142owy plik czcionki
|
||||
error.cannotreadfontfile = Nie mo\u017cna odczyta\u0107 pliku czcionki
|
||||
installed = Zainstalowane:
|
||||
ttffile.noselection = Plik TTF: <wybierz>
|
||||
ttffile.selection = Plik TTF: %fontname% (%filename%)
|
||||
allcharacters = Wszystkie znaki (%available% znak\u00f3w)
|
||||
|
||||
@@ -513,3 +513,5 @@ button.zoomnone.hint = Zoom to 1:1
|
||||
button.snapshot.hint = Take snapshot into clipboard
|
||||
|
||||
editorTruncateWarning = Text truncated at position %chars% in debug mode.
|
||||
|
||||
font.name.intag = Font name in tag:
|
||||
@@ -501,4 +501,16 @@ menu.file.deobfuscation.old = Star\u00fd zp\u016fsob
|
||||
menu.file.deobfuscation.new = Nov\u00fd zp\u016fsob
|
||||
|
||||
contextmenu.openswfinside = Otev\u0159\u00edt SWF uvnit\u0159
|
||||
binarydata.swfInside = Vypad\u00e1 to, \u017ee uvnit\u0159 v tomto BinaryData tagu se nach\u00e1z\u00ed SWF soubor. Klikn\u011bte zde pro jeho na\u010dten\u00ed jako podstrom.
|
||||
binarydata.swfInside = Vypad\u00e1 to, \u017ee uvnit\u0159 v tomto BinaryData tagu se nach\u00e1z\u00ed SWF soubor. Klikn\u011bte zde pro jeho na\u010dten\u00ed jako podstrom.
|
||||
|
||||
|
||||
#after version 3.0.0
|
||||
button.zoomin.hint = P\u0159ibl\u00ed\u017eit
|
||||
button.zoomout.hint = Odd\u00e1lit
|
||||
button.zoomfit.hint = Rozt\u00e1hnout
|
||||
button.zoomnone.hint = M\u011b\u0159\u00edtko 1:1
|
||||
button.snapshot.hint = Sn\u00edmek do schr\u00e1nky
|
||||
|
||||
editorTruncateWarning = Text je o\u0159\u00edznut na pozici %chars% v lad\u00edc\u00edm m\u00f3du.
|
||||
|
||||
font.name.intag = N\u00e1zev p\u00edsma v tagu:
|
||||
Reference in New Issue
Block a user