diff options
author | Keith Packard <keithp@keithp.com> | 2002-02-19 07:50:44 +0000 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2002-02-19 07:50:44 +0000 |
commit | aae6f7d48744a25899cac28d47458f394defa02a (patch) | |
tree | 0a4b1c81c813e4f521fda78c10b887048ff9b037 /src | |
parent | c2e7c611cbef33e9f93fbb110cd8df61abec67d7 (diff) |
Eliminate const in FcPatternGetString; too hard. Add FcCharSetCoverage to
enumarate Unicode coverage efficiently
Diffstat (limited to 'src')
-rw-r--r-- | src/fccache.c | 4 | ||||
-rw-r--r-- | src/fccharset.c | 23 | ||||
-rw-r--r-- | src/fcpat.c | 6 |
3 files changed, 27 insertions, 6 deletions
diff --git a/src/fccache.c b/src/fccache.c index 47771465..aba1284b 100644 --- a/src/fccache.c +++ b/src/fccache.c @@ -1,5 +1,5 @@ /* - * $XFree86: $ + * $XFree86: xc/lib/fontconfig/src/fccache.c,v 1.2 2002/02/15 06:01:27 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -590,7 +590,7 @@ FcFileCacheWriteDir (FcFontSet *set, const FcChar8 *cache_file) for (n = 0; n < set->nfont; n++) { font = set->fonts[n]; - if (FcPatternGetString (font, FC_FILE, 0, &file) != FcResultMatch) + if (FcPatternGetString (font, FC_FILE, 0, (FcChar8 **) &file) != FcResultMatch) goto bail1; base = (FcChar8 *) strrchr ((char *) file, '/'); if (base) diff --git a/src/fccharset.c b/src/fccharset.c index 4652309a..c764c43e 100644 --- a/src/fccharset.c +++ b/src/fccharset.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/fontconfig/src/fccharset.c,v 1.2 2002/02/15 06:01:28 keithp Exp $ + * $XFree86: xc/lib/fontconfig/src/fccharset.c,v 1.3 2002/02/18 22:29:28 keithp Exp $ * * Copyright © 2001 Keith Packard, member of The XFree86 Project, Inc. * @@ -557,6 +557,27 @@ FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b) return count; } +FcChar32 +FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result) +{ + FcCharSetIter ai; + + ai.ucs4 = page; + FcCharSetIterSet (a, &ai); + if (!ai.leaf) + { + memset (result, '\0', 256 / 8); + page = 0; + } + else + { + memcpy (result, ai.leaf->map, sizeof (ai.leaf->map)); + FcCharSetIterNext (a, &ai); + page = ai.ucs4; + } + return page; +} + /* * ASCII representation of charsets. * diff --git a/src/fcpat.c b/src/fcpat.c index 88bca916..55b1e71a 100644 --- a/src/fcpat.c +++ b/src/fcpat.c @@ -1,5 +1,5 @@ /* - * $XFree86: $ + * $XFree86: xc/lib/fontconfig/src/fcpat.c,v 1.2 2002/02/15 06:01:28 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -384,7 +384,7 @@ FcPatternGetDouble (FcPattern *p, const char *object, int id, double *d) } FcResult -FcPatternGetString (FcPattern *p, const char *object, int id, FcChar8 const ** s) +FcPatternGetString (FcPattern *p, const char *object, int id, FcChar8 ** s) { FcValue v; FcResult r; @@ -394,7 +394,7 @@ FcPatternGetString (FcPattern *p, const char *object, int id, FcChar8 const ** s return r; if (v.type != FcTypeString) return FcResultTypeMismatch; - *s = v.u.s; + *s = (FcChar8 *) v.u.s; return FcResultMatch; } |