View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0015982 | Scribus | Internal | public | 2019-12-02 10:45 | 2020-04-05 19:37 |
| Reporter | ale | Assigned To | ale | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | 1.5.6.svn | ||||
| Fixed in Version | 1.5.6.svn | ||||
| Summary | 0015982: Remove #elif-ed code that cannot compile in scfonts.cpp | ||||
| Description | this branch https://gitlab.com/scribus/scribus/blob/master/scribus/scfonts.cpp#L1193 cannot compile pos2 = paths.find("\n",pos+1); QString does not seem to have a find() function. .... and i don't think that we can have a linux build without fontconfig... | ||||
| Tags | No tags attached. | ||||
| Attached Files | |||||
| Patch | Yes | ||||
|
|
the same #elif in can also probably be removed in scfonts.h |
|
|
the "dead branch" is because it's an elif to "if fontconfig"... and i don't think it's possible to have a linux system without fontconfig. |
|
|
here is the patch scfonts-no-linux-without-fontconfig.diff (2,531 bytes)
diff --git a/scribus/scfonts.cpp b/scribus/scfonts.cpp
index ac3f87733..ecfac34b2 100644
--- a/scribus/scfonts.cpp
+++ b/scribus/scfonts.cpp
@@ -1190,71 +1190,6 @@ void SCFonts::addType1RegistryFonts()
FT_Done_FreeType(library);
}
-#elif defined(Q_OS_LINUX)
-
-void SCFonts::addXFontPath()
-{
- int pathcount,i;
- Display *display=XOpenDisplay(nullptr);
- char **fontpath=XGetFontPath(display,&pathcount);
- for (i=0; i<pathcount; ++i)
- addPath(fontpath[i]);
- XFreeFontPath(fontpath);
-}
-
-/* replacement for addXFontServerPath() for correctly parsing
- * RedHad-Style /etc/X11/fs/config files */
-
-void SCFonts::addXFontServerPath()
-{
- QFile fs("/etc/X11/fs/config");
- if (!(fs.exists()))
- {
- fs.setName("/usr/X11R6/lib/X11/fs/config");
- if (!(fs.exists()))
- {
- fs.setName("/usr/X11/lib/X11/fs/config");
- if (!(fs.exists()))
- return;
- }
- }
-
- if (fs.open(QIODevice::ReadOnly))
- {
- QString fsconfig,paths,tmp;
- QTextStream tsx(&fs);
- fsconfig = tsx.readAll();
- fs.close();
-
- int pos = fsconfig.find("catalogue");
- paths = fsconfig.mid(pos);
- paths = paths.mid(paths.find("=")+1);
-
- pos=0;
- do {
- pos = paths.find("\n",pos+1);
- } while (pos > -1 && paths.mid(pos-1, 1) == ",");
-
- if (pos<0) pos=paths.length();
- paths = paths.left(pos);
- paths = paths.simplified();
- paths.replace(QRegExp(" "), "");
- paths.replace(QRegExp(","), "\n");
- paths += "\n";
- paths = paths.trimmed();
-
- pos=-1;
- do {
- int pos2;
- pos2 = paths.find("\n",pos+1);
- tmp = paths.mid(pos+1,(pos2-pos)-1);
- pos=pos2;
-
- addPath(tmp);
-
- } while (pos > -1);
- }
-}
#endif
/* Add an extra path to our font search path,
@@ -1387,12 +1322,7 @@ void SCFonts::getFonts(const QString& pf, bool showFontInfo)
addScalableFonts(*fpi);
addFontconfigFonts();
#else
-// on X11 look there:
-#ifdef Q_OS_LINUX
- addXFontPath();
- addXFontServerPath();
-#endif
-// add user and X11 fonts:
+ // add user and X11 fonts:
QStringList::iterator fpi, fpend = m_fontPaths.end();
for (fpi = m_fontPaths.begin() ; fpi != fpend; ++fpi)
addScalableFonts(*fpi);
diff --git a/scribus/scfonts.h b/scribus/scfonts.h
index 09c8b63cf..d4e78ff74 100644
--- a/scribus/scfonts.h
+++ b/scribus/scfonts.h
@@ -73,9 +73,6 @@ class SCRIBUS_API SCFonts : public QMap<QString,ScFace>
#elif defined(Q_OS_WIN32)
void addRegistryFonts();
void addType1RegistryFonts();
-#elif defined(Q_OS_LINUX)
- void addXFontServerPath();
- void addXFontPath();
#endif
QStringList m_fontPaths;
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2019-12-02 10:45 | ale | New Issue | |
| 2019-12-02 10:49 | ale | Note Added: 0047189 | |
| 2019-12-09 08:15 | ale | Note Added: 0047224 | |
| 2019-12-10 10:10 | ale | File Added: scfonts-no-linux-without-fontconfig.diff | |
| 2019-12-10 10:10 | ale | Note Added: 0047237 | |
| 2019-12-10 10:10 | ale | Note Edited: 0047237 | |
| 2019-12-10 10:12 | ale | Summary | remove #elif-ed code that cannot compile in scfonts.cpp => [PATCH] remove #elif-ed code that cannot compile in scfonts.cpp |
| 2019-12-10 10:12 | ale | Patch | No => Yes |
| 2020-01-04 13:09 | jghali | Category | Build System => Internal |
| 2020-01-04 13:09 | jghali | Summary | [PATCH] remove #elif-ed code that cannot compile in scfonts.cpp => Remove #elif-ed code that cannot compile in scfonts.cpp |
| 2020-01-04 13:10 | jghali | Assigned To | => ale |
| 2020-01-04 13:10 | jghali | Status | new => resolved |
| 2020-01-04 13:10 | jghali | Resolution | open => fixed |
| 2020-01-04 13:10 | jghali | Fixed in Version | => 1.5.6.svn |
| 2020-04-05 19:37 | cbradney | Status | resolved => closed |