Logo Search packages:      
Sourcecode: inkscape version File versions

static gchar* cr_statement_font_face_rule_to_string ( CRStatement *  a_this,
glong  a_indent 
) [static]

Serializes a font face rule statement into a string.

Parameters:
a_this the current instance of CRStatement to consider It must be a font face rule statement.
a_indent the number of white spaces of indentation.
Returns:
the serialized string. Must be deallocated by the caller using g_free().

Definition at line 659 of file cr-statement.c.

References AT_FONT_FACE_RULE_STMT, and cr_declaration_list_to_string2().

Referenced by cr_statement_dump_font_face_rule(), and cr_statement_to_string().

{
        gchar *result = NULL, *tmp_str = NULL ;
        GString *stringue = NULL ;

        g_return_val_if_fail (a_this 
                              && a_this->type == AT_FONT_FACE_RULE_STMT,
                              NULL);

        if (a_this->kind.font_face_rule->decl_list) {
                stringue = (GString *)g_string_new (NULL) ;
                g_return_val_if_fail (stringue, NULL) ;
                if (a_indent)
                        cr_utils_dump_n_chars2 (' ', stringue, 
                                        a_indent);
                g_string_append (stringue, "@font-face {\n");
                tmp_str = (gchar *)cr_declaration_list_to_string2 
                        (a_this->kind.font_face_rule->decl_list,
                         a_indent + DECLARATION_INDENT_NB, TRUE) ;
                if (tmp_str) {
                        g_string_append (stringue,
                                         tmp_str) ;
                        g_free (tmp_str) ;
                        tmp_str = NULL ;
                }
                g_string_append (stringue, "\n}");
        }
        if (stringue) {
                result = stringue->str ;
                g_string_free (stringue, FALSE) ;
                stringue = NULL ;
        }
        return result ;
}


Generated by  Doxygen 1.6.0   Back to index