コード例 #1
0
  public void showFontTag(FontTag ft) {
    SWF swf = ft.getSwf();
    fontTag = ft;
    fontNameIntagLabel.setText(ft.getFontNameIntag());
    fontNameTextArea.setText(ft.getFontName());
    fontCopyrightTextArea.setText(ft.getFontCopyright());

    fontIsBoldCheckBox.setSelected(ft.isBold());
    fontIsItalicCheckBox.setSelected(ft.isItalic());
    fontDescentLabel.setText(
        ft.getDescent() == -1 ? translate("value.unknown") : Integer.toString(ft.getDescent()));
    fontAscentLabel.setText(
        ft.getAscent() == -1 ? translate("value.unknown") : Integer.toString(ft.getAscent()));
    fontLeadingLabel.setText(
        ft.getLeading() == -1 ? translate("value.unknown") : Integer.toString(ft.getLeading()));
    String chars = ft.getCharacters();
    fontCharactersTextArea.setText(chars);
    fontCharactersScrollPane.getVerticalScrollBar().scrollRectToVisible(new Rectangle(0, 0, 1, 1));
    setAllowSave(false);

    Font selFont = ft.getSystemFont();
    fontFamilyNameSelection.setSelectedItem(new FontFamily(selFont));
    fontFaceSelection.setSelectedItem(new FontFace(selFont));

    setAllowSave(true);
    setEditable(false);
  }
コード例 #2
0
 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 selectedName =
         ((FontFace) fontFaceSelection.getSelectedItem()).font.getFontName(Locale.ENGLISH);
     swf.sourceFontNamesMap.put(f.getFontId(), selectedName);
     Configuration.addFontPair(
         swf.getShortFileName(), f.getFontId(), f.getFontNameIntag(), selectedName);
   }
 }