作図ソフト dia の改良版
Revision | 5999a091b725a1cd0863f62183b7780e16fda0fa (tree) |
---|---|
Zeit | 2003-09-29 01:19:32 |
Autor | Lars Clausen <lclausen@src....> |
Commiter | Lars Clausen |
Font render thingy.
@@ -2,6 +2,27 @@ | ||
2 | 2 | |
3 | 3 | * makefile.msc: added target po to update the translations |
4 | 4 | |
5 | +2003-09-27 Lars Clausen <lrclause@cs.uiuc.edu> | |
6 | + | |
7 | + * config.h.win32: | |
8 | + * dia.spec (Release): | |
9 | + * NEWS: | |
10 | + * doc/pl/dia-manual.sgml: | |
11 | + * doc/en/dia-manual.xml: | |
12 | + Pre4 is given a short try. | |
13 | + | |
14 | + * configure.in: Give all necessary libs to PNG test. | |
15 | + | |
16 | + * lib/font.c: Added legacy entries for sans, serif and monospace. | |
17 | + | |
18 | + * app/app_procs.c (internal_plugin_init): | |
19 | + * app/render_eps.h: | |
20 | + * app/render_eps.c: | |
21 | + Added PS fonts output for Unix. | |
22 | + | |
23 | + * app/diapsrenderer.c (set_font): Adjusted height by the magic .7 | |
24 | + factor to make PS fonts stay in boxes. | |
25 | + | |
5 | 26 | 2003-08-03 Hans Breuer <hans@breuer.org> |
6 | 27 | |
7 | 28 | * config.h.win32 : close the version string |
@@ -1,3 +1,10 @@ | ||
1 | +dia-0.92-pre4: 27-Sep-2003 | |
2 | + | |
3 | +* Use Win32 PS font EPS rendering on Unix as well, to allow the various | |
4 | + manipulation tools to work. | |
5 | +* Libart rendering is back on win32. | |
6 | +* Icon fix. | |
7 | + | |
1 | 8 | dia-0.92-pre3: 22-Sep-2003 |
2 | 9 | |
3 | 10 | * Working caching of Pango context removes huge slowdown from pre2. |
@@ -667,9 +667,16 @@ internal_plugin_init(PluginInfo *info) | ||
667 | 667 | filter_register_import(&dia_import_filter); |
668 | 668 | |
669 | 669 | /* register export filters */ |
670 | + /* Standard Dia format */ | |
670 | 671 | filter_register_export(&dia_export_filter); |
672 | + /* EPS with PS fonts */ | |
671 | 673 | filter_register_export(&eps_export_filter); |
674 | +#ifdef HAVE_FREETYPE | |
675 | + /* EPS with Pango rendering */ | |
676 | + filter_register_export(&eps_ft2_export_filter); | |
677 | +#endif | |
672 | 678 | #if defined(HAVE_LIBPNG) && defined(HAVE_LIBART) |
679 | + /* PNG with libart rendering */ | |
673 | 680 | filter_register_export(&png_export_filter); |
674 | 681 | #endif |
675 | 682 |
@@ -240,7 +240,7 @@ set_font(DiaRenderer *self, DiaFont *font, real height) | ||
240 | 240 | DiaPsRenderer *renderer = DIA_PS_RENDERER(self); |
241 | 241 | |
242 | 242 | fprintf(renderer->file, "/%s-latin1 ff %f scf sf\n", |
243 | - dia_font_get_psfontname(font), (double)height); | |
243 | + dia_font_get_psfontname(font), (double)height*0.7); | |
244 | 244 | } |
245 | 245 | |
246 | 246 | static void |
@@ -66,18 +66,38 @@ | ||
66 | 66 | #include "diapsft2renderer.h" |
67 | 67 | #endif |
68 | 68 | |
69 | +static void export_eps(DiagramData *data, const gchar *filename, | |
70 | + const gchar *diafilename, void* user_data); | |
71 | +static void export_render_eps(DiaPsRenderer *renderer, | |
72 | + DiagramData *data, const gchar *filename, | |
73 | + const gchar *diafilename, void* user_data); | |
74 | + | |
75 | +#ifdef HAVE_FREETYPE | |
76 | +static void export_ft2_eps(DiagramData *data, const gchar *filename, | |
77 | + const gchar *diafilename, void* user_data); | |
78 | +static void | |
79 | +export_ft2_eps(DiagramData *data, const gchar *filename, | |
80 | + const gchar *diafilename, void* user_data) { | |
81 | + export_render_eps(g_object_new (DIA_TYPE_PS_FT2_RENDERER, NULL), | |
82 | + data, filename, diafilename, user_data); | |
83 | +} | |
84 | +#endif | |
85 | + | |
69 | 86 | static void |
70 | 87 | export_eps(DiagramData *data, const gchar *filename, |
71 | 88 | const gchar *diafilename, void* user_data) |
72 | 89 | { |
73 | - DiaPsRenderer *renderer; | |
90 | + export_render_eps(g_object_new (DIA_TYPE_PS_RENDERER, NULL), | |
91 | + data, filename, diafilename, user_data); | |
92 | +} | |
93 | + | |
94 | +static void | |
95 | +export_render_eps(DiaPsRenderer *renderer, | |
96 | + DiagramData *data, const gchar *filename, | |
97 | + const gchar *diafilename, void* user_data) | |
98 | +{ | |
74 | 99 | FILE *outfile; |
75 | 100 | |
76 | -#ifdef HAVE_FREETYPE | |
77 | - renderer = g_object_new (DIA_TYPE_PS_FT2_RENDERER, NULL); | |
78 | -#else | |
79 | - renderer = g_object_new (DIA_TYPE_PS_RENDERER, NULL); | |
80 | -#endif | |
81 | 101 | outfile = fopen(filename, "w"); |
82 | 102 | if (outfile == NULL) { |
83 | 103 | message_error(_("Can't open output file %s: %s\n"), filename, strerror(errno)); |
@@ -114,9 +134,17 @@ new_psprint_renderer(Diagram *dia, FILE *file) | ||
114 | 134 | return DIA_RENDERER(renderer); |
115 | 135 | } |
116 | 136 | |
137 | +#ifdef HAVE_FREETYPE | |
117 | 138 | static const gchar *extensions[] = { "eps", "epsi", NULL }; |
139 | +DiaExportFilter eps_ft2_export_filter = { | |
140 | + N_("Encapsulated Postscript (using Pango fonts)"), | |
141 | + extensions, | |
142 | + export_ft2_eps | |
143 | +}; | |
144 | +#endif | |
145 | + | |
118 | 146 | DiaExportFilter eps_export_filter = { |
119 | - N_("Encapsulated Postscript"), | |
147 | + N_("Encapsulated Postscript (using builtin PS fonts)"), | |
120 | 148 | extensions, |
121 | 149 | export_eps |
122 | 150 | }; |
@@ -28,6 +28,7 @@ DiaRenderer *new_eps_renderer(Diagram *dia, char *filename); | ||
28 | 28 | DiaRenderer *new_psprint_renderer(Diagram *dia, FILE *file); |
29 | 29 | void eps_renderer_prolog_done(DiaRenderer *renderer); |
30 | 30 | |
31 | +extern DiaExportFilter eps_ft2_export_filter; | |
31 | 32 | extern DiaExportFilter eps_export_filter; |
32 | 33 | |
33 | 34 | #endif /* RENDER_EPS_H */ |
@@ -14,7 +14,7 @@ | ||
14 | 14 | #define GETTEXT_PACKAGE "dia" |
15 | 15 | #define LOCALEDIR "../lib/locale" |
16 | 16 | |
17 | -#define VERSION "0.92-pre3" | |
17 | +#define VERSION "0.92-pre4" | |
18 | 18 | |
19 | 19 | /* |
20 | 20 | * We are linking libxml as DLL with either msvc or mingw, but this |
@@ -1,6 +1,6 @@ | ||
1 | 1 | dnl Process this -*- autoconf -*- file with autoconf to produce a |
2 | 2 | dnl configure script. |
3 | -AC_INIT(dia, 0.92-pre3, http://bugzilla.gnome.org/enter_bug.cgi?product=dia) | |
3 | +AC_INIT(dia, 0.92-pre4, http://bugzilla.gnome.org/enter_bug.cgi?product=dia) | |
4 | 4 | AC_CONFIG_SRCDIR(app/diagram.c) |
5 | 5 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME,AC_PACKAGE_VERSION) |
6 | 6 |
@@ -162,7 +162,7 @@ dnl this likely already comes from GTK | ||
162 | 162 | dnl Something in here pollutes $LIBS with -lpng. Make sure to |
163 | 163 | dnl avoid that. |
164 | 164 | |
165 | -old_LIBS="$LIBS" | |
165 | +old_LIBS="${LIBS}" | |
166 | 166 | |
167 | 167 | png_ok=no |
168 | 168 | AC_CHECK_HEADER(png.h, png_ok=yes, png_ok=no) |
@@ -170,7 +170,8 @@ AC_CHECK_LIB(png, png_read_info, ,png_ok=no, -lz -lm) | ||
170 | 170 | if test "$png_ok" = yes; then |
171 | 171 | AC_MSG_CHECKING([for png_structp in png.h]) |
172 | 172 | dnl Why can't AC_LINK_IFELSE take extra libs? |
173 | - LIBS="${LIBS} -lz -lm" | |
173 | + old_LDFLAGS="${LDFLAGS}" | |
174 | + LDFLAGS="${LDFLAGS} -lz -lm" | |
174 | 175 | AC_LINK_IFELSE([#include <png.h> |
175 | 176 | png_structp pp; |
176 | 177 | png_infop info; |
@@ -178,6 +179,7 @@ if test "$png_ok" = yes; then | ||
178 | 179 | main() { void*foo = png_create_read_struct; }], |
179 | 180 | png_ok=yes, |
180 | 181 | png_ok=no) |
182 | + LDFLAGS="${old_LDFLAGS}" | |
181 | 183 | AC_MSG_RESULT($png_ok) |
182 | 184 | if test "$png_ok" = yes; then |
183 | 185 | PNG_LIBS='-lpng -lz -lm' |
@@ -4,7 +4,7 @@ | ||
4 | 4 | Summary: A gtk+ based diagram creation program. |
5 | 5 | Name: %name |
6 | 6 | Version: %ver |
7 | -Release: pre3 | |
7 | +Release: pre4 | |
8 | 8 | Copyright: GPL |
9 | 9 | Group: Applications/ |
10 | 10 | Source: ftp://ftp.gnome.org/pub/GNOME/stable/sources/dia/%{name}-%{ver}.tar.gz |
@@ -9,7 +9,7 @@ | ||
9 | 9 | <!ENTITY % entities SYSTEM "entities.xml"> |
10 | 10 | %entities; |
11 | 11 | |
12 | - <!ENTITY VERSION "0.92-pre3"> | |
12 | + <!ENTITY VERSION "0.92-pre4"> | |
13 | 13 | <!ENTITY INTRODUCTION SYSTEM "intro.xml"> |
14 | 14 | <!ENTITY QUICKSTART SYSTEM "usage-quickstart.xml"> |
15 | 15 | <!ENTITY CANVAS SYSTEM "usage-canvas.xml"> |
@@ -1,5 +1,5 @@ | ||
1 | 1 | <!DOCTYPE Book PUBLIC "-//OASIS//DTD DocBook V4.1//EN"[ |
2 | -<!ENTITY VERSION "0.92-pre3"> | |
2 | +<!ENTITY VERSION "0.92-pre4"> | |
3 | 3 | <!ENTITY INTRODUCTION SYSTEM "intro.sgml"> |
4 | 4 | <!ENTITY QUICKSTART SYSTEM "usage-quickstart.sgml"> |
5 | 5 | <!ENTITY CANVAS SYSTEM "usage-canvas.sgml"> |
@@ -700,6 +700,7 @@ static struct _legacy_font { | ||
700 | 700 | { "Bookman-Light", "Bookman Old Style", DIA_FONT_SERIF | DIA_FONT_LIGHT }, |
701 | 701 | { "Bookman-LightItalic", "Bookman Old Style", DIA_FONT_SERIF | DIA_FONT_LIGHT | DIA_FONT_ITALIC }, |
702 | 702 | { "BousungEG-Light-GB", "BousungEG-Light-GB", DIA_FONT_FAMILY_ANY }, |
703 | + { "Courier", "monospace", DIA_FONT_MONOSPACE }, | |
703 | 704 | { "Courier", "Courier New", DIA_FONT_MONOSPACE }, |
704 | 705 | { "Courier-Bold", "Courier New", DIA_FONT_MONOSPACE | DIA_FONT_BOLD }, |
705 | 706 | { "Courier-BoldOblique", "Courier New", DIA_FONT_MONOSPACE | DIA_FONT_OBLIQUE | DIA_FONT_BOLD }, |
@@ -709,6 +710,7 @@ static struct _legacy_font { | ||
709 | 710 | { "GothicBBB-Medium", "GothicBBB-Medium", DIA_FONT_FAMILY_ANY }, |
710 | 711 | { "Gulim", "Gulim", DIA_FONT_FAMILY_ANY }, |
711 | 712 | { "Headline", "Headline", DIA_FONT_FAMILY_ANY }, |
713 | + { "Helvetica", "sans", DIA_FONT_SANS }, | |
712 | 714 | { "Helvetica", "Arial", DIA_FONT_SANS }, |
713 | 715 | { "Helvetica-Bold", "Arial", DIA_FONT_SANS | DIA_FONT_BOLD }, |
714 | 716 | { "Helvetica-BoldOblique", "Arial", DIA_FONT_SANS | DIA_FONT_BOLD | DIA_FONT_OBLIQUE }, |
@@ -733,6 +735,7 @@ static struct _legacy_font { | ||
733 | 735 | { "Times-Bold", "Times New Roman", DIA_FONT_SERIF | DIA_FONT_BOLD }, |
734 | 736 | { "Times-BoldItalic", "Times New Roman", DIA_FONT_SERIF | DIA_FONT_ITALIC | DIA_FONT_BOLD }, |
735 | 737 | { "Times-Italic", "Times New Roman", DIA_FONT_SERIF | DIA_FONT_ITALIC }, |
738 | + { "Times-Roman", "serif", DIA_FONT_SERIF }, | |
736 | 739 | { "Times-Roman", "Times New Roman", DIA_FONT_SERIF }, |
737 | 740 | { "ZapfChancery-MediumItalic", "Zapf Calligraphic 801 SWA", DIA_FONT_SERIF | DIA_FONT_MEDIUM }, |
738 | 741 | { "ZapfDingbats", "Zapf Calligraphic 801 SWA", DIA_FONT_SERIF }, |