예제 #1
0
  // ZSS-945, ZSS-1018
  // @since 3.8.0
  // @Internal
  public static String getFontHtmlStyle(
      SSheet sheet,
      SCell cell,
      SCellStyle cellStyle,
      FormatResult ft,
      SCellStyle tbCellStyle) { // ZSS-977
    if (!cell.isNull()) {

      final StringBuffer sb = new StringBuffer();
      // ZSS-977
      SFont font = StyleUtil.getFontStyle(sheet.getBook(), cellStyle, tbCellStyle);
      ;
      sb.append(getFontCSSStyle(cell, font));

      // condition color
      final boolean isRichText = ft.isRichText();
      if (!isRichText) {
        final SColor color = ft.getColor();
        if (color != null) {
          final String htmlColor = color.getHtmlColor();
          sb.append("color:").append(htmlColor).append(";");
        }
      }

      return sb.toString();
    }
    return "";
  }
예제 #2
0
  // ZSS-725: separate inner and font style to avoid the conflict between
  // vertical alignment, subscript and superscript.
  public String getFontHtmlStyle() {
    if (!_cell.isNull()) {

      final StringBuffer sb = new StringBuffer();
      final SFont font = _cellStyle.getFont();

      // sb.append(BookHelper.getFontCSSStyle(_book, font));
      sb.append(getFontCSSStyle(_cell, font));

      // condition color
      final FormatResult ft =
          _formatEngine.format(_cell, new FormatContext(ZssContext.getCurrent().getLocale()));
      final boolean isRichText = ft.isRichText();
      if (!isRichText) {
        final SColor color = ft.getColor();
        if (color != null) {
          final String htmlColor = color.getHtmlColor();
          sb.append("color:").append(htmlColor).append(";");
        }
      }

      return sb.toString();
    }
    return "";
  }