From 385bcb35457eb086ca249ce6dfc161e354ecc7b7 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Mon, 7 Jun 1999 11:27:46 +0000 Subject: [PATCH] Install AFMs as well. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2688 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.am | 2 +- configure.in | 3 +++ include/wx/gtk/Makefile.am | 5 ----- include/wx/gtk1/Makefile.am | 5 ----- include/wx/list.h | 2 +- misc/Makefile.am | 7 +++++++ misc/afm/Makefile.am | 21 +++++++++++++++++++++ misc/gs_afm/Makefile.am | 21 +++++++++++++++++++++ src/generic/dcpsg.cpp | 28 +++++++++++++++++++++++++--- wxGTK.spec | 2 ++ 10 files changed, 81 insertions(+), 15 deletions(-) create mode 100644 misc/Makefile.am create mode 100644 misc/afm/Makefile.am create mode 100644 misc/gs_afm/Makefile.am diff --git a/Makefile.am b/Makefile.am index 13d83bc880..b8e540ad6e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = 1.4 # no-dependencies -SUBDIRS = include src samples # utils user docs +SUBDIRS = include src samples misc # utils user docs bin_SCRIPTS = wx-config diff --git a/configure.in b/configure.in index 22a7497e6b..be040f92e3 100644 --- a/configure.in +++ b/configure.in @@ -1948,6 +1948,9 @@ AC_OUTPUT([ include/wx/msw/Makefile include/wx/protocol/Makefile include/wx/unix/Makefile + misc/Makefile + misc/afm/Makefile + misc/gs_afm/Makefile samples/Makefile samples/bombs/Makefile samples/caret/Makefile diff --git a/include/wx/gtk/Makefile.am b/include/wx/gtk/Makefile.am index ded7bc31a5..a8b71160e6 100644 --- a/include/wx/gtk/Makefile.am +++ b/include/wx/gtk/Makefile.am @@ -63,8 +63,3 @@ wx_gtk_include_HEADERS = \ win_gtk.h \ window.h -# setup.h is installed in another directory because several versions of wxwin -# should be able to coexist on the same machine -portheadersdir = ${datadir}/@PACKAGE@/include/wx -portheaders_HEADERS = setup.h - diff --git a/include/wx/gtk1/Makefile.am b/include/wx/gtk1/Makefile.am index ded7bc31a5..a8b71160e6 100644 --- a/include/wx/gtk1/Makefile.am +++ b/include/wx/gtk1/Makefile.am @@ -63,8 +63,3 @@ wx_gtk_include_HEADERS = \ win_gtk.h \ window.h -# setup.h is installed in another directory because several versions of wxwin -# should be able to coexist on the same machine -portheadersdir = ${datadir}/@PACKAGE@/include/wx -portheaders_HEADERS = setup.h - diff --git a/include/wx/list.h b/include/wx/list.h index cb08945a0a..01eddf8190 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -438,7 +438,7 @@ private: (nodetype *)prev, (nodetype *)next, \ (T *)data, key); \ } \ - }; + } #define WX_DECLARE_LIST_2(elementtype, listname, nodename) \ WX_DECLARE_LIST_3(elementtype, elementtype, listname, nodename) diff --git a/misc/Makefile.am b/misc/Makefile.am new file mode 100644 index 0000000000..21991e1b9a --- /dev/null +++ b/misc/Makefile.am @@ -0,0 +1,7 @@ +## Purpose: The automake makefile for wxWindows (misc direcotry) +## Author: Phil Blecker, Vadim Zeitlin +## Version: $Id$ +## +## Process this file with automake to produce Makefile.in + +SUBDIRS = afm gs_afm diff --git a/misc/afm/Makefile.am b/misc/afm/Makefile.am new file mode 100644 index 0000000000..45f62c4b16 --- /dev/null +++ b/misc/afm/Makefile.am @@ -0,0 +1,21 @@ +## Purpose: The automake makefile for wxWindows (misc/afm direcotry) +## Author: Phil Blecker, Vadim Zeitlin +## Version: $Id$ +## +## Process this file with automake to produce Makefile.in + +afmdir = $(datadir)/wx/afm +afm_DATA = \ + Cour.afm \ + CourBo.afm \ + CourBoO.afm \ + CourO.afm \ + Helv.afm \ + HelvBo.afm \ + HelvBoO.afm \ + HelvO.afm \ + TimesRo.afm \ + TimesBo.afm \ + TimesBoO.afm \ + TimesO.afm + diff --git a/misc/gs_afm/Makefile.am b/misc/gs_afm/Makefile.am new file mode 100644 index 0000000000..c3a89fc421 --- /dev/null +++ b/misc/gs_afm/Makefile.am @@ -0,0 +1,21 @@ +## Purpose: The automake makefile for wxWindows (misc/gs_afm direcotry) +## Author: Phil Blecker, Vadim Zeitlin +## Version: $Id$ +## +## Process this file with automake to produce Makefile.in + +gs_afmdir = $(datadir)/wx/gs_afm +gs_afm_DATA = \ + Cour.afm \ + CourBo.afm \ + CourBoO.afm \ + CourO.afm \ + Helv.afm \ + HelvBo.afm \ + HelvBoO.afm \ + HelvO.afm \ + TimesRo.afm \ + TimesBo.afm \ + TimesBoO.afm \ + TimesO.afm + diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index c6f1a559f4..f21c2e82a9 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -1685,8 +1685,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 +1710,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"); diff --git a/wxGTK.spec b/wxGTK.spec index 5dadc5c990..768a961967 100644 --- a/wxGTK.spec +++ b/wxGTK.spec @@ -52,6 +52,8 @@ rm -rf $RPM_BUILD_ROOT %{pref}/include/wx/* %dir %{pref}/lib/wx %{pref}/lib/wx/* +%dir %{pref}/share/wx +%{pref}/share/wx/* %attr(755, -, -) %{pref}/lib/libwx_gtk2.so %attr(755, -, -) %{pref}/lib/libwx_gtk2.so.1 %attr(755, -, -) %{pref}/lib/libwx_gtk2.so.1.0 -- 2.45.2