[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: gaf.git: branch: master updated (1.5.2-20090328-198-gb9adcff)



The branch, master has been updated
       via  b9adcffad55d8f6a5633afb79b9522ba840bda22 (commit)
       via  f9e5481638f4ab3b86054d82ce10e10b008d9657 (commit)
      from  e869033324d7595cc11d42007109a605823e1640 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gschem/lib/system-gschemrc.in       |    9 ---------
 gschem/src/g_rc.c                   |   26 ++++++++++----------------
 gschem/src/i_vars.c                 |    2 --
 libgeda/include/libgeda/prototype.h |    2 ++
 libgeda/include/libgeda/struct.h    |    3 ---
 libgeda/src/o_text_basic.c          |   35 +++++++++++++++++++++++++++++++++--
 libgeda/src/s_toplevel.c            |    1 -
 7 files changed, 45 insertions(+), 33 deletions(-)


=================
 Commit Messages
=================

commit b9adcffad55d8f6a5633afb79b9522ba840bda22
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Reinstate (postscript-font-scale ...) option to catch deprecated usage.
    
    The replacement handler issues a warning that the parameter is
    deprecated and will be removed. The parameter value is ignored.

:100644 100644 6c9c0cb... a4008c7... M	gschem/src/g_rc.c
:100644 100644 774284a... c8aebe9... M	gschem/src/g_register.c

commit f9e5481638f4ab3b86054d82ce10e10b008d9657
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Hard-code the gEDA font-size to postscript points scale factor.
    
    Replaces the (postscript-font-scale ...) option, and the scale
    factor hard-coded in gschem's pango text rendering routines.

:100644 100644 2a806b3... ce6587f... M	gschem/lib/system-gschemrc.in
:100644 100644 068dcbf... 6c9c0cb... M	gschem/src/g_rc.c
:100644 100644 c8aebe9... 774284a... M	gschem/src/g_register.c
:100644 100644 71a3c76... f7a67e6... M	gschem/src/i_vars.c
:100644 100644 731f753... 68ae3c8... M	libgeda/include/libgeda/prototype.h
:100644 100644 ba17787... ca16954... M	libgeda/include/libgeda/struct.h
:100644 100644 853eea4... 85d19ed... M	libgeda/src/o_text_basic.c
:100644 100644 8da3498... 0b0829b... M	libgeda/src/s_toplevel.c

=========
 Changes
=========

commit b9adcffad55d8f6a5633afb79b9522ba840bda22
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Reinstate (postscript-font-scale ...) option to catch deprecated usage.
    
    The replacement handler issues a warning that the parameter is
    deprecated and will be removed. The parameter value is ignored.

diff --git a/gschem/src/g_rc.c b/gschem/src/g_rc.c
index 6c9c0cb..a4008c7 100644
--- a/gschem/src/g_rc.c
+++ b/gschem/src/g_rc.c
@@ -424,6 +424,26 @@ SCM g_rc_text_size(SCM size)
   return SCM_BOOL_T;
 }
 
