From ced3f0a0abd84de73753956ec18e7316eda33a37 Mon Sep 17 00:00:00 2001 From: Patrick Lam Date: Tue, 29 Nov 2005 00:14:42 +0000 Subject: [PATCH] Fix problem dating back at least to 2.3.2 where globs weren't being applied to patterns loaded from a cache. Fix some obvious spelling mistakes. --- ChangeLog | 13 +++++++++++++ doc/fontconfig-user.sgml | 17 +++++++++-------- src/fccfg.c | 3 ++- src/fcint.h | 3 +++ src/fcpat.c | 4 +--- 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c402be..812bff3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2005-11-28 Patrick Lam + * src/fcint.h: + * src/fcpat.c (FcPatternFindFullFname): + * src/fccfg.c (FcConfigBuildFonts): + + Fix problem dating back at least to 2.3.2 where globs weren't + being applied to patterns loaded from a cache. + +2005-11-28 Patrick Lam + * doc/fontconfig-user.sgml: + + Fix some obvious spelling mistakes. + 2005-11-28 Dirk Mueller Stephan Kulow reviewed by: plam diff --git a/doc/fontconfig-user.sgml b/doc/fontconfig-user.sgml index 5e240dd..79988a3 100644 --- a/doc/fontconfig-user.sgml +++ b/doc/fontconfig-user.sgml @@ -57,7 +57,7 @@ which accepts font patterns and returns the nearest matching font. Font Configuration The configuration module consists of the FcConfig datatype, libexpat and -FcConfigParse which walks over an XML tree and ammends a configuration with +FcConfigParse which walks over an XML tree and amends a configuration with data found within. From an external perspective, configuration of the library consists of generating a valid XML tree and feeding that to FcConfigParse. The only other mechanism provided to applications for @@ -87,17 +87,17 @@ simplify and regularize font installation and customization. While font patterns may contain essentially any properties, there are some well known properties with associated types. Fontconfig uses some of these properties for font matching and font completion. Others are provided as a -convenience for the applications rendering mechanism. +convenience for the applications' rendering mechanism. Property Type Description -------------------------------------------------------------- family String Font family names - familylang String Languages cooresponding to each family + familylang String Languages corresponding to each family style String Font style. Overrides weight and slant - stylelang String Languages cooresponding to each style + stylelang String Languages corresponding to each style fullname String Font full names (often includes style) - fullnamelang String Languages cooresponding to each fullname + fullnamelang String Languages corresponding to each fullname slant Int Italic, oblique or roman weight Int Light, medium, demibold, bold or black size Double Point size @@ -285,7 +285,7 @@ default "no", a missing file or directory will elicit no warning message from the library. <sgmltag>config</> -This element provides a place to consolodate additional configuration +This element provides a place to consolidate additional configuration information. config can contain blank and rescan elements in any order. @@ -324,7 +324,8 @@ Glob elements hold shell-style filename matching patterns (including ? and *) which match fonts based on their complete pathnames. This can be used to exclude a set of directories (/usr/share/fonts/uglyfont*), or particular font file types (*.pcf.gz), but the latter mechanism relies rather heavily -on filenaming conventions which can't be relied upon. +on filenaming conventions which can't be relied upon. Note that globs +only apply to directories, not to individual fonts. <sgmltag>pattern</> Pattern elements perform list-style matching on incoming fonts; that is, @@ -470,7 +471,7 @@ operations needed to substitute one font family for another. They contain a family element followed by optional prefer, accept and default elements. Fonts matching the family element are edited to prepend the list of prefered families before the matching family, append the -acceptable familys after the matching family and append the default +acceptable families after the matching family and append the default families to the end of the family list. <sgmltag>family</> diff --git a/src/fccfg.c b/src/fccfg.c index 4543553..3ba1ae9 100644 --- a/src/fccfg.c +++ b/src/fccfg.c @@ -308,7 +308,8 @@ FcConfigBuildFonts (FcConfig *config) for (i = 0; i < cached_fonts->nfont; i++) { - if (FcConfigAcceptFont (config, cached_fonts->fonts[i])) + if (FcConfigAcceptFont (config, cached_fonts->fonts[i]) && + FcConfigAcceptFilename (config, (FcChar8 *)FcPatternFindFullFname(cached_fonts->fonts[i]))) FcFontSetAdd (fonts, cached_fonts->fonts[i]); cached_fonts->fonts[i] = 0; /* prevent free in FcFontSetDestroy */ diff --git a/src/fcint.h b/src/fcint.h index 561c5cb..9b833f7 100644 --- a/src/fcint.h +++ b/src/fcint.h @@ -848,6 +848,9 @@ FcPatternAppend (FcPattern *p, FcPattern *s); void FcPatternAddFullFname (const FcPattern *p, const char *fname); +const char * +FcPatternFindFullFname (const FcPattern *p); + void FcPatternTransferFullFname (const FcPattern *new, const FcPattern *orig); diff --git a/src/fcpat.c b/src/fcpat.c index cc87ff0..cba9991 100644 --- a/src/fcpat.c +++ b/src/fcpat.c @@ -34,8 +34,6 @@ static int fcpatternelt_ptr, fcpatternelt_count; FcValueList ** _fcValueLists = 0; static int fcvaluelist_bank_count = 0, fcvaluelist_ptr, fcvaluelist_count; -static const char * -FcPatternFindFullFname (const FcPattern *p); static FcPatternEltPtr FcPatternEltPtrCreateDynamic (FcPatternElt * e); @@ -2016,7 +2014,7 @@ FcPatternAddFullFname (const FcPattern *p, const char *fname) pb->next->m.fname = fname; } -static const char * +const char * FcPatternFindFullFname (const FcPattern *p) { struct patternDirBucket *pb; -- 2.39.5