filefilterlist.h
filename.h
filetools.h
- fontutils.h
forkedcall.h
forkedcallqueue.h
forkedcontr.h
filefilterlist.C
filename.C
filetools.C
- fontutils.C
forkedcall.C
forkedcallqueue.C
forkedcontr.C
lyxclient_LDADD = \
$(top_builddir)/src/support/libsupport.la \
- $(BOOST_LIBS) $(LIBICONV) $(INTLLIBS) $(SOCKET_LIBS)
+ $(BOOST_LIBS) $(LIBICONV) $(INTLLIBS) @LIBS@ $(SOCKET_LIBS)
lyxclient_SOURCES = \
boost.C \
#include "support/filefilterlist.h"
#include "support/filetools.h"
-#include "support/fontutils.h"
#include "support/forkedcall.h"
#include "support/fs_extras.h"
#include "support/lyxlib.h"
#include "support/environment.h"
#include "support/filetools.h"
-#include "support/fontutils.h"
#include "support/lyxlib.h"
#include "support/convert.h"
#include "support/os.h"
}
// Force adding of font path _before_ Application is initialized
- support::addFontResources();
+ support::os::addFontResources();
// Let the frontend parse and remove all arguments that it knows
pimpl_->application_.reset(createApplication(argc, argv));
prepareExit();
// Restore original font resources after Application is destroyed.
- support::restoreFontResources();
+ support::os::restoreFontResources();
return exit_status;
}
filename.h \
filetools.C \
filetools.h \
- fontutils.C \
- fontutils.h \
forkedcall.C \
forkedcall.h \
forkedcallqueue.C \
for (; it != end; ++it) {
if (it != begin)
ss << separator;
-#if defined(__CYGWIN__) || defined(__CYGWIN32__)
- // On cygwin, os::external_path returns either posix or
- // pseudo-win style paths, but here we always need posix style.
- // This fixes bug 2344.
- ss << os::internal_path(*it);
-#else
ss << os::external_path(*it);
-#endif
}
setEnv(name, ss.str());
}
+++ /dev/null
-/**
- * \file fontutils.C
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Asger Alstrup
- * \author John Levon
- *
- * Full author contact details are available in file CREDITS.
- *
- * General font utilities.
- */
-
-#include <config.h>
-
-#include "fontutils.h"
-
-#include "support/filetools.h"
-#include "support/lstrings.h"
-#include "support/systemcall.h"
-
-#ifdef __APPLE__
-#include "debug.h"
-#include <ApplicationServices/ApplicationServices.h>
-using std::endl;
-#endif
-
-#if defined(_WIN32) || (defined(__CYGWIN__) && defined(X_DISPLAY_MISSING))
-#include "windows.h"
-#ifdef max
-#undef max
-#endif
-#ifdef min
-#undef min
-#endif
-#include "support/os.h"
-#include "support/package.h"
-#include "support/path.h"
-using lyx::support::addName;
-using lyx::support::addPath;
-using lyx::support::package;
-namespace os = lyx::support::os;
-
-using std::string;
-
-string const win_fonts_truetype[] = {"cmex10", "cmmi10", "cmr10", "cmsy10",
- "eufm10", "msam10", "msbm10", "wasy10", "esint10"};
-const int num_fonts_truetype = sizeof(win_fonts_truetype) / sizeof(*win_fonts_truetype);
-#endif
-
-
-namespace lyx {
-namespace support {
-
-void addFontResources()
-{
-#ifdef __APPLE__
- CFBundleRef myAppBundle = CFBundleGetMainBundle();
- CFURLRef myAppResourcesURL, FontsURL;
- FSRef fontDirRef;
- FSSpec fontDirSpec;
- CFStringRef filePath = CFStringCreateWithBytes(kCFAllocatorDefault,
- (UInt8 *) "Fonts", strlen("Fonts"),
- kCFStringEncodingISOLatin1, false);
-
- myAppResourcesURL = CFBundleCopyResourcesDirectoryURL(myAppBundle);
- FontsURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault,
- myAppResourcesURL, filePath, true);
- if (lyxerr.debugging(Debug::FONT)) {
- UInt8 buf[255];
- if (CFURLGetFileSystemRepresentation(FontsURL, true, buf, 255))
- lyxerr << "Adding Fonts directory: " << buf << endl;
- }
- CFURLGetFSRef (FontsURL, &fontDirRef);
- OSStatus err = FSGetCatalogInfo (&fontDirRef, kFSCatInfoNone,
- NULL, NULL, &fontDirSpec, NULL);
- if (err)
- lyxerr << "FSGetCatalogInfo err = " << err << endl;
- err = FMActivateFonts (&fontDirSpec, NULL, NULL,
- kFMLocalActivationContext);
- if (err)
- lyxerr << "FMActivateFonts err = " << err << endl;
-#endif
-
-#if defined(_WIN32) || (defined(__CYGWIN__) && defined(X_DISPLAY_MISSING))
- // Windows only: Add BaKoMa TrueType font resources
- string const fonts_dir = addPath(package().system_support(), "fonts");
-
- for (int i = 0 ; i < num_fonts_truetype ; ++i) {
- string const font_current =
- addName(fonts_dir, win_fonts_truetype[i] + ".ttf");
- AddFontResource(os::external_path(font_current).c_str());
- }
-#endif
-}
-
-
-void restoreFontResources()
-{
-#if defined(_WIN32) || (defined(__CYGWIN__) && defined(X_DISPLAY_MISSING))
- // Windows only: Remove BaKoMa TrueType font resources
- string const fonts_dir = addPath(package().system_support(), "fonts");
-
- for(int i = 0 ; i < num_fonts_truetype ; ++i) {
- string const font_current =
- addName(fonts_dir, win_fonts_truetype[i] + ".ttf");
- RemoveFontResource(os::external_path(font_current).c_str());
- }
-#endif
-}
-
-} //namespace support
-} // namespace lyx
+++ /dev/null
-// -*- C++ -*-
-/**
- * \file fontutils.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author John Levon
- *
- * Full author contact details are available in file CREDITS.
- *
- * General font utilities.
- * FIXME: only MAC and WIN32 for now but it would be nice to convince
- * fontconfig to do the same for linux.
- */
-
-#ifndef LYX_FONTUTILS_H
-#define LYX_FONTUTILS_H
-
-namespace lyx {
-namespace support {
-
-/// Add fonts to the font subsystem, must be called before Application
-/// is initialized.
-void addFontResources();
-
-/// Restore original font resources, must be called after Application
-/// is destroyed.
-void restoreFontResources();
-
-} // namespace support
-} // namespace lyx
-
-#endif
*/
bool autoOpenFile(std::string const & filename, auto_open_mode const mode = VIEW);
+/** General font utilities.
+ * FIXME: only MAC and WIN32 for now but it would be nice to convince
+ * fontconfig to do the same for linux.
+ */
+
+/// Add fonts to the font subsystem, must be called before Application
+/// is initialized.
+void addFontResources();
+
+/// Restore original font resources, must be called after Application
+/// is destroyed.
+void restoreFontResources();
+
} // namespace os
} // namespace support
} // namespace lyx
using lyx::support::contains;
+#ifdef X_DISPLAY_MISSING
+#include "support/filetools.h"
+#include "support/package.h"
+#include "support/path.h"
+using lyx::support::addName;
+using lyx::support::addPath;
+using lyx::support::package;
+
+string const win_fonts_truetype[] = {"cmex10", "cmmi10", "cmr10", "cmsy10",
+ "eufm10", "msam10", "msbm10", "wasy10", "esint10"};
+const int num_fonts_truetype = sizeof(win_fonts_truetype) / sizeof(*win_fonts_truetype);
+#endif
+
namespace lyx {
namespace support {
string external_path(string const & p)
{
-#ifdef X_DISPLAY_MISSING
- return convert_path(p, PathStyle(windows));
-#else
return convert_path(p, PathStyle(posix));
-#endif
}
string external_path_list(string const & p)
{
-#ifdef X_DISPLAY_MISSING
- return convert_path_list(p, PathStyle(windows));
-#else
return convert_path_list(p, PathStyle(posix));
-#endif
}
}
+void addFontResources()
+{
+#ifdef X_DISPLAY_MISSING
+ // Windows only: Add BaKoMa TrueType font resources
+ string const fonts_dir = addPath(package().system_support(), "fonts");
+
+ for (int i = 0 ; i < num_fonts_truetype ; ++i) {
+ string const font_current = convert_path(
+ addName(fonts_dir, win_fonts_truetype[i] + ".ttf"),
+ PathStyle(windows));
+ AddFontResource(font_current.c_str());
+ }
+#endif
+}
+
+
+void restoreFontResources()
+{
+#ifdef X_DISPLAY_MISSING
+ // Windows only: Remove BaKoMa TrueType font resources
+ string const fonts_dir = addPath(package().system_support(), "fonts");
+
+ for(int i = 0 ; i < num_fonts_truetype ; ++i) {
+ string const font_current = convert_path(
+ addName(fonts_dir, win_fonts_truetype[i] + ".ttf"),
+ PathStyle(windows));
+ RemoveFontResource(font_current.c_str());
+ }
+#endif
+}
+
} // namespace os
} // namespace support
} // namespace lyx
#include "support/os.h"
#ifdef __APPLE__
+#include "debug.h"
#include <Carbon/Carbon.h>
+#include <ApplicationServices/ApplicationServices.h>
+using std::endl;
#endif
using std::string;
#endif
}
+
+void addFontResources()
+{
+#ifdef __APPLE__
+ CFBundleRef myAppBundle = CFBundleGetMainBundle();
+ CFURLRef myAppResourcesURL, FontsURL;
+ FSRef fontDirRef;
+ FSSpec fontDirSpec;
+ CFStringRef filePath = CFStringCreateWithBytes(kCFAllocatorDefault,
+ (UInt8 *) "Fonts", strlen("Fonts"),
+ kCFStringEncodingISOLatin1, false);
+
+ myAppResourcesURL = CFBundleCopyResourcesDirectoryURL(myAppBundle);
+ FontsURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault,
+ myAppResourcesURL, filePath, true);
+ if (lyxerr.debugging(Debug::FONT)) {
+ UInt8 buf[255];
+ if (CFURLGetFileSystemRepresentation(FontsURL, true, buf, 255))
+ lyxerr << "Adding Fonts directory: " << buf << endl;
+ }
+ CFURLGetFSRef (FontsURL, &fontDirRef);
+ OSStatus err = FSGetCatalogInfo (&fontDirRef, kFSCatInfoNone,
+ NULL, NULL, &fontDirSpec, NULL);
+ if (err)
+ lyxerr << "FSGetCatalogInfo err = " << err << endl;
+ err = FMActivateFonts (&fontDirSpec, NULL, NULL,
+ kFMLocalActivationContext);
+ if (err)
+ lyxerr << "FMActivateFonts err = " << err << endl;
+#endif
+}
+
+
+void restoreFontResources()
+{}
+
} // namespace os
} // namespace support
} // namespace lyx
#include "support/os_win32.h"
#include "support/lstrings.h"
#include "support/filetools.h"
+#include "support/package.h"
+#include "support/path.h"
#include "debug.h"
using lyx::support::runCommand;
using lyx::support::split;
+using lyx::support::addName;
+using lyx::support::addPath;
+using lyx::support::package;
+
+string const win_fonts_truetype[] = {"cmex10", "cmmi10", "cmr10", "cmsy10",
+ "eufm10", "msam10", "msbm10", "wasy10", "esint10"};
+const int num_fonts_truetype = sizeof(win_fonts_truetype) / sizeof(*win_fonts_truetype);
namespace lyx {
}
+void addFontResources()
+{
+ // Windows only: Add BaKoMa TrueType font resources
+ string const fonts_dir = addPath(package().system_support(), "fonts");
+
+ for (int i = 0 ; i < num_fonts_truetype ; ++i) {
+ string const font_current =
+ addName(fonts_dir, win_fonts_truetype[i] + ".ttf");
+ AddFontResource(external_path(font_current).c_str());
+ }
+}
+
+
+void restoreFontResources()
+{
+ // Windows only: Remove BaKoMa TrueType font resources
+ string const fonts_dir = addPath(package().system_support(), "fonts");
+
+ for(int i = 0 ; i < num_fonts_truetype ; ++i) {
+ string const font_current =
+ addName(fonts_dir, win_fonts_truetype[i] + ".ttf");
+ RemoveFontResource(external_path(font_current).c_str());
+ }
+}
+
} // namespace os
} // namespace support
} // namespace lyx
tex2lyx_LDADD = \
$(top_builddir)/src/support/libsupport.la \
- $(BOOST_LIBS) $(LIBICONV) $(COMPRESSIONLIB)
+ $(BOOST_LIBS) $(LIBICONV) @LIBS@ $(COMPRESSIONLIB)
$(LINKED_FILES) :
@rm -f $@ ; \