X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4e4ea166d76da40eaa5fdcf9e958d93521f72fba..57c0af52bffc66b12b7e7b49b3a2dfdcf2d2e352:/src/generic/dcpsg.cpp diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index c6f1a559f4..880a6a10aa 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -25,6 +25,8 @@ #include "wx/defs.h" #endif // WX_PRECOMP +#if wxUSE_PRINTING_ARCHITECTURE + #if wxUSE_POSTSCRIPT #include "wx/dcmemory.h" @@ -1332,7 +1334,7 @@ void wxPostScriptDC::EndDoc () wxChar *header_file = wxGetTempFileName("ps"); - m_pstream = new ofstream( wxConv_file.cWX2MB(header_file) ); + m_pstream = new ofstream( wxConvCurrent->cWX2MB(header_file) ); *m_pstream << "%!PS-Adobe-2.0\n"; /* PostScript magic strings */ *m_pstream << "%%Title: " << m_title.mb_str() << "\n"; @@ -1342,15 +1344,15 @@ void wxPostScriptDC::EndDoc () wxChar userID[256]; if ( wxGetEmailAddress(userID, sizeof(userID)) ) { - *m_pstream << "%%For: " << MBSTRINGCAST wxConv_libc.cWX2MB(userID); + *m_pstream << "%%For: " << MBSTRINGCAST wxConvCurrent->cWX2MB(userID); wxChar userName[245]; if (wxGetUserName(userName, sizeof(userName))) - *m_pstream << " (" << MBSTRINGCAST wxConv_libc.cWX2MB(userName) << ")"; + *m_pstream << " (" << MBSTRINGCAST wxConvCurrent->cWX2MB(userName) << ")"; *m_pstream << "\n"; } else if ( wxGetUserName(userID, sizeof(userID)) ) { - *m_pstream << "%%For: " << MBSTRINGCAST wxConv_libc.cWX2MB(userID) << "\n"; + *m_pstream << "%%For: " << MBSTRINGCAST wxConvCurrent->cWX2MB(userID) << "\n"; } // THE FOLLOWING HAS BEEN CONTRIBUTED BY Andy Fyfe @@ -1685,8 +1687,11 @@ void wxPostScriptDC::GetTextExtent( const wxString& string, long *x, long *y, /* get the directory of the AFM files */ char afmName[256]; afmName[0] = 0; - wxString fmPath(m_printData.GetFontMetricPath()); - if (fmPath != "") strcpy( afmName, (const char*) fmPath ); + + if (!m_printData.GetFontMetricPath().IsEmpty()) + { + strcpy( afmName, m_printData.GetFontMetricPath().mb_str() ) + } /* 2. open and process the file / a short explanation of the AFM format: @@ -1707,7 +1712,26 @@ void wxPostScriptDC::GetTextExtent( const wxString& string, long *x, long *y, strcat(afmName,name); strcat(afmName,".afm"); FILE *afmFile = fopen(afmName,"r"); - if ( afmFile==NULL ) + +#ifdef __UNIX__ + if (afmFile==NULL) + { + strcpy( afmName, "/usr/local/share/wx/gs_afm/" ); + strcat(afmName,name); + strcat(afmName,".afm"); + FILE *afmFile = fopen(afmName,"r"); + } + + if (afmFile==NULL) + { + strcpy( afmName, "/usr/share/wx/gs_afm/" ); + strcat(afmName,name); + strcat(afmName,".afm"); + FILE *afmFile = fopen(afmName,"r"); + } +#endif + + if (afmFile==NULL) { wxLogDebug( "GetTextExtent: can't open AFM file '%s'\n", afmName ); wxLogDebug( " using approximate values\n"); @@ -2245,3 +2269,6 @@ void wxPostScriptModule::OnExit() #endif // wxUSE_POSTSCRIPT + +#endif + // wxUSE_PRINTING_ARCHITECTURE \ No newline at end of file