From: Karsten Ballüder Date: Mon, 1 Nov 1999 15:24:28 +0000 (+0000) Subject: added support for global AFM path setting X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d361e74eb17ca71eea5271c58e328f2a614e4704 added support for global AFM path setting git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4284 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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);