tscircuit / tscircuit/cli

KiCad silkscreen export substitutes wider text metrics and a fixed 0.15 mm stroke

Open
#4,719 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
18
Forks
91
Avg merge
31m
Merged PRs (30d)
349

Description

Versions: @tscircuit/cli 0.1.2057, @tscircuit/core 0.0.1892, circuit-to-svg 0.0.413; KiCad 10.0.2. Linux/WSL2.

A silkscreentext with fontSize=0.8 is exported as native KiCad text with (size 0.8 0.8) and a fixed (thickness 0.15). The source preview allocates 0.6 * fontSize per character, but the substituted KiCad font has a materially different width. Text clear in the SVG can overlap adjacent silkscreen or run off the PCB in the exported project.

Minimal reproduction:

export default () => <board width={10.4} height={10.4}>
  <silkscreentext text="SN74LVC1G17DCKR" pcbX={0} pcbY={0} fontSize={0.8}/>
</board>

Run tsci build lib/index.tsx --svgs --kicad-project, compare the PCB SVG against the exported KiCad text's effective shape, then run native DRC. In our real small-board fixture this produced silk_edge_clearance and text-to-text silk_overlap even after increasing the nominal text height to 0.8 mm.

Expected: preserve the source font or export native text with equivalent metrics and stroke, so layout/clearance review transfers to the exported board. Expose/document any unavoidable font substitution. Do not lower text-height rules or hide warnings.

Local workaround implemented in the family exporter: preserve native text height, use a 0.10-mm stroke, and fit the native text width to the source allocation using KiCad's measured bounding box. No upstream PR is open from this work; this issue remains available for an upstream implementation.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the family exporter used by tsci build lib/index.tsx --svgs --kicad-project, then compare the source PCB SVG with the exported KiCad text's effective shape. Reproduce the small-board case and run native KiCad DRC, checking silk_edge_clearance and silk_overlap. Done means exported text preserves or documents equivalent metrics without suppressing clearance warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.