These are interesting results. The fact that only the lower alignments are affected means that either the font descent or the height of the logical text bounding box are calculated incorrectly. But why does this depend on font size?
You didn't attach the rendered result of your new testcase; maybe this could help understand the issue better. Also, I created and attached a new testcase with all font sizes from 1 to 20.
You can observe the font descent and logical text bounding box by adding the following lines to libgedacairo/edarenderer.c:
+ fprintf (stderr, "%.3f %.3f ",
+ (double) y_lower / PANGO_SCALE,
+ (double) descent / PANGO_SCALE);
+ fprintf (stderr, "[%.3f %.3f %.3f %.3f]\n",
+ (double) logical_rect.x / PANGO_SCALE,
+ (double) logical_rect.y / PANGO_SCALE,
+ (double) logical_rect.width / PANGO_SCALE,
+ (double) logical_rect.height / PANGO_SCALE);
+
/* Special case flips attachment point to opposite corner when
* the text is rotated to 180 degrees, since the drawing code
* does not rotate the text to be shown upside down.
These are interesting results. The fact that only the lower alignments are affected means that either the font descent or the height of the logical text bounding box are calculated incorrectly. But why does this depend on font size?
You didn't attach the rendered result of your new testcase; maybe this could help understand the issue better. Also, I created and attached a new testcase with all font sizes from 1 to 20.
You can observe the font descent and logical text bounding box by adding the following lines to libgedacairo/ edarenderer. c:
@@ -971,6 +971,15 @@ eda_renderer_ calc_text_ position (EdaRenderer *renderer, OBJECT *object, rect.height; /* Baseline of bottom line */
y_middle = y_upper - inked_rect.height / 2.; /* Middle of inked extents */
y_lower = descent - logical_
+ fprintf (stderr, "%.3f %.3f ",
+ (double) y_lower / PANGO_SCALE,
+ (double) descent / PANGO_SCALE);
+ fprintf (stderr, "[%.3f %.3f %.3f %.3f]\n",
+ (double) logical_rect.x / PANGO_SCALE,
+ (double) logical_rect.y / PANGO_SCALE,
+ (double) logical_rect.width / PANGO_SCALE,
+ (double) logical_rect.height / PANGO_SCALE);
+
/* Special case flips attachment point to opposite corner when
* the text is rotated to 180 degrees, since the drawing code
* does not rotate the text to be shown upside down.
Maybe a pattern emerges here.