scale schematic font sizes to em-height and render image borders - #143
Open
anil08607 wants to merge 1 commit into
Open
scale schematic font sizes to em-height and render image borders#143anil08607 wants to merge 1 commit into
anil08607 wants to merge 1 commit into
Conversation
|
@anil08607 is attempting to deploy a commit to the tscircuit Team on Vercel. A member of the Team first needs to authorize it. |
| size: number | ||
| } | ||
|
|
||
| export const SCHEMATIC_FONT_SIZE_SCALE = 0.8 |
Contributor
There was a problem hiding this comment.
Font size scales based on the font, and different fonts can be used
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes schematic text sizing overflow and missing image borders in rendered SVGs (specifically observed on sheet 57 of
ti-tmds62levm-rev-baround the "SCREW & WASHER FOR PCIe M.2" section):Schematic Font Size Scaling:
SIZEparameter defines font cell height / line spacing in 10-mil units (font-sizeresulted in text rendering ~25% larger than in Altium Designer, causing headers such as"SCREW & WASHER FOR PCIe M.2"(SIZE=25) to overflow their bounding boxes.SCHEMATIC_FONT_SIZE_SCALE = 0.8inlib/svg-serialization/get-schematic-font.tsto convert Altium cell height into standard SVG typographical em-square font size.Schematic Image Border Rectangle:
RECORD=30) specify a border color via theColorfield (e.g.Color=128/#800000on the washer drawing in Sheet 57).<rect data-record="30" ... fill="none" stroke="${color}" stroke-width="${formatSvgNumber(lineWidth)}"/>) inlib/svg-serialization/serialize-altium-sheet-to-svg.tswhenCOLORis defined on the record.Snapshots & Test Coverage:
tests/svg/ti-tmds62levm-schematic-sheets.test.tsto include Sheet 57 in snapshot assertions.tests/svg/__snapshots__/ti-tmds62levm-schematic-sheets-sheet-57.snap.svgand existing affected SVG snapshots.tests/svg/schematic-sheet-57-screw-washer.test.tsto guard against regressions for text bounding and washer borders.Verification
bun test: All 228 tests passing across 96 suites (including 57/57 TI TMDS62LEVM schematic sheets).bun run typecheck: Passed with 0 errors.bun run format:check: Passed.bun run build: Clean build.