fprintf( m_pstream, " reencodeISO def\n" );
fprintf( m_pstream, buffer );
fprintf( m_pstream, " findfont\n" );
- #ifdef __WXMSW__
- fprintf( m_pstream, "%d scalefont setfont\n", YLOG2DEVREL(m_font.GetPointSize()) );
- #else
- fprintf( m_pstream, "%d scalefont setfont\n", YLOG2DEVREL(m_font.GetPointSize()) );
- #endif
+
+ fprintf( m_pstream, "%f scalefont setfont\n", YLOG2DEVREL(m_font.GetPointSize() * 1000) / 1000.0F);
+ // this is a hack - we must scale font size (in pts) according to m_scaleY but
+ // YLOG2DEVREL works with wxCoord type (int or longint). Se we first convert font size
+ // to 1/1000th of pt and then back.
}
void wxPostScriptDC::SetPen( const wxPen& pen )
wxString afmName = wxEmptyString;
if (!m_printData.GetFontMetricPath().IsEmpty())
{
- afmName = m_printData.GetFontMetricPath().fn_str();
+ afmName = m_printData.GetFontMetricPath();
}
/* 2. open and process the file
/* new elements JC Sun Aug 25 23:21:44 MET DST 1996 */
- afmName << name << ".afm";
- FILE *afmFile = fopen(afmName,"r");
+ afmName << name << wxT(".afm");
+ FILE *afmFile = wxFopen(afmName,wxT("r"));
if (afmFile==NULL)
{
afmName = wxThePrintSetupData->GetAFMPath();
- afmName << wxFILE_SEP_PATH << name << ".afm";
- afmFile = fopen(afmName,"r");
+ afmName << wxFILE_SEP_PATH << name << wxT(".afm");
+ afmFile = wxFopen(afmName,wxT("r"));
}
#ifdef __UNIX__
- if (afmFile==NULL)
+#ifndef __VMS__
+ 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 << wxFILE_SEP_PATH
- << "share" << wxFILE_SEP_PATH
- << "wx" << wxFILE_SEP_PATH
- << "afm" << wxFILE_SEP_PATH
- << name << ".afm";
- afmFile = fopen(afmName,"r");
- }
-#if 0
- if (afmFile==NULL)
- {
- strcpy( afmName, "/usr/local/share/wx/afm/" );
- strcat(afmName,name);
- strcat(afmName,".afm");
- afmFile = fopen(afmName,"r");
- }
- if (afmFile==NULL)
- {
- strcpy( afmName, "/usr/share/wx/afm/" );
- strcat(afmName,name);
- strcat(afmName,".afm");
- afmFile = fopen(afmName,"r");
+ << wxT("share") << wxFILE_SEP_PATH
+ << wxT("wx") << wxFILE_SEP_PATH
+ << wxT("afm") << wxFILE_SEP_PATH
+ << name << wxT(".afm");
+ afmFile = wxFopen(afmName,wxT("r"));
}
#endif
#endif
if(lastWidths[*p]== INT_MIN)
{
wxLogDebug(wxT("GetTextExtent: undefined width for character '%hc' (%d)\n"), *p,*p);
- widthSum += /*(wxCoord)*/(lastWidths[' ']/1000.0F * Size); /* assume space */
+ widthSum += (lastWidths[' ']/1000.0F * Size); /* assume space */
}
else
{
- widthSum += /*(wxCoord)*/((lastWidths[*p]/1000.0F)*Size);
+ widthSum += ((lastWidths[*p]/1000.0F)*Size);
}
}