/** replaces the font (PS name) if necessary and returns the new name */
  private static String replacePSFont(String font) {
    String result;

    result = font;

    // do we have to replace it? -> same style, size
    if (m_PSFontReplacement.containsKey(font)) {
      result = m_PSFontReplacement.get(font).toString();
      if (DEBUG)
        System.out.println(
            Messages.getInstance().getString("PostscriptGraphics_ReplacePSFont_Text_First")
                + font
                + Messages.getInstance().getString("PostscriptGraphics_ReplacePSFont_Text_Second")
                + result
                + Messages.getInstance().getString("PostscriptGraphics_ReplacePSFont_Text_Third"));
    }

    return result;
  }
  /** output if we're in debug mode */
  static {
    if (DEBUG)
      System.err.println(
          PostscriptGraphics.class.getName()
              + Messages.getInstance().getString("PostscriptGraphics_Error_Text"));

    // get font replacements
    m_PSFontReplacement = new Hashtable();
    m_PSFontReplacement.put(
        "SansSerif.plain", "Helvetica.plain"); // SansSerif.plain is displayed as Courier in GV???
    m_PSFontReplacement.put(
        "Dialog.plain",
        "Helvetica.plain"); // dialog is a Sans Serif font, but GV displays it as Courier???
    m_PSFontReplacement.put(
        "Microsoft Sans Serif",
        "Helvetica.plain"); // MS Sans Serif is a Sans Serif font (hence the name!), but GV displays
                            // it as Courier???
    m_PSFontReplacement.put(
        "MicrosoftSansSerif",
        "Helvetica.plain"); // MS Sans Serif is a Sans Serif font (hence the name!), but GV displays
                            // it as Courier???
  }
 /**
  * adds the PS font name to replace and its replacement in the replacement hashtable
  *
  * @param replace the PS font name to replace
  * @param with the PS font name to replace the font with
  */
 public static void addPSFontReplacement(String replace, String with) {
   m_PSFontReplacement.put(replace, with);
 }