русские буквы в EPS из Gnuplot (rus patch postscript)
Ключевые слова: rus, patch, postscript, (найти похожие документы)
Date: Thu, 07 Nov 2002 15:15:01 +0500
From: Fedor Zuev <Fedor_Zuev@p89.f156.n5070.z2.fidonet.org>
Newsgroups: ftn.ru.linux
Subject: русские буквы в EPS из Gnuplot
AVT>Когда Gnuplot графики на экране рисует, то русские буквы нормально выводится.
AVT>Перерисовываю график в EPS-формат, открываю его при помощи gv, русские буквы
AVT>"шифруются", то есть, в EPS одна кодировка, gv предполагает какую-то другую.
AVT>Вопрос: как правильно в гнуплоте использовать кириллические шрифты?
Патчить гнуплот.
Примерно так
-----------------cut gnuplot-koi8r.diff----
diff -urwBb gnuplot-3.7.1p1/docs/gnuplot.doc gnuplot-3.7.1p1.diff/docs/gnuplot.doc
- --- gnuplot-3.7.1p1/docs/gnuplot.doc Wed Oct 27 19:10:16 1999
+++ gnuplot-3.7.1p1.diff/docs/gnuplot.doc Sat Sep 15 03:04:11 2001
@@ -3689,7 +3689,8 @@
The `set encoding` command selects a character encoding. Valid values are
`default`, which tells a terminal to use its default; `iso_8859_1` (known in
the PostScript world as `ISO-Latin1`), which is used on many Unix workstations
- and with MS-Windows; `cp850`, for OS/2; and `cp437`, for MS-DOS.
+ and with MS-Windows; `koi8r`, popular Unix cyrillic encoding; `cp850`, for
+ OS/2; and `cp437`, for MS-DOS.
Syntax:
set encoding {<value>}
diff -urwBb gnuplot-3.7.1p1/docs/gnuplot.texi gnuplot-3.7.1p1.diff/docs/gnuplot.texi
- --- gnuplot-3.7.1p1/docs/gnuplot.texi Wed Oct 27 19:54:42 1999
+++ gnuplot-3.7.1p1.diff/docs/gnuplot.texi Sat Sep 15 03:03:26 2001
@@ -4986,10 +4986,11 @@
@opindex encoding
-The @ref{encoding} command selects a character encoding. Valid values are
-`default`, which tells a terminal to use its default; `iso_8859_1` (known in
-the PostScript world as `ISO-Latin1`), which is used on many Unix workstations
-and with MS-Windows; `cp850`, for OS/2; and `cp437`, for MS-DOS.
+The @ref{encoding} command selects a character encoding. Valid values
+are `default`, which tells a terminal to use its default; `iso_8859_1`
+(known in the PostScript world as `ISO-Latin1`), which is used on many
+Unix workstations and with MS-Windows; `koi8r`, popular Unix cyrillic
+encoding; `cp850`, for OS/2; and `cp437`, for MS-DOS.
Syntax:
@example
diff -urwBb gnuplot-3.7.1p1/set.c gnuplot-3.7.1p1.diff/set.c
- --- gnuplot-3.7.1p1/set.c Thu Aug 19 23:36:35 1999
+++ gnuplot-3.7.1p1.diff/set.c Sat Sep 15 01:32:11 2001
@@ -133,7 +133,7 @@
TBOOLEAN parametric = FALSE;
double pointsize = 1.0;
int encoding;
-char *encoding_names[] = { "default", "iso_8859_1", "cp437", "cp850", NULL };
+char *encoding_names[] = { "default", "iso_8859_1", "cp437", "koi8r" "cp850", NULL
};
TBOOLEAN polar = FALSE;
TBOOLEAN hidden3d = FALSE;
TBOOLEAN label_contours = TRUE; /* different linestyles are used for contours when
set */
@@ -1149,11 +1149,14 @@
} else if (almost_equals(c_token,"cp4$37")) {
c_token++;
encoding = ENCODING_CP_437;
+ } else if (almost_equals(c_token,"koi$8r")) {
+ c_token++;
+ encoding = ENCODING_KOI8_R;
} else if (almost_equals(c_token,"cp8$50")) {
c_token++;
encoding = ENCODING_CP_850;
} else {
- int_error("expecting one of 'default', 'iso_8859_1', 'cp437' or 'cp850'",
c_token);
+ int_error("expecting one of 'default', 'iso_8859_1', 'cp437','koi8r' or
'cp850'", c_token);
}
} else
return(FALSE); /* no command match */
diff -urwBb gnuplot-3.7.1p1/setshow.h gnuplot-3.7.1p1.diff/setshow.h
- --- gnuplot-3.7.1p1/setshow.h Sun Oct 4 05:17:47 1998
+++ gnuplot-3.7.1p1.diff/setshow.h Sat Sep 15 01:35:20 2001
@@ -179,7 +179,8 @@
#define ENCODING_DEFAULT 0
#define ENCODING_ISO_8859_1 1
#define ENCODING_CP_437 2
-#define ENCODING_CP_850 3 /* JFi */
+#define ENCODING_KOI8_R 3
+#define ENCODING_CP_850 4 /* JFi */