Index: drivers/wxwidgets.cpp
===================================================================
--- drivers/wxwidgets.cpp	(revision 12898)
+++ drivers/wxwidgets.cpp	(working copy)
@@ -422,6 +422,10 @@
     pls->dev_fill1 = 0;             // Can't handle pattern fills
     pls->dev_dash  = 0;
     pls->dev_clear = 1;             // driver supports clear
+	pls->has_string_length = 1;     // We will supply a string length, however
+	                                // We always supply 0 as we use our own
+	                                // internal justification routines to account
+	                                // for newlines.
 
     if ( text )
     {
@@ -881,6 +885,12 @@
         break;
 
     case PLESC_HAS_TEXT:
+		//if only a width is required just return 0;
+		if( pls->get_string_length )
+		{
+			pls->string_length = 0;
+			break;
+		}
         if ( !( dev->ready ) )
             install_buffer( pls );
 
Index: src/plsym.c
===================================================================
--- src/plsym.c	(revision 12898)
+++ src/plsym.c	(working copy)
@@ -179,6 +179,11 @@
         plabort( "plpoin: Invalid code" );
         return;
     }
+	if ( !fontloaded )
+	{
+		plabort( "plpoin: Hershey fonts were not loaded at initialisation" );
+		return;
+	}
 
     if ( code == -1 )
     {
@@ -243,6 +248,11 @@
         plabort( "plpoin3: Invalid code" );
         return;
     }
+	if ( !fontloaded )
+	{
+		plabort( "plpoin3: Hershey fonts were not loaded at initialisation" );
+		return;
+	}
 
     plP_gdom( &xmin, &xmax, &ymin, &ymax );
     plP_grange( &zscale, &zmin, &zmax );
@@ -952,6 +962,7 @@
     signed char *vxygrid = 0;
     PLINT       ch, i, length, level = 0;
     PLFLT       width = 0., xorg = 0., dscale, scale, def, ht;
+	PLINT       old_plbuf_write;
 
     // If the driver will compute string lengths for us then we ask
     // it do so by setting get_string_length flag. When this is set
@@ -965,8 +976,11 @@
     if ( plsc->has_string_length )
     {
         plsc->get_string_length = 1;
+		old_plbuf_write = plsc->plbuf_write;
+		plsc->plbuf_write = 0;
         c_plmtex( "t", 0.0, 0.0, 0.0, string );
         plsc->get_string_length = 0;
+		plsc->plbuf_write = old_plbuf_write;
         return (PLFLT) plsc->string_length;
     }
 
@@ -1019,6 +1033,8 @@
     signed char x, y;
 
     ch--;
+	if ( !fontloaded )
+		return (PLINT) 0;
     if ( ch < 0 || ch >= indxleng )
         return (PLINT) 0;
     ib = fntindx[ch] - 2;
@@ -1085,6 +1101,12 @@
     if ( ifont > numberfonts )
         ifont = 1;
 
+	if ( !fontloaded )
+	{
+		plabort( "pldeco: Hershey fonts were not loaded at initialisation" );
+		return;
+	}
+
 // Get next character; treat non-printing characters as spaces.
 
     while ( j < lentxt )
@@ -1378,7 +1400,11 @@
         pdfs = plLibOpenPdfstrm( PL_SFONT );
 
     if ( pdfs == NULL )
-        plexit( "Unable to either (1) open/find or (2) allocate memory for the font file" );
+	{
+        plabort( "plfntld: Unable to either (1) open/find or (2) allocate memory for the font file" );
+		plfontrel();
+		return;
+	}
 
 // Read fntlkup[]
 
@@ -1388,7 +1414,11 @@
     bffrleng    = (short) ( numberfonts * numberchars );
     fntlkup     = (short int *) malloc( (size_t) bffrleng * sizeof ( short int ) );
     if ( !fntlkup )
-        plexit( "plfntld: Out of memory while allocating font buffer." );
+	{
+        plabort( "plfntld: Out of memory while allocating font buffer." );
+		plfontrel();
+		return;
+	}
 
     pdf_rd_2nbytes( pdfs, (U_SHORT *) fntlkup, bffrleng );
 
@@ -1397,7 +1427,11 @@
     pdf_rd_2bytes( pdfs, (U_SHORT *) &indxleng );
     fntindx = (short int *) malloc( (size_t) indxleng * sizeof ( short int ) );
     if ( !fntindx )
-        plexit( "plfntld: Out of memory while allocating font buffer." );
+	{
+        plabort( "plfntld: Out of memory while allocating font buffer." );
+		plfontrel();
+		return;
+	}
 
     pdf_rd_2nbytes( pdfs, (U_SHORT *) fntindx, indxleng );
 
@@ -1407,7 +1441,11 @@
     pdf_rd_2bytes( pdfs, (U_SHORT *) &bffrleng );
     fntbffr = (signed char *) malloc( 2 * (size_t) bffrleng * sizeof ( signed char ) );
     if ( !fntbffr )
-        plexit( "plfntld: Out of memory while allocating font buffer." );
+	{
+        plabort( "plfntld: Out of memory while allocating font buffer." );
+		plfontrel();
+		return;
+	}
 
 #if PLPLOT_USE_TCL_CHANNELS
     pdf_rdx( fntbffr, sizeof ( signed char ) * (size_t) ( 2 * bffrleng ), pdfs );
@@ -1417,7 +1455,6 @@
 #endif
 
 // Done
-
     pdf_close( pdfs );
 }
 
