From d361e74eb17ca71eea5271c58e328f2a614e4704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karsten=20Ball=C3=BCder?= Date: Mon, 1 Nov 1999 15:24:28 +0000 Subject: [PATCH] added support for global AFM path setting git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4284 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/dcpsg.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index d1a44cfe67..8125285d8a 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -46,6 +46,7 @@ #include "wx/textctrl.h" #include "wx/prntbase.h" #include "wx/paper.h" +#include "wx/filefn.h" #include @@ -1835,17 +1836,24 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string, strcat(afmName,name); strcat(afmName,".afm"); FILE *afmFile = fopen(afmName,"r"); + if (afmFile==NULL) + { + strcpy( afmName, wxThePrintSetupData->GetAFMPath() ); + strcat(afmName, wxString(wxFILE_SEP_PATH)); + strcat(afmName,name); + strcat(afmName,".afm"); + afmFile = fopen(afmName,"r"); + } #ifdef __UNIX__ - if (afmFile==NULL) + else if (afmFile==NULL) { strcpy( afmName, "/usr/local/share/wx/afm/" ); strcat(afmName,name); strcat(afmName,".afm"); afmFile = fopen(afmName,"r"); } - - if (afmFile==NULL) + else if (afmFile==NULL) { strcpy( afmName, "/usr/share/wx/afm/" ); strcat(afmName,name);