+/*! \brief Catch deprecated option to set the output font scaling factor
+ *
+ *  \par This setting used to change the scale of the output PS font
+ *  characters. Since gEDA 1.6.0, this is fixed to match the on-screen
+ *  font size.
+ *
+ *  \return SCM_BOOL_T always.
+ */
+
+SCM g_rc_postscript_font_scale(SCM scale)
+{
+  g_warning (_("\n"
+               "The config option postscript-font-scale is "
+               "deprecated and will be removed in gEDA 1.8.0.\n"
+               "Printed text is fixed to match on-screen sizes. "
+               "Please remove this option from your config files.\n"
+               "\n"));
+
+  return SCM_BOOL_T;
+}
 
 /*! \todo Finish function documentation!!!
  *  \brief
diff --git a/gschem/src/g_register.c b/gschem/src/g_register.c
index 774284a..c8aebe9 100644
--- a/gschem/src/g_register.c
+++ b/gschem/src/g_register.c
@@ -81,6 +81,7 @@ static struct gsubr_t gschem_funcs[] = {
   { "attribute-name",            1, 0, 0, g_rc_attribute_name },
   { "paper-size",                2, 0, 0, g_rc_paper_size },
   { "paper-sizes",               3, 0, 0, g_rc_paper_sizes },
+  { "postscript-font-scale",     1, 0, 0, g_rc_postscript_font_scale },
 
   { "output-type",               1, 0, 0, g_rc_output_type },
   { "output-orientation",        1, 0, 0, g_rc_output_orientation },

commit f9e5481638f4ab3b86054d82ce10e10b008d9657
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Hard-code the gEDA font-size to postscript points scale factor.
    
    Replaces the (postscript-font-scale ...) option, and the scale
    factor hard-coded in gschem's pango text rendering routines.

diff --git a/gschem/lib/system-gschemrc.in b/gschem/lib/system-gschemrc.in
index 2a806b3..ce6587f 100644
--- a/gschem/lib/system-gschemrc.in
+++ b/gschem/lib/system-gschemrc.in
@@ -602,15 +602,6 @@
 ;
 (print-command "lpr")
 
-; postscript-font-scale real
-;
-; Sets a scaling factor for the text in the PostScript output.  This
-; can be used to make the output postscript font slightly larger to
-; more closely match the text in the printout to the size of the text
-; on the screen.
-;  The default value is 1.0.
-(postscript-font-scale 1.0)
-
 
 ; output-type string
 ;
diff --git a/gschem/src/g_rc.c b/gschem/src/g_rc.c
index 068dcbf..6c9c0cb 100644
--- a/gschem/src/g_rc.c
+++ b/gschem/src/g_rc.c
@@ -424,32 +424,6 @@ SCM g_rc_text_size(SCM size)
   return SCM_BOOL_T;
 }
 
-/*! \brief Sets the output font scaling factor 
- *
- *  \par Use this setting to change the scale of the output PS font
- *  characters. This allows to fine tune the font size so that it
- *  matches more closely with the screen.
- *
- *  \return SCM_BOOL_T always.
- */
-
-SCM g_rc_postscript_font_scale(SCM scale)
-{
-  float val;
-
-  SCM_ASSERT (SCM_REALP (scale), scale, SCM_ARG1, "postscript-font-scale");
-
-  val =(float)(SCM_REAL_VALUE (scale));
-  if (val == 0) {
-    fprintf(stderr, _("Invalid size [%f] passed to postscript-font-scale\n"),
-            val);
-    val = 1.0; /* absolute default */
-  }
-
-  default_postscript_font_scale = val;
-
-  return SCM_BOOL_T;
-}
 
 /*! \todo Finish function documentation!!!
  *  \brief
diff --git a/gschem/src/g_register.c b/gschem/src/g_register.c
index c8aebe9..774284a 100644
--- a/gschem/src/g_register.c
+++ b/gschem/src/g_register.c
@@ -81,7 +81,6 @@ static struct gsubr_t gschem_funcs[] = {
   { "attribute-name",            1, 0, 0, g_rc_attribute_name },
   { "paper-size",                2, 0, 0, g_rc_paper_size },
   { "paper-sizes",               3, 0, 0, g_rc_paper_sizes },
-  { "postscript-font-scale",     1, 0, 0, g_rc_postscript_font_scale },
 
   { "output-type",               1, 0, 0, g_rc_output_type },
   { "output-orientation",        1, 0, 0, g_rc_output_orientation },
diff --git a/gschem/src/i_vars.c b/gschem/src/i_vars.c
index 71a3c76..f7a67e6 100644
--- a/gschem/src/i_vars.c
+++ b/gschem/src/i_vars.c
@@ -38,7 +38,6 @@
 
 int   default_text_size = 10;
 int   default_text_caps = LOWER;
-float default_postscript_font_scale = 1.0;
 int   default_attribute_color = ATTRIBUTE_COLOR;
 int   default_detachattr_color = DETACHED_ATTRIBUTE_COLOR;
 int   default_net_endpoint_color = NET_ENDPOINT_COLOR;
@@ -152,7 +151,6 @@ void i_vars_set(GSCHEM_TOPLEVEL *w_current)
 
   w_current->text_size     = default_text_size;
   w_current->text_caps     = default_text_caps;
-  toplevel->postscript_font_scale = default_postscript_font_scale;
 
   toplevel->background_color = default_background_color;
 
diff --git a/libgeda/include/libgeda/prototype.h b/libgeda/include/libgeda/prototype.h
index 731f753..68ae3c8 100644
--- a/libgeda/include/libgeda/prototype.h
+++ b/libgeda/include/libgeda/prototype.h
@@ -271,6 +271,8 @@ void o_text_mirror_world(TOPLEVEL *toplevel, int world_centerx, int world_center
 void o_text_set_string(TOPLEVEL *toplevel, OBJECT *obj, const gchar *new_string);
 const gchar *o_text_get_string(TOPLEVEL *toplevel, OBJECT *obj);
 void o_text_set_rendered_bounds_func (TOPLEVEL *toplevel, RenderedBoundsFunc func, void *user_data);
+double o_text_get_font_size_in_points(TOPLEVEL *toplevel, OBJECT *object);
+
 /* s_attrib.c */
 int s_attrib_add_entry(char *new_attrib);
 void s_attrib_print(void);
