"middle" does not refer to the base line of the font

Bug #795130 reported by KaiMartin
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gEDA
Triaged
Medium
Unassigned

Bug Description

Currently, the middle option of vertical text alignment refers to the middle of the actual string.

To reproduce:

1) open gschem

2) add three separate texts "aaa", "ppp" and "ZZZ" with the accel [at]

3) put the alignment mark of the strings on the same vertical grid line. The base line of the letters coincides now. All three strings are on the same height.

4) set the alignment of the texts to "middle-left".
The strings will move up by different amounts. As a result, the "ZZZ" is lower and the "ppp" is higher than the other "aaa". A similar sub optimum vertical alignment happens with the "upper" options. See the attached screenshot.

That way, a hyphen is rendered at the same height as an underscore. This is clearly not usefull in the context of pin labels and generally symbol design.

Proposed fix: Align the the text with reference to the base line. The "lower" options already do this.

---<)kaimartin)>---

Tags: gschem libgeda
Revision history for this message
KaiMartin (kmk-familieknaak) wrote :
Revision history for this message
DJ Delorie (djdelorie) wrote :

I hope you meant "use the overall font metrics to middle-align the text" and not "make middle the same as lower"

Or better, just use the letter 'M' to determine middle alignment.

Revision history for this message
Peter TB Brett (peter-b) wrote :

KaiMartin: Could you please check whether the alignment of text is correct in the PS output, or whether it exhibits the same behaviour?

DJ:

> Or better, just use the letter 'M' to determine middle alignment.

How is that "better"? That heuristic depends on the invalid assumption that the text uses the Latin alphabet.

Using the overall font metrics is the "right thing" here, but as usual we need to be careful not to gratuitously break everyone's existing schematics.

Changed in geda:
status: New → Incomplete
tags: added: gschem
Revision history for this message
DJ Delorie (djdelorie) wrote :

The reason "M" is better is because overall font metrics include EVERY glyph, even ones that extend an unusual amount outside the "norm" for the font. I suppose you could use "font size" to come up with something relative to the baseline, but that will require some tweaking to get results that look good across a variety of fonts.

Also, "M" is most like what "everyone's existing schematics" is already using, and is a decent representative of "average glyph size" even if the "M" (or other iso-latin-1 glyphs) doesn't occur anywhere in the string.

Revision history for this message
KaiMartin (kmk-familieknaak) wrote :

@ DJ: Yes, I meant, the marker should correspond to the middle of the font. This might be calculated as the mean height of all glyphs. If the height of base line and mid line are available, these may be used to calculate some reasonable approximation to the mean height.
The vertical shift should depend on the font, not on the actual string.

@Peter Brett: Postscript output shows the same symptoms. See attachment.

---<)kaimartin(>---

Revision history for this message
Peter TB Brett (peter-b) wrote :

Okay, this is clearly something we need to think about fixing. Since the print output and on-screen appearance are at least consistent with each other at the moment, it's not particularly urgent IMHO.

I think it's reasonable to say that we should aim to keep the appearance of the reference card (gschem/examples/drawing_primitives.sch) the same when we fix this.

Changed in geda:
status: Incomplete → Confirmed
importance: Undecided → Low
tags: added: libgeda
Peter TB Brett (peter-b)
Changed in geda:
status: Confirmed → Triaged
Roland Lutz (rlutz)
Changed in geda:
importance: Low → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.