-static const gchar *ps_text_to_hex_array(FILE *f, const gchar *text, gdouble x, gdouble y)
-{
- static gchar hex_digits[] = "0123456789abcdef";
- const gchar *p;
-
- if (!text) return NULL;
-
- fprintf(f, "%f %f moveto\n", x, y);
- fprintf(f, "<");
-
- /* fixme: convert utf8 to ascii or proper locale string.. */
-
- p = text;
- while (*p != '\0' && *p != '\n')
- {
- gchar text[3];
-
- text[0] = hex_digits[*p >> 4];
- text[1] = hex_digits[*p & 0xf];
- text[2] = '\0';
-
- fprintf(f, text);
-
- p++;
- }
-
- fprintf(f, ">\n");
- fprintf(f, "dup stringwidth pop 2 div neg 0 rmoveto show\n");
-
- return p;
-}
-
-static void ps_text_parse(FILE *f, const gchar *text, gdouble x, gdouble y, gdouble point_size)
-{
- const gchar *p;
-
- if (!text) return;
-
- fprintf(f, "newpath\n");
-
- p = text;
- while (p && *p != '\0')
- {
- p = ps_text_to_hex_array(f, p, x, y);
- if (p && *p == '\n') p++;
- y -= point_size;
- }
-
- fprintf(f, "closepath\n");
-}