diff options
Diffstat (limited to 'fontconfig')
-rw-r--r-- | fontconfig/configure.in | 1 | ||||
-rw-r--r-- | fontconfig/src/fcarch.c | 4 | ||||
-rw-r--r-- | fontconfig/src/fccfg.c | 2 | ||||
-rw-r--r-- | fontconfig/src/fcdbg.c | 79 | ||||
-rw-r--r-- | fontconfig/src/fcint.h | 8 |
5 files changed, 67 insertions, 27 deletions
diff --git a/fontconfig/configure.in b/fontconfig/configure.in index b77c52a29..b2174d99b 100644 --- a/fontconfig/configure.in +++ b/fontconfig/configure.in @@ -110,7 +110,6 @@ dnl ========================================================================== AC_ARG_WITH(arch, [AC_HELP_STRING([--with-arch=ARCH], [Force architecture to ARCH])], - , arch="$withval", arch=auto) if test "x$arch" != xauto; then diff --git a/fontconfig/src/fcarch.c b/fontconfig/src/fcarch.c index 09d24b31b..5fe7d97d8 100644 --- a/fontconfig/src/fcarch.c +++ b/fontconfig/src/fcarch.c @@ -56,7 +56,9 @@ FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcStrSet *)); FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcCharLeaf **)); FC_ASSERT_STATIC (SIZEOF_VOID_P == sizeof (FcChar16 *)); -FC_ASSERT_STATIC (0x08 + 1*ALIGNOF_DOUBLE == sizeof (FcValue)); +#define FC_MAX(a,b) ((a) > (b) ? (a) : (b)) + +FC_ASSERT_STATIC (0x08 + 1*FC_MAX(4,ALIGNOF_DOUBLE) == sizeof (FcValue)); FC_ASSERT_STATIC (0x00 + 2*SIZEOF_VOID_P == sizeof (FcPatternElt)); FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcPattern)); FC_ASSERT_STATIC (0x08 + 2*SIZEOF_VOID_P == sizeof (FcCharSet)); diff --git a/fontconfig/src/fccfg.c b/fontconfig/src/fccfg.c index 0d0b778d2..f9cdaaf46 100644 --- a/fontconfig/src/fccfg.c +++ b/fontconfig/src/fccfg.c @@ -1302,7 +1302,7 @@ FcConfigAdd (FcValueListPtr *head, if (FcDebug () & FC_DBG_EDIT) { printf ("%s list before ", append ? "Append" : "Prepend"); - FcValueListPrint (*head); + FcValueListPrintWithPosition (*head, *prev); printf ("\n"); } diff --git a/fontconfig/src/fcdbg.c b/fontconfig/src/fcdbg.c index cf2ff0870..10f3cc9aa 100644 --- a/fontconfig/src/fcdbg.c +++ b/fontconfig/src/fcdbg.c @@ -26,59 +26,92 @@ #include <stdio.h> #include <stdlib.h> -void -FcValuePrint (const FcValue v) +static void +_FcValuePrint (const FcValue v) { switch (v.type) { case FcTypeVoid: - printf (" <void>"); + printf ("<void>"); break; case FcTypeInteger: - printf (" %d(i)", v.u.i); + printf ("%d(i)", v.u.i); break; case FcTypeDouble: - printf (" %g(f)", v.u.d); + printf ("%g(f)", v.u.d); break; case FcTypeString: - printf (" \"%s\"", v.u.s); + printf ("\"%s\"", v.u.s); break; case FcTypeBool: - printf (" %s", v.u.b ? "FcTrue" : "FcFalse"); + printf ("%s", v.u.b ? "FcTrue" : "FcFalse"); break; case FcTypeMatrix: - printf (" (%f %f; %f %f)", v.u.m->xx, v.u.m->xy, v.u.m->yx, v.u.m->yy); + printf ("(%f %f; %f %f)", v.u.m->xx, v.u.m->xy, v.u.m->yx, v.u.m->yy); break; case FcTypeCharSet: /* XXX */ - printf (" "); FcCharSetPrint (v.u.c); break; case FcTypeLangSet: - printf (" "); FcLangSetPrint (v.u.l); break; case FcTypeFTFace: - printf (" face"); + printf ("face"); break; } } void +FcValuePrint (const FcValue v) +{ + printf (" "); + _FcValuePrint (v); +} + +void +FcValuePrintWithPosition (const FcValue v, FcBool show_pos_mark) +{ + if (show_pos_mark) + printf (" [insert here] "); + else + printf (" "); + _FcValuePrint (v); +} + +static void +FcValueBindingPrint (const FcValueListPtr l) +{ + switch (l->binding) { + case FcValueBindingWeak: + printf ("(w)"); + break; + case FcValueBindingStrong: + printf ("(s)"); + break; + case FcValueBindingSame: + printf ("(=)"); + break; + } +} + +void +FcValueListPrintWithPosition (FcValueListPtr l, const FcValueListPtr pos) +{ + for (; l != NULL; l = FcValueListNext(l)) + { + FcValuePrintWithPosition (FcValueCanonicalize (&l->value), pos != NULL && l == pos); + FcValueBindingPrint (l); + } + if (!pos) + printf (" [insert here]"); +} + +void FcValueListPrint (FcValueListPtr l) { for (; l != NULL; l = FcValueListNext(l)) { - FcValuePrint (FcValueCanonicalize(&l->value)); - switch (l->binding) { - case FcValueBindingWeak: - printf ("(w)"); - break; - case FcValueBindingStrong: - printf ("(s)"); - break; - case FcValueBindingSame: - printf ("(=)"); - break; - } + FcValuePrint (FcValueCanonicalize (&l->value)); + FcValueBindingPrint (l); } } diff --git a/fontconfig/src/fcint.h b/fontconfig/src/fcint.h index 0a59f70ac..1ed2df3e1 100644 --- a/fontconfig/src/fcint.h +++ b/fontconfig/src/fcint.h @@ -703,7 +703,13 @@ FcCharSetGetNumbers(const FcCharSet *c); /* fcdbg.c */ FcPrivate void -FcValueListPrint (const FcValueListPtr l); +FcValuePrintWithPosition (const FcValue v, FcBool show_pos_mark); + +FcPrivate void +FcValueListPrintWithPosition (FcValueListPtr l, const FcValueListPtr pos); + +FcPrivate void +FcValueListPrint (FcValueListPtr l); FcPrivate void FcLangSetPrint (const FcLangSet *ls); |