X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3069ac4e452f98644f9cdcae52a36ed9b9a93a31..1ee17e1c421b64b3a356fee82f454ab4b43ab50c:/src/gtk1/dcps.cpp?ds=sidebyside diff --git a/src/gtk1/dcps.cpp b/src/gtk1/dcps.cpp index 6812fe95b4..6dfe6ffdaf 100644 --- a/src/gtk1/dcps.cpp +++ b/src/gtk1/dcps.cpp @@ -9,10 +9,16 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// +#ifndef __WXMOTIF__ #ifdef __GNUG__ #pragma implementation #pragma interface #endif +#endif + +#include "wx/defs.h" + +#if wxUSE_POSTSCRIPT #include "wx/postscrp.h" #include "wx/dcmemory.h" @@ -24,6 +30,13 @@ #include "wx/image.h" #include "wx/log.h" +#include + +#ifdef __WXGTK__ +#include "gdk/gdk.h" +#include "gtk/gtk.h" +#endif + //----------------------------------------------------------------------------- // start and end of document/page //----------------------------------------------------------------------------- @@ -777,7 +790,8 @@ void wxPostScriptDC::SetFont (const wxFont& font) if (!font.Ok()) return; m_font = font; - + +#ifdef __WXGTK__ char *name = wxTheFontNameDirectory->GetPostScriptName( m_font.GetFamily(), m_font.GetWeight(), m_font.GetStyle() ); @@ -787,6 +801,84 @@ void wxPostScriptDC::SetFont (const wxFont& font) << "/" << name << " findfont\n" << YLOG2DEVREL(font.GetPointSize()) << " scalefont setfont\n"; +#else + char buf[100]; + const char *name; + const char *style = ""; + int Style = m_font.GetStyle (); + int Weight = m_font.GetWeight (); + + switch (m_font.GetFamily ()) + { + case wxTELETYPE: + case wxMODERN: + name = "/Courier"; + break; + case wxSWISS: + name = "/Helvetica"; + break; + case wxROMAN: +// name = "/Times-Roman"; + name = "/Times"; // Altered by EDZ + break; + case wxSCRIPT: + name = "/Zapf-Chancery-MediumItalic"; + Style = wxNORMAL; + Weight = wxNORMAL; + break; + default: + case wxDEFAULT: // Sans Serif Font + name = "/LucidaSans"; + } + + if (Style == wxNORMAL && (Weight == wxNORMAL || Weight == wxLIGHT)) + { + if (m_font.GetFamily () == wxROMAN) + style = "-Roman"; + else + style = ""; + } + else if (Style == wxNORMAL && Weight == wxBOLD) + style = "-Bold"; + + else if (Style == wxITALIC && (Weight == wxNORMAL || Weight == wxLIGHT)) + { + if (m_font.GetFamily () == wxROMAN) + style = "-Italic"; + else + style = "-Oblique"; + } + else if (Style == wxITALIC && Weight == wxBOLD) + { + if (m_font.GetFamily () == wxROMAN) + style = "-BoldItalic"; + else + style = "-BoldOblique"; + } + else if (Style == wxSLANT && (Weight == wxNORMAL || Weight == wxLIGHT)) + { + if (m_font.GetFamily () == wxROMAN) + style = "-Italic"; + else + style = "-Oblique"; + } + else if (Style == wxSLANT && Weight == wxBOLD) + { + if (m_font.GetFamily () == wxROMAN) + style = "-BoldItalic"; + else + style = "-BoldOblique"; + } + else + style = ""; + + strcpy (buf, name); + strcat (buf, style); + *m_pstream << buf << " findfont\n"; + // *m_pstream << (m_font.GetPointSize() * m_scaleFactor) << " scalefont setfont\n"; + // No scale factor in this implementation? + *m_pstream << (m_font.GetPointSize()) << " scalefont setfont\n"; +#endif } void wxPostScriptDC::SetPen( const wxPen& pen ) @@ -1349,11 +1441,16 @@ void wxPostScriptDC::EndPage () *m_pstream << "showpage\n"; } -bool wxPostScriptDC::Blit (long xdest, long ydest, long fwidth, long fheight, - wxDC *source, long xsrc, long ysrc, int WXUNUSED(rop), bool WXUNUSED(useMask)) +bool wxPostScriptDC::Blit( long WXUNUSED(xdest), long WXUNUSED(ydest), + long WXUNUSED(fwidth), long WXUNUSED(fheight), + wxDC *WXUNUSED(source), + long WXUNUSED(xsrc), long WXUNUSED(ysrc), + int WXUNUSED(rop), bool WXUNUSED(useMask) ) { wxCHECK_MSG( m_ok && m_pstream, FALSE, "invalid postscript dc" ); + wxFAIL_MSG( "wxPostScriptDC::Blit no yet implemented." ); + return TRUE; } @@ -1657,3 +1754,5 @@ void wxPostScriptDC::GetSizeMM(long *width, long *height) const } } +#endif + // wxUSE_POSTSCRIPT