Go to the documentation of this file.
30 cr_font_family_to_string_real (
CRFontFamily const * a_this,
31 gboolean a_walk_list, GString ** a_string)
33 guchar
const *name = NULL;
37 *a_string = g_string_new (NULL);
38 g_return_val_if_fail (*a_string,
43 g_string_append (*a_string,
"NULL");
47 switch (a_this->
type) {
49 name = (guchar
const *)
"sans-serif";
53 name = (guchar
const *)
"sans-serif";
57 name = (guchar
const *)
"cursive";
61 name = (guchar
const *)
"fantasy";
65 name = (guchar
const *)
"monospace";
69 name = (guchar
const *) a_this->
name;
79 g_string_append_printf (*a_string,
", %s", name);
81 g_string_append (*a_string, (
const gchar *) name);
84 if (a_walk_list == TRUE && a_this->
next) {
85 result = cr_font_family_to_string_real (a_this->
next,
95 gchar
const *str = NULL;
120 str =
"unknown absolute font size value";
128 gchar
const *str = NULL;
138 str =
"unknown relative font size value";
166 result->
type = a_type;
183 gboolean a_walk_font_family_list)
186 guchar *result = NULL;
187 GString *stringue = NULL;
190 result = (guchar *) g_strdup (
"NULL");
191 g_return_val_if_fail (result, NULL);
194 status = cr_font_family_to_string_real (a_this,
195 a_walk_font_family_list,
198 if (status ==
CR_OK && stringue) {
199 result = (guchar *) stringue->str;
200 g_string_free (stringue, FALSE);
205 g_string_free (stringue, TRUE);
234 g_free (a_this->
name);
238 a_this->
name = a_name;
255 g_return_val_if_fail (a_family_to_append, NULL);
258 return a_family_to_append;
260 for (cur_ff = a_this; cur_ff && cur_ff->
next; cur_ff = cur_ff->
next) ;
262 cur_ff->
next = a_family_to_append;
263 a_family_to_append->
prev = cur_ff;
280 g_return_val_if_fail (a_this && a_family_to_prepend, NULL);
283 return a_family_to_prepend;
285 a_family_to_prepend->
next = a_this;
286 a_this->
prev = a_family_to_prepend;
288 return a_family_to_prepend;
304 for (cur_ff = a_this; cur_ff && cur_ff->
next; cur_ff = cur_ff->
next) ;
306 for (; cur_ff; cur_ff = cur_ff->
prev) {
308 g_free (a_this->
name);
313 g_free (cur_ff->
next);
317 if (cur_ff->
prev == NULL) {
360 switch (a_this->
type) {
390 switch (a_src->
type) {
468 g_return_val_if_fail (a_num_type >=
NUM_AUTO
474 a_value, a_num_type) ;
504 g_return_val_if_fail (a_this, FALSE) ;
522 str = g_strdup (
"NULL");
523 g_return_val_if_fail (str, NULL);
526 switch (a_this->
type) {
528 str = g_strdup (cr_predefined_absolute_font_size_to_string
535 str = g_strdup (cr_relative_font_size_to_string
539 str = g_strdup (
"inherit");
559 g_return_if_fail (a_smaller_size) ;
563 switch (a_font_size) {
594 *a_smaller_size = result ;
612 g_return_if_fail (a_larger_size) ;
616 switch (a_font_size) {
647 *a_larger_size = result ;
681 str = g_strdup (
"NULL");
682 g_return_val_if_fail (str, NULL);
686 switch (a_this->
type) {
688 str = g_strdup (
"none");
694 str = g_strdup (
"unknown font-size-adjust property value");
697 str = g_strdup (
"inherit");
716 str = (gchar *)
"normal";
719 str = (gchar *)
"italic";
722 str = (gchar *)
"oblique";
725 str = (gchar *)
"inherit";
728 str = (gchar *)
"unknown font style value";
748 str = (gchar *)
"normal";
751 str = (gchar *)
"small-caps";
754 str = (gchar *)
"inherit";
781 return a_weight << 1 ;
798 str = (gchar *)
"normal";
801 str = (gchar *)
"bold";
804 str = (gchar *)
"bolder";
807 str = (gchar *)
"lighter";
810 str = (gchar *)
"100";
813 str = (gchar *)
"200";
816 str = (gchar *)
"300";
819 str = (gchar *)
"400";
822 str = (gchar *)
"500";
825 str = (gchar *)
"600";
828 str = (gchar *)
"700";
831 str = (gchar *)
"800";
834 str = (gchar *)
"900";
837 str = (gchar *)
"inherit";
840 str = (gchar *)
"unknown font-weight property value";
859 str = (gchar *)
"normal";
862 str = (gchar *)
"wider";
865 str = (gchar *)
"narrower";
868 str = (gchar *)
"ultra-condensed";
871 str = (gchar *)
"extra-condensed";
874 str = (gchar *)
"condensed";
877 str = (gchar *)
"semi-condensed";
880 str = (gchar *)
"semi-expanded";
883 str = (gchar *)
"expanded";
886 str = (gchar *)
"extra-expaned";
889 str = (gchar *)
"ultra-expanded";
892 str = (gchar *)
"inherit";
906 g_return_if_fail (a_font_size);
908 g_free (a_font_size) ;
943 g_return_if_fail (a_this);
CRPredefinedAbsoluteFontSize
The different types of absolute font size.
@ PREDEFINED_ABSOLUTE_FONT_SIZE
If the type of CRFontSize is PREDEFINED_ABSOLUTE_FONT_SIZE, the CRFontSize::value....
enum CRStatus cr_num_set(CRNum *a_this, gdouble a_val, enum CRNumType a_type)
cr_num_set: Sets an instance of CRNum.
@ INHERITED_FONT_SIZE
If the type of CRFontSize is INHERITED_FONT_SIZE, the None of the field of the CRFontSize::value enum...
CRFontSize * cr_font_size_new(void)
cr_font_size_new:
guchar * cr_num_to_string(CRNum const *a_this)
cr_num_to_string: @a_this: the current instance of CRNum.
@ CR_INSTANCIATION_FAILED_ERROR
const gchar * cr_font_variant_to_string(enum CRFontVariant a_code)
cr_font_variant_to_string: @a_code: the current instance of CRFontVariant.
void cr_font_size_get_smaller_predefined_font_size(enum CRPredefinedAbsoluteFontSize a_font_size, enum CRPredefinedAbsoluteFontSize *a_smaller_size)
cr_font_size_get_smaller_predefined: @a_font_size: the font size to consider.
@ FONT_STRETCH_ULTRA_CONDENSED
const gchar * cr_font_weight_to_string(enum CRFontWeight a_code)
cr_font_weight_to_string: @a_code: the font weight to consider.
CRFontFamily * cr_font_family_new(enum CRFontFamilyType a_type, guchar *a_name)
cr_font_family_new: @a_type: the type of font family to create.
@ NB_PREDEFINED_ABSOLUTE_FONT_SIZES
@ FONT_STRETCH_EXTRA_CONDENSED
gboolean cr_font_size_is_set_to_inherit(CRFontSize const *a_this)
cr_font_size_is_set_to_inherit: @a_this: the current instance of CRFontSize.
@ FONT_SIZE_ADJUST_NUMBER
CRFontFamily * cr_font_family_append(CRFontFamily *a_this, CRFontFamily *a_family_to_append)
cr_font_family_append: @a_this: the current instance of CRFontFamily.
enum CRStatus cr_font_size_clear(CRFontSize *a_this)
cr_font_size_clear: @a_this: the current instance of CRFontSize
enum CRFontFamilyType type
enum CRStatus cr_num_copy(CRNum *a_dest, CRNum const *a_src)
cr_num_copy: @a_src: the instance of CRNum to copy.
void cr_font_size_destroy(CRFontSize *a_font_size)
cr_font_size_destroy: @a_font_size: the font size to destroy
@ FONT_STRETCH_EXTRA_EXPANDED
const gchar * cr_font_style_to_string(enum CRFontStyle a_code)
cr_font_style_to_string: @a_code: the current instance of CRFontStyle .
void cr_num_destroy(CRNum *a_this)
cr_num_destroy: @a_this: the this pointer of the current instance of CRNum.
enum CRStatus cr_font_size_copy(CRFontSize *a_dst, CRFontSize const *a_src)
cr_font_size_copy: @a_dst: the destination CRFontSize (where to copy to).
union _CRFontSize::@0 value
guchar * cr_font_family_to_string(CRFontFamily const *a_this, gboolean a_walk_font_family_list)
cr_font_family_to_string: @a_this: the current instance of CRFontFamily.
enum CRStatus cr_font_size_set_predefined_absolute_font_size(CRFontSize *a_this, enum CRPredefinedAbsoluteFontSize a_predefined)
cr_font_size_set_predefined_absolute_font_size: @a_this: the current instance of CRFontSize.
@ FONT_STRETCH_SEMI_CONDENSED
@ FONT_STRETCH_SEMI_EXPANDED
enum CRStatus cr_font_family_destroy(CRFontFamily *a_this)
cr_font_family_destroy: @a_this: the current instance of CRFontFamily.
void cr_font_size_get_larger_predefined_font_size(enum CRPredefinedAbsoluteFontSize a_font_size, enum CRPredefinedAbsoluteFontSize *a_larger_size)
cr_font_size_get_larger_predefined_font_size: @a_font_size: the font size to consider.
enum CRStatus cr_font_size_set_relative_font_size(CRFontSize *a_this, enum CRRelativeFontSize a_relative)
cr_font_size_set_relative_font_size: @a_this: the current instance of CRFontSize @a_relative: the new...
enum CRFontWeight cr_font_weight_get_bolder(enum CRFontWeight a_weight)
cr_font_weight_get_bolder: @a_weight: the CRFontWeight to consider.
@ FONT_SIZE_ADJUST_INHERIT
CRNumType
The different types of numbers.
CRFontFamily * cr_font_family_prepend(CRFontFamily *a_this, CRFontFamily *a_family_to_prepend)
cr_font_family_prepend: @a_this: the current instance CRFontFamily.
@ FONT_STRETCH_ULTRA_EXPANDED
CRStatus
The status type returned by the methods of the croco library.
gchar * cr_font_size_to_string(CRFontSize const *a_this)
cr_font_size_to_string: @a_this: the current instance of CRFontSize
enum CRStatus cr_font_size_set_absolute_font_size(CRFontSize *a_this, enum CRNumType a_num_type, gdouble a_value)
cr_font_size_set_absolute_font_size: @a_this: the current instance of CRFontSize @a_num_type: the typ...
void cr_font_size_adjust_destroy(CRFontSizeAdjust *a_this)
cr_font_size_adjust_destroy: @a_this: the current instance of CRFontSizeAdjust.
@ FONT_FAMILY_NON_GENERIC
CRRelativeFontSize
The different types of relative font size.
enum CRStatus cr_font_size_set_to_inherit(CRFontSize *a_this)
cr_font_size_set_to_inherit: @a_this: the current instance of CRFontSize
enum CRFontSizeAdjustType type
enum CRPredefinedAbsoluteFontSize predefined
@ RELATIVE_FONT_SIZE
If the type of CRFontSize is RELATIVE_FONT_SIZE, the CRFontSize::value.relative field will be defined...
enum CRStatus cr_font_family_set_name(CRFontFamily *a_this, guchar *a_name)
cr_font_family_set_name: @a_this: the current instance of CRFontFamily.
@ FONT_VARIANT_SMALL_CAPS
const gchar * cr_font_stretch_to_string(enum CRFontStretch a_code)
cr_font_stretch_to_string: @a_code: the instance of CRFontStretch to consider.
gboolean cr_font_size_is_predefined_absolute_font_size(enum CRPredefinedAbsoluteFontSize a_font_size)
cr_font_size_is_predefined_absolute_font_size: @a_font_size: the font size to consider.
#define cr_utils_trace_info(a_msg)
Traces an info message.
CRFontSizeAdjust * cr_font_size_adjust_new(void)
cr_font_size_adjust_new:
enum CRRelativeFontSize relative
gchar * cr_font_size_adjust_to_string(CRFontSizeAdjust const *a_this)
cr_font_size_adjust_to_string: @a_this: the instance of CRFontSizeAdjust.
@ ABSOLUTE_FONT_SIZE
If the type of CRFontSize is ABSOLUTE_FONT_SIZE, the CRFontSize::value.absolute field will be defined...