Index: src/plsym.c
===================================================================
--- src/plsym.c	(revision 12898)
+++ src/plsym.c	(working copy)
@@ -190,6 +190,12 @@
     }
     else
     {
+		
+        if ( !fontloaded )
+	    {
+			plabort( "plpoin: Hershey fonts were not loaded at initialisation" );
+			return;
+		}
         if ( ifont > numberfonts )
             ifont = 1;
         sym = *( fntlkup + ( ifont - 1 ) * numberchars + code );
@@ -264,6 +270,12 @@
     }
     else
     {
+		
+		if ( !fontloaded )
+		{
+			plabort( "plpoin3: Hershey fonts were not loaded at initialisation" );
+			return;
+		}
         if ( ifont > numberfonts )
             ifont = 1;
         sym = *( fntlkup + ( ifont - 1 ) * numberchars + code );
@@ -952,6 +964,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 +978,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 +1035,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 +1103,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 )
@@ -1151,8 +1175,8 @@
                 // (631, 634, and 647) in the compact case and (2184,
                 // 2185, and 2186) for (2131, 2134, and 2147) in the
                 // extended case.
-                sym[( *length )++] =
-                    *( fntlkup + ( ifont - 1 ) * numberchars + 127 + ig );
+				sym[( *length )++] =
+					*( fntlkup + ( ifont - 1 ) * numberchars + 127 + ig );
             }
             else
             {
@@ -1378,7 +1402,14 @@
         pdfs = plLibOpenPdfstrm( PL_SFONT );
 
     if ( pdfs == NULL )
-        plexit( "Unable to either (1) open/find or (2) allocate memory for the font file" );
+	{
+		if( plsc->has_string_length )
+			plwarn( "plfntld: Unable to either (1) open/find or (2) allocate memory for the font file. Hershey fonts will not be available" );
+		else
+			plabort( "plfntld: Unable to either (1) open/find or (2) allocate memory for the font file. Hershey fonts will not be available" );
+		plfontrel();
+		return;
+	}
 
 // Read fntlkup[]
 
@@ -1388,7 +1419,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 +1432,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 +1446,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 +1460,6 @@
 #endif
 
 // Done
-
     pdf_close( pdfs );
 }
 