diff --git a/libgeda/include/libgeda/struct.h b/libgeda/include/libgeda/struct.h
index ba17787..ca16954 100644
--- a/libgeda/include/libgeda/struct.h
+++ b/libgeda/include/libgeda/struct.h
@@ -519,9 +519,6 @@ struct st_toplevel {
   /* The name of the prolog file to paste into the Postscript output */
   char *postscript_prolog;
 
-  /* Use this as a scaling factor for the output font */
-  float postscript_font_scale;
-
   /* controls if the net consolidation code is used */ 
   int net_consolidate; 
 
diff --git a/libgeda/src/o_text_basic.c b/libgeda/src/o_text_basic.c
index 853eea4..85d19ed 100644
--- a/libgeda/src/o_text_basic.c
+++ b/libgeda/src/o_text_basic.c
@@ -85,6 +85,18 @@
 #include <dmalloc.h>
 #endif
 
+/*! \brief Scale factor between legacy gschem font units and postscript points.
+ *
+ *  \par Description
+ *  gschem fonts are nominally specified in points, however there is a
+ *  difference in how the specified font size corresponds to the metrics of
+ *  the font when compared to typical typographic usage.
+ *
+ *  The following factor was impirically determined to approximately match the
+ *  cap-height between the legacy gschem font, and fonts rendered using pango.
+ */
+#define GEDA_FONT_FACTOR 1.3
+
 /*! Default setting for text draw function. */
 void (*text_draw_func)() = NULL;
 
@@ -1725,8 +1737,8 @@ void o_text_print(TOPLEVEL *toplevel, FILE *fp, OBJECT *o_current,
   /* Collect pertinent info about the text location */
   x = o_current->text->x;
   y = o_current->text->y;
-  font_size = (((float)(o_current->text->size))
-	       * toplevel->postscript_font_scale / 72.0 * 1000.0);
+  font_size = o_text_get_font_size_in_points (toplevel, o_current)
+                / 72.0 * 1000.0;
   fprintf(fp,"] %d %d %d %f text\n",angle,x,y,font_size);
 
   
@@ -1949,3 +1961,22 @@ void o_text_set_rendered_bounds_func (TOPLEVEL *toplevel,
   toplevel->rendered_text_bounds_func = func;
   toplevel->rendered_text_bounds_data = user_data;
 }
+
+
+/*! \brief Return font size of a text object in postscript points.
+ *
+ *  \par Description
+ *  gEDA fonts are specified in a non-standard unit. This
+ *  function applies an appopriate scaling to return the
+ *  font size in postscript points.
+ *
+ *  \param [in] toplevel  The TOPLEVEL object
+ *  \param [in] object    The text OBJECT whos font size to return
+ *  \return The font size converted to postscript points.
+ */
+double o_text_get_font_size_in_points (TOPLEVEL *toplevel, OBJECT *object)
+{
+  g_return_val_if_fail (object->type == OBJ_TEXT, 0.);
+
+  return object->text->size * GEDA_FONT_FACTOR;
+}
diff --git a/libgeda/src/s_toplevel.c b/libgeda/src/s_toplevel.c
index 8da3498..0b0829b 100644
--- a/libgeda/src/s_toplevel.c
+++ b/libgeda/src/s_toplevel.c
@@ -100,7 +100,6 @@ TOPLEVEL *s_toplevel_new (void)
   toplevel->setpagedevice_pagesize = FALSE;
 
   toplevel->postscript_prolog = NULL;
-  toplevel->postscript_font_scale = 1.0;
 
   toplevel->net_consolidate = FALSE;
 




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs