[poppler] 2 commits - poppler/GlobalParams.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Mar 9 15:34:15 PDT 2008


 poppler/GlobalParams.cc |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 94ceb3cae79dc7786fa59fd889a87160780ed5df
Merge: 0f9e843... 35f34bd...
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Mar 9 23:34:11 2008 +0100

    Merge branch 'master' of ssh://aacid@git.freedesktop.org/git/poppler/poppler

commit 0f9e84302ac2108f05bdbb10e7e57ae19ad1e9f3
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Mar 9 23:33:11 2008 +0100

    Do not force default values to fontconfig patterns as fontconfig already fills in default values for us
    
    Fixes bug 14883

diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index 21b5044..925a602 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -928,10 +928,10 @@ GBool findModifier(const char *name, const char *modifier, const char **start)
 #ifndef _MSC_VER
 static FcPattern *buildFcPattern(GfxFont *font)
 {
-  int weight = FC_WEIGHT_NORMAL,
-      slant = FC_SLANT_ROMAN,
-      width = FC_WIDTH_NORMAL,
-      spacing = FC_PROPORTIONAL;
+  int weight = -1,
+      slant = -1,
+      width = -1,
+      spacing = -1;
   bool deleteFamily = false;
   char *family, *name, *lang, *modifiers;
   const char *start;
@@ -1057,12 +1057,13 @@ static FcPattern *buildFcPattern(GfxFont *font)
   
   p = FcPatternBuild(NULL,
                     FC_FAMILY, FcTypeString, family,
-                    FC_SLANT, FcTypeInteger, slant, 
-                    FC_WEIGHT, FcTypeInteger, weight,
-                    FC_WIDTH, FcTypeInteger, width, 
-                    FC_SPACING, FcTypeInteger, spacing,
                     FC_LANG, FcTypeString, lang,
                     NULL);
+  if (slant != -1) FcPatternAddInteger(p, FC_SLANT, slant);
+  if (weight != -1) FcPatternAddInteger(p, FC_WEIGHT, weight);
+  if (width != -1) FcPatternAddInteger(p, FC_WIDTH, width);
+  if (spacing != -1) FcPatternAddInteger(p, FC_SPACING, spacing);
+
   if (deleteFamily)
     delete[] family;
   return p;


More information about the poppler mailing list