Example #1
0
  @Override
  protected void _setFont(final GFont font) {
    _currentDOMFont = createDOMFont(font);
    _currentFontSize = font.getSize();

    tryToSetCurrentFontToContext();
  }
Example #2
0
  private static String createDOMFont(final GFont font) {
    String domFont = "";

    if (font.isItalic()) {
      domFont += "italic ";
    }
    if (font.isBold()) {
      domFont += "bold ";
    }

    domFont += font.getSize() + "pt";

    if (font.isSerif()) {
      domFont += " serif";
    } else if (font.isSansSerif()) {
      domFont += " sans-serif";
    } else if (font.isMonospaced()) {
      domFont += " monospace";
    }

    return domFont;
  }