src/chxj_xhtml_mobile_1_0.c
/**
 * It is a handler who processes the FONT tag.
 *
 * @param pdoc  [i/o] The pointer to the XHTML structure at the output
 *                     destination is specified.
 * @param node   [i]   The FONT tag node is specified.
 * @return The conversion result is returned.
 */
It is a handler who processes the FONT tag.
@param pdoc  [i/o] The pointer to the XHTML structure at the output
destination is specified.
@param node   [i]   The FONT tag node is specified.
@return The conversion result is returned.
It is a handler who processes the FONT tag . @param pdoc [ i / o ] The pointer to the XHTML structure at the output destination is specified . @param node [ i ] The FONT tag node is specified . @return The conversion result is returned .
static char *
s_xhtml_1_0_start_font_tag(void *pdoc, Node *node) 
{
  xhtml_t *xhtml = GET_XHTML(pdoc);
  Doc     *doc   = xhtml->doc;
  Attr    *attr;
  char    *size = NULL;
  char    *color = NULL;
  for (attr = qs_get_attr(doc,node);
       attr;
       attr = qs_get_next_attr(doc,attr)) {
    char *name = qs_get_attr_name(doc,attr);
    char *value = qs_get_attr_value(doc,attr);
    if (STRCASEEQ('c','C',"color",name) && value && *value) {
      color = apr_pstrdup(doc->buf.pool, value);
    }
    else if (STRCASEEQ('s','S',"size",name) && value && *value) {
      size = apr_pstrdup(doc->buf.pool, value);
    }
  }
  if (color) {
    W_L("<font color=\"");
    W_V(color);
    W_L("\">");
    xhtml->font_color_flag++;
  }
  if (size) {
    xhtml->font_size_flag++;
    switch(*size) {
    case '1': W_L("<span style=\"font-size: xx-small\">"); break;
    case '2': W_L("<span style=\"font-size: x-small\">");  break;
    case '3': W_L("<span style=\"font-size: small\">");    break;
    case '4': W_L("<span style=\"font-size: medium\">");   break;
    case '5': W_L("<span style=\"font-size: large\">");    break;
    case '6': W_L("<span style=\"font-size: x-large\">");  break;
    case '7': W_L("<span style=\"font-size: xx-large\">"); break;
    case '-':
      if (*(size + 1) == '1') {
        W_L("<span style=\"font-size: small\">");
        break;
      }
      if (*(size + 1) == '2') {
        W_L("<span style=\"font-size: x-small\">");
        break;
      }
      if (*(size + 1) == '3') {
        W_L("<span style=\"font-size: xx-small\">");
        break;
      }
      xhtml->font_size_flag--;
      break;
    case '+':
      if (*(size + 1) == '1') {
        W_L("<span style=\"font-size: large\">");
        break;
      }
      if (*(size + 1) == '2') {
        W_L("<span style=\"font-size: x-large\">");
        break;
      }
      if (*(size + 1) == '3') {
        W_L("<span style=\"font-size: xx-large\">");
        break;
      }
      xhtml->font_size_flag--;
      break;
    default:
      WRN(doc->r, "invlalid font size. [%s] != (1|2|3|4|5|6|7|+1|+2|+3|-1|-2|-3)", size);
      xhtml->font_size_flag--;
    }
  }
  return xhtml->out;
}
static char * s_xhtml_1_0_start_font_tag ( void * pdoc , Node * node ) { xhtml_t * xhtml = GET_XHTML ( pdoc ) ; Doc * doc = xhtml -> doc ; Attr * attr ; char * size = NULL ; char * color = NULL ; for ( attr = qs_get_attr ( doc , node ) ; attr ; attr = qs_get_next_attr ( doc , attr ) ) { char * name = qs_get_attr_name ( doc , attr ) ; char * value = qs_get_attr_value ( doc , attr ) ; if ( STRCASEEQ ( ' ' , ' ' , " " , name ) && value && * value ) { color = apr_pstrdup ( doc -> buf . pool , value ) ; } else if ( STRCASEEQ ( ' ' , ' ' , " " , name ) && value && * value ) { size = apr_pstrdup ( doc -> buf . pool , value ) ; } } if ( color ) { W_L ( " \" " ) ; W_V ( color ) ; W_L ( " \" " ) ; xhtml -> font_color_flag ++ ; } if ( size ) { xhtml -> font_size_flag ++ ; switch ( * size ) { case ' ' : W_L ( " \" \" " ) ; break ; case ' ' : W_L ( " \" \" " ) ; break ; case ' ' : W_L ( " \" \" " ) ; break ; case ' ' : W_L ( " \" \" " ) ; break ; case ' ' : W_L ( " \" \" " ) ; break ; case ' ' : W_L ( " \" \" " ) ; break ; case ' ' : W_L ( " \" \" " ) ; break ; case ' ' : if ( * ( size + 1 ) == ' ' ) { W_L ( " \" \" " ) ; break ; } if ( * ( size + 1 ) == ' ' ) { W_L ( " \" \" " ) ; break ; } if ( * ( size + 1 ) == ' ' ) { W_L ( " \" \" " ) ; break ; } xhtml -> font_size_flag -- ; break ; case ' ' : if ( * ( size + 1 ) == ' ' ) { W_L ( " \" \" " ) ; break ; } if ( * ( size + 1 ) == ' ' ) { W_L ( " \" \" " ) ; break ; } if ( * ( size + 1 ) == ' ' ) { W_L ( " \" \" " ) ; break ; } xhtml -> font_size_flag -- ; break ; default : WRN ( doc -> r , " " , size ) ; xhtml -> font_size_flag -- ; } } return xhtml -> out ; }
It is a handler who processes the FONT tag.
It is a handler who processes the FONT tag .
/*=========================================================================*/ /* Get Attributes                                                          */ /*=========================================================================*/