AFM metrics were searched in /afm instead of /share/wx/afm ; did not try all AFM locations correctly

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4326 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 1999-11-02 23:23:24 +00:00
parent fcdb55192c
commit 5558ce7ce4

View File

@ -1809,7 +1809,7 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
} }
/* get the directory of the AFM files */ /* get the directory of the AFM files */
wxString afmName; wxString afmName = wxEmptyString;
if (!m_printData.GetFontMetricPath().IsEmpty()) if (!m_printData.GetFontMetricPath().IsEmpty())
{ {
afmName = m_printData.GetFontMetricPath().fn_str(); afmName = m_printData.GetFontMetricPath().fn_str();
@ -1841,24 +1841,28 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string,
} }
#ifdef __UNIX__ #ifdef __UNIX__
else if (afmFile==NULL) if (afmFile==NULL)
/* please do NOT change the line above to "else if (afmFile==NULL)" -
- afmFile = fopen() may fail and in that case the next if branch
MUST be executed - and it would not if there was "else" */
{ {
afmName = wxINSTALL_PREFIX; afmName = wxINSTALL_PREFIX;
afmName << wxFILE_SEP_PATH afmName << wxFILE_SEP_PATH
<< "share" << wxFILE_SEP_PATH
<< "wx" << wxFILE_SEP_PATH
<< "afm" << wxFILE_SEP_PATH << "afm" << wxFILE_SEP_PATH
<< name << ".afm"; << name << ".afm";
afmFile = fopen(afmName,"r"); afmFile = fopen(afmName,"r");
} }
#if 0 #if 0
else if (afmFile==NULL) if (afmFile==NULL)
{ {
strcpy( afmName, "/usr/local/share/wx/afm/" ); strcpy( afmName, "/usr/local/share/wx/afm/" );
strcat(afmName,name); strcat(afmName,name);
strcat(afmName,".afm"); strcat(afmName,".afm");
afmFile = fopen(afmName,"r"); afmFile = fopen(afmName,"r");
} }
else if (afmFile==NULL) if (afmFile==NULL)
{ {
strcpy( afmName, "/usr/share/wx/afm/" ); strcpy( afmName, "/usr/share/wx/afm/" );
strcat(afmName,name); strcat(afmName,name);