From f745335958993fa092d1264654dc365a5330c260 Mon Sep 17 00:00:00 2001 From: Marc Maurer Date: Apr 06 2007 16:10:03 +0000 Subject: Forgot to cvs add this file --- diff --git a/abiword-2.4.6-fontmanager.patch b/abiword-2.4.6-fontmanager.patch new file mode 100644 index 0000000..8fe81f4 --- /dev/null +++ b/abiword-2.4.6-fontmanager.patch @@ -0,0 +1,124 @@ +diff -r -u abiword-2.4.6.orig/abi/src/af/xap/unix/xap_UnixFontManager.cpp abiword-2.4.6/abi/src/af/xap/unix/xap_UnixFontManager.cpp +--- abiword-2.4.6.orig/abi/src/af/xap/unix/xap_UnixFontManager.cpp 2006-05-12 15:08:58.000000000 +0200 ++++ abiword-2.4.6/abi/src/af/xap/unix/xap_UnixFontManager.cpp 2007-04-06 17:36:20.000000000 +0200 +@@ -87,7 +87,7 @@ + return pVec; + } + +-static XAP_UnixFont* buildFont(XAP_UnixFontManager* pFM, FcPattern* fp) ++static void buildFonts(XAP_UnixFontManager* pFM, FcPattern* fp, UT_GenericVector& vFonts) + { + unsigned char* fontFile = NULL; + bool bold = false; +@@ -102,7 +102,7 @@ + { + // ok, and now what? If we can not get the font file of the font, we can not print it! + UT_DEBUGMSG(("Unknown font file!!\n")); +- return false; ++ return; + } + + if (FcPatternGetInteger(fp, FC_WEIGHT, 0, &weight) != FcResultMatch) +@@ -117,7 +117,7 @@ + size_t ffs = metricFile.size(); + if ( !((ffs >= 4 && fontFile[ffs - 4] == '.') || + (ffs >= 5 && fontFile[ffs - 5] == '.') )) // Separate check to avoid [-1] +- return NULL; ++ return; + + // handle '.font' + if (fontFile[ffs - 5] == '.') +@@ -137,9 +137,6 @@ + char* xlfd = reinterpret_cast(FcNameUnparse(fp)); + // UT_String sXLFD = xlfd; + // UT_ASSERT(sXLFD.size() < 100); +- // get the family of the font +- unsigned char *family; +- FcPatternGetString(fp, FC_FAMILY, 0, &family); + + XAP_UnixFont::style s = XAP_UnixFont::STYLE_NORMAL; + +@@ -158,19 +155,31 @@ + break; + } + +- XAP_UnixFont* font = new XAP_UnixFont(pFM); +- /* we try to open the font. If we fail, we try to open it removing the bold/italic info, if we fail again, we don't try again */ +- if (!font->openFileAs(reinterpret_cast(fontFile), metricFile.utf8_str(), reinterpret_cast(family), xlfd, s) && +- !font->openFileAs(reinterpret_cast(fontFile), metricFile.utf8_str(), reinterpret_cast(family), xlfd, XAP_UnixFont::STYLE_NORMAL)) +- { +- UT_DEBUGMSG(("Impossible to open font file [%s] [%d]\n.", reinterpret_cast(fontFile), s)); +- font->setFontManager(NULL); // This font isn't in the FontManager cache (yet), so it doesn't need to unregister itself +- delete font; +- font = NULL; +- } ++ unsigned char *family; ++ int id; ++ ++ id = 0; ++ // get the families of the font ++ while (FcPatternGetString(fp, FC_FAMILY, id, &family) == FcResultMatch) ++ { ++ ++ XAP_UnixFont* font = new XAP_UnixFont(pFM); ++ /* we try to open the font. If we fail, we try to open it removing the bold/italic info, if we fail again, we don't try again */ ++ if (!font->openFileAs(reinterpret_cast(fontFile), metricFile.utf8_str(), reinterpret_cast(family), xlfd, s) && ++ !font->openFileAs(reinterpret_cast(fontFile), metricFile.utf8_str(), reinterpret_cast(family), xlfd, XAP_UnixFont::STYLE_NORMAL)) ++ { ++ UT_DEBUGMSG(("Impossible to open font file [%s] [%d]\n.", reinterpret_cast(fontFile), s)); ++ font->setFontManager(NULL); // This font isn't in the FontManager cache (yet), so it doesn't need to unregister itself ++ DELETEP(font); ++ } ++ else ++ { ++ vFonts.addItem(font); ++ } ++ id++; ++ } + + free(xlfd); +- return font; + } + + /* add to the cache all the scalable fonts that we find */ +@@ -180,29 +189,24 @@ + return true; + + FcFontSet* fs; +- XAP_UnixFont* pFont; +- + fs = FcConfigGetFonts(FcConfigGetCurrent(), FcSetSystem); +- +- if (fs) +- { ++ if (fs) ++ { + m_pFontSet = FcFontSetCreate(); +- + for (UT_sint32 j = 0; j < fs->nfont; j++) + { +- // we want to create two fonts: one layout, and one device. +- + /* if the font file ends on .ttf, .pfa or .pfb we add it */ +- pFont = buildFont(this, fs->fonts[j]); +- +- if (pFont) +- { ++ UT_GenericVector vFonts; ++ buildFonts(this, fs->fonts[j], vFonts); ++ if (vFonts.size() > 0) + FcFontSetAdd(m_pFontSet, fs->fonts[j]); +- _addFont(pFont,NULL); +- } ++ for (UT_uint32 i = 0; i < vFonts.size(); i++) ++ { ++ XAP_UnixFont *pFont = vFonts.getNthItem(i); ++ _addFont(pFont, NULL); ++ } + } +- +- } ++ } + + return true; + } diff --git a/abiword.spec b/abiword.spec index d0ec23a..a9f17cb 100644 --- a/abiword.spec +++ b/abiword.spec @@ -3,7 +3,7 @@ Summary: The AbiWord word processor Name: abiword Version: 2.4.6 -Release: 4%{?dist} +Release: 5%{?dist} Epoch: 1 Group: Applications/Editors License: GPL @@ -132,6 +132,9 @@ update-desktop-database %{_datadir}/applications %{_datadir}/icons/*png %changelog +* Fri Apr 06 2007 Marc Maurer - 1:2.4.6-5.fc7 +- Rebuild + * Fri Apr 06 2007 Marc Maurer - 1:2.4.6-4.fc7 - Fix 234765