• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

作図ソフト dia の改良版


Commit MetaInfo

Revision5999a091b725a1cd0863f62183b7780e16fda0fa (tree)
Time2003-09-29 01:19:32
AuthorLars Clausen <lclausen@src....>
CommiterLars Clausen

Log Message

Font render thingy.

Change Summary

Incremental Difference

--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,27 @@
22
33 * makefile.msc: added target po to update the translations
44
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+
526 2003-08-03 Hans Breuer <hans@breuer.org>
627
728 * config.h.win32 : close the version string
--- a/NEWS
+++ b/NEWS
@@ -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+
18 dia-0.92-pre3: 22-Sep-2003
29
310 * Working caching of Pango context removes huge slowdown from pre2.
--- a/app/app_procs.c
+++ b/app/app_procs.c
@@ -667,9 +667,16 @@ internal_plugin_init(PluginInfo *info)
667667 filter_register_import(&dia_import_filter);
668668
669669 /* register export filters */
670+ /* Standard Dia format */
670671 filter_register_export(&dia_export_filter);
672+ /* EPS with PS fonts */
671673 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
672678 #if defined(HAVE_LIBPNG) && defined(HAVE_LIBART)
679+ /* PNG with libart rendering */
673680 filter_register_export(&png_export_filter);
674681 #endif
675682
--- a/app/diapsrenderer.c
+++ b/app/diapsrenderer.c
@@ -240,7 +240,7 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
240240 DiaPsRenderer *renderer = DIA_PS_RENDERER(self);
241241
242242 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);
244244 }
245245
246246 static void
--- a/app/render_eps.c
+++ b/app/render_eps.c
@@ -66,18 +66,38 @@
6666 #include "diapsft2renderer.h"
6767 #endif
6868
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+
6986 static void
7087 export_eps(DiagramData *data, const gchar *filename,
7188 const gchar *diafilename, void* user_data)
7289 {
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+{
7499 FILE *outfile;
75100
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
81101 outfile = fopen(filename, "w");
82102 if (outfile == NULL) {
83103 message_error(_("Can't open output file %s: %s\n"), filename, strerror(errno));
@@ -114,9 +134,17 @@ new_psprint_renderer(Diagram *dia, FILE *file)
114134 return DIA_RENDERER(renderer);
115135 }
116136
137+#ifdef HAVE_FREETYPE
117138 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+
118146 DiaExportFilter eps_export_filter = {
119- N_("Encapsulated Postscript"),
147+ N_("Encapsulated Postscript (using builtin PS fonts)"),
120148 extensions,
121149 export_eps
122150 };
--- a/app/render_eps.h
+++ b/app/render_eps.h
@@ -28,6 +28,7 @@ DiaRenderer *new_eps_renderer(Diagram *dia, char *filename);
2828 DiaRenderer *new_psprint_renderer(Diagram *dia, FILE *file);
2929 void eps_renderer_prolog_done(DiaRenderer *renderer);
3030
31+extern DiaExportFilter eps_ft2_export_filter;
3132 extern DiaExportFilter eps_export_filter;
3233
3334 #endif /* RENDER_EPS_H */
--- a/config.h.win32
+++ b/config.h.win32
@@ -14,7 +14,7 @@
1414 #define GETTEXT_PACKAGE "dia"
1515 #define LOCALEDIR "../lib/locale"
1616
17-#define VERSION "0.92-pre3"
17+#define VERSION "0.92-pre4"
1818
1919 /*
2020 * We are linking libxml as DLL with either msvc or mingw, but this
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
11 dnl Process this -*- autoconf -*- file with autoconf to produce a
22 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)
44 AC_CONFIG_SRCDIR(app/diagram.c)
55 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME,AC_PACKAGE_VERSION)
66
@@ -162,7 +162,7 @@ dnl this likely already comes from GTK
162162 dnl Something in here pollutes $LIBS with -lpng. Make sure to
163163 dnl avoid that.
164164
165-old_LIBS="$LIBS"
165+old_LIBS="${LIBS}"
166166
167167 png_ok=no
168168 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)
170170 if test "$png_ok" = yes; then
171171 AC_MSG_CHECKING([for png_structp in png.h])
172172 dnl Why can't AC_LINK_IFELSE take extra libs?
173- LIBS="${LIBS} -lz -lm"
173+ old_LDFLAGS="${LDFLAGS}"
174+ LDFLAGS="${LDFLAGS} -lz -lm"
174175 AC_LINK_IFELSE([#include <png.h>
175176 png_structp pp;
176177 png_infop info;
@@ -178,6 +179,7 @@ if test "$png_ok" = yes; then
178179 main() { void*foo = png_create_read_struct; }],
179180 png_ok=yes,
180181 png_ok=no)
182+ LDFLAGS="${old_LDFLAGS}"
181183 AC_MSG_RESULT($png_ok)
182184 if test "$png_ok" = yes; then
183185 PNG_LIBS='-lpng -lz -lm'
--- a/dia.spec
+++ b/dia.spec
@@ -4,7 +4,7 @@
44 Summary: A gtk+ based diagram creation program.
55 Name: %name
66 Version: %ver
7-Release: pre3
7+Release: pre4
88 Copyright: GPL
99 Group: Applications/
1010 Source: ftp://ftp.gnome.org/pub/GNOME/stable/sources/dia/%{name}-%{ver}.tar.gz
--- a/doc/en/dia-manual.xml
+++ b/doc/en/dia-manual.xml
@@ -9,7 +9,7 @@
99 <!ENTITY % entities SYSTEM "entities.xml">
1010 %entities;
1111
12- <!ENTITY VERSION "0.92-pre3">
12+ <!ENTITY VERSION "0.92-pre4">
1313 <!ENTITY INTRODUCTION SYSTEM "intro.xml">
1414 <!ENTITY QUICKSTART SYSTEM "usage-quickstart.xml">
1515 <!ENTITY CANVAS SYSTEM "usage-canvas.xml">
--- a/doc/pl/dia-manual.sgml
+++ b/doc/pl/dia-manual.sgml
@@ -1,5 +1,5 @@
11 <!DOCTYPE Book PUBLIC "-//OASIS//DTD DocBook V4.1//EN"[
2-<!ENTITY VERSION "0.92-pre3">
2+<!ENTITY VERSION "0.92-pre4">
33 <!ENTITY INTRODUCTION SYSTEM "intro.sgml">
44 <!ENTITY QUICKSTART SYSTEM "usage-quickstart.sgml">
55 <!ENTITY CANVAS SYSTEM "usage-canvas.sgml">
--- a/lib/font.c
+++ b/lib/font.c
@@ -700,6 +700,7 @@ static struct _legacy_font {
700700 { "Bookman-Light", "Bookman Old Style", DIA_FONT_SERIF | DIA_FONT_LIGHT },
701701 { "Bookman-LightItalic", "Bookman Old Style", DIA_FONT_SERIF | DIA_FONT_LIGHT | DIA_FONT_ITALIC },
702702 { "BousungEG-Light-GB", "BousungEG-Light-GB", DIA_FONT_FAMILY_ANY },
703+ { "Courier", "monospace", DIA_FONT_MONOSPACE },
703704 { "Courier", "Courier New", DIA_FONT_MONOSPACE },
704705 { "Courier-Bold", "Courier New", DIA_FONT_MONOSPACE | DIA_FONT_BOLD },
705706 { "Courier-BoldOblique", "Courier New", DIA_FONT_MONOSPACE | DIA_FONT_OBLIQUE | DIA_FONT_BOLD },
@@ -709,6 +710,7 @@ static struct _legacy_font {
709710 { "GothicBBB-Medium", "GothicBBB-Medium", DIA_FONT_FAMILY_ANY },
710711 { "Gulim", "Gulim", DIA_FONT_FAMILY_ANY },
711712 { "Headline", "Headline", DIA_FONT_FAMILY_ANY },
713+ { "Helvetica", "sans", DIA_FONT_SANS },
712714 { "Helvetica", "Arial", DIA_FONT_SANS },
713715 { "Helvetica-Bold", "Arial", DIA_FONT_SANS | DIA_FONT_BOLD },
714716 { "Helvetica-BoldOblique", "Arial", DIA_FONT_SANS | DIA_FONT_BOLD | DIA_FONT_OBLIQUE },
@@ -733,6 +735,7 @@ static struct _legacy_font {
733735 { "Times-Bold", "Times New Roman", DIA_FONT_SERIF | DIA_FONT_BOLD },
734736 { "Times-BoldItalic", "Times New Roman", DIA_FONT_SERIF | DIA_FONT_ITALIC | DIA_FONT_BOLD },
735737 { "Times-Italic", "Times New Roman", DIA_FONT_SERIF | DIA_FONT_ITALIC },
738+ { "Times-Roman", "serif", DIA_FONT_SERIF },
736739 { "Times-Roman", "Times New Roman", DIA_FONT_SERIF },
737740 { "ZapfChancery-MediumItalic", "Zapf Calligraphic 801 SWA", DIA_FONT_SERIF | DIA_FONT_MEDIUM },
738741 { "ZapfDingbats", "Zapf Calligraphic 801 SWA", DIA_FONT_SERIF },