forked from pool/gnuplot
60 lines
2.1 KiB
Plaintext
60 lines
2.1 KiB
Plaintext
--- src/variable.c.orig 2006-08-16 05:33:43.000000000 +0200
|
|
+++ src/variable.c 2006-08-16 05:34:54.000000000 +0200
|
|
@@ -257,6 +257,8 @@
|
|
{ "$`kpsexpand '$TEXMFMAIN'`/fonts/type1!" },
|
|
{ "$`kpsexpand '$TEXMFLOCAL'`/fonts/type1!" },
|
|
/* Linux paths */
|
|
+ { "/usr/share/fonts/Type1" },
|
|
+ { "/usr/share/fonts/truetype" },
|
|
{ "/usr/X11R6/lib/X11/fonts/Type1" },
|
|
{ "/usr/X11R6/lib/X11/fonts/truetype" },
|
|
/* HP-UX */
|
|
--- src/gplt_x11.c
|
|
+++ src/gplt_x11.c 2007-05-30 14:16:08.004124402 +0200
|
|
@@ -133,6 +133,8 @@ Error. Incompatible options.
|
|
#include <X11/Xatom.h>
|
|
#include <X11/keysym.h>
|
|
#ifdef USE_X11_MULTIBYTE
|
|
+# include <locale.h>
|
|
+# include <langinfo.h>
|
|
# include <X11/Xlocale.h>
|
|
#endif
|
|
|
|
@@ -488,8 +490,8 @@ static char *gpFallbackFont __PROTO((voi
|
|
static int gpXGetFontascent __PROTO((XFontStruct *cfont));
|
|
|
|
enum set_encoding_id encoding = S_ENC_DEFAULT; /* EAM - mirrored from core code by 'QE' */
|
|
-static char default_font[64] = { '\0' };
|
|
-static char default_encoding[16] = { '\0' };
|
|
+static char default_font[256] = { '\0' };
|
|
+static char default_encoding[64] = { '\0' };
|
|
|
|
#define Nwidths 10
|
|
static unsigned int widths[Nwidths] = { 2, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
|
@@ -2099,6 +2101,8 @@ exec_cmd(plot_struct *plot, char *comman
|
|
/* Save the request default font */
|
|
c = &(buffer[strlen(buffer)-1]);
|
|
while (*c <= ' ') *c-- = '\0';
|
|
+ if (strlen(&buffer[2]) == 0)
|
|
+ break;
|
|
strncpy(default_font, &buffer[2], strlen(&buffer[2])+1);
|
|
FPRINTF((stderr, "gnuplot_x11: exec_cmd() set default_font to \"%s\"\n", default_font));
|
|
break;
|
|
@@ -5487,6 +5491,16 @@ char *fontname;
|
|
}
|
|
|
|
#ifdef USE_X11_MULTIBYTE
|
|
+ if ((!fontname || !(*fontname)) && multibyte_fonts_usable) {
|
|
+ const char * codeset = nl_langinfo(CODESET);
|
|
+ if (strcasestr(codeset, "UTF-8")) {
|
|
+ const char* utf8 = "mbfont:sazanami,16 mincho-medium,verdana-medium,16 dejavu,sans,20";
|
|
+ strncpy(default_font, utf8, strlen(utf8)+1);
|
|
+ }
|
|
+ }
|
|
+#endif
|
|
+
|
|
+#ifdef USE_X11_MULTIBYTE
|
|
if (fontname && strncmp(fontname, "mbfont:", 7) == 0) {
|
|
if (multibyte_fonts_usable) {
|
|
usemultibyte = 1;
|