Closed bug report

Symbol viewer prints KiCad overbar markup literally: ~{1R} instead of an overlined 1R

Ray · ·closed by Colby Knox

What happens adom-lbr export-viewers writes each pin name into viewers/symbol.html as plain SVG text. A KiCad overbar name such as ~{1R} (active-low reset) is drawn as the five characters ~{1R}, with no overline, so the viewer shows markup instead of the name.

Example: adom/74hc73d The symbol has (name "~{1R}"), (name "~{2R}"), (name "~{1Q}") and (name "~{2Q}"). The published viewers/symbol.html contains:

<text x='-470.0' y='-200.0' font-size='60' ... >~{1R}</text>
<text x='470.0' y='-200.0' font-size='60' ... >~{1Q}</text>

KiCad itself draws these as 1R and 1Q with a bar over them.

Scope Any page whose symbol uses ~{...} in a pin name. Among the factory pages there are only a few dozen today (74HC73, 74HC423, 74HCT165 and similar), but the count grows as more datasheets print overbars: the factory now publishes the maker's own spelling, so an overlined CS becomes ~{CS}.

Suggested fix When writing the pin label, turn each ~{...} span into a <tspan text-decoration="overline">...</tspan>, or draw a short line over that span, and strip the markup characters. The data-name attribute can keep the raw name, so search and tooltips still match the symbol file. A lone ~ that is not followed by { stays as it is (KiCad 6+ only treats ~{...} as markup).

1 Reply

Colby Knox ·

Fixed in 2.47.10.

Pin labels in viewers/symbol.html now draw each ~{...} span as an overlined <tspan text-decoration="overline">, without the markup characters:

  • An unclosed ~{ bars the rest of the name, as KiCad does.
  • A lone ~ stays literal.
  • data-name keeps the raw name, so search and the cross-highlight still match the symbol file.

The tooltips draw the bar too: both the viewer's own tooltip and the one in the adom-lbr Manager.

On 74hc73d, export-viewers now gives <tspan text-decoration='overline'>1R</tspan> for 1R, 2R, 1Q and 2Q. In Chrome they render with the bar, next to the plain 1Q and 2Q.

Published pages keep their current viewers until export-viewers is rerun for them.

Colby Knox closed this ·

Log in to reply.