@tscircuit/core 0.0.2139 → 0.0.2141

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +118 -3
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -115779,10 +115779,125 @@ import {
115779
115779
 
115780
115780
  // lib/components/primitive-components/Group/Group_doInitialSchematicTraceRender/getSchematicTextBounds.ts
115781
115781
  import { getBoundsFromPoints as getBoundsFromPoints10 } from "@tscircuit/math-utils";
115782
+
115783
+ // lib/utils/schematic/getSchematicTextObstacleWidth.ts
115784
+ var ASCII_ADVANCES = [
115785
+ 28,
115786
+ 28,
115787
+ 35,
115788
+ 56,
115789
+ 56,
115790
+ 89,
115791
+ 67,
115792
+ 19,
115793
+ 33,
115794
+ 33,
115795
+ 39,
115796
+ 58,
115797
+ 28,
115798
+ 33,
115799
+ 28,
115800
+ 28,
115801
+ 56,
115802
+ 56,
115803
+ 56,
115804
+ 56,
115805
+ 56,
115806
+ 56,
115807
+ 56,
115808
+ 56,
115809
+ 56,
115810
+ 56,
115811
+ 28,
115812
+ 28,
115813
+ 58,
115814
+ 58,
115815
+ 58,
115816
+ 56,
115817
+ 102,
115818
+ 67,
115819
+ 67,
115820
+ 72,
115821
+ 72,
115822
+ 67,
115823
+ 61,
115824
+ 78,
115825
+ 72,
115826
+ 28,
115827
+ 50,
115828
+ 67,
115829
+ 56,
115830
+ 83,
115831
+ 72,
115832
+ 78,
115833
+ 67,
115834
+ 78,
115835
+ 72,
115836
+ 67,
115837
+ 61,
115838
+ 72,
115839
+ 67,
115840
+ 94,
115841
+ 67,
115842
+ 67,
115843
+ 61,
115844
+ 28,
115845
+ 28,
115846
+ 28,
115847
+ 47,
115848
+ 56,
115849
+ 33,
115850
+ 56,
115851
+ 56,
115852
+ 50,
115853
+ 56,
115854
+ 56,
115855
+ 28,
115856
+ 56,
115857
+ 56,
115858
+ 22,
115859
+ 22,
115860
+ 50,
115861
+ 22,
115862
+ 83,
115863
+ 56,
115864
+ 56,
115865
+ 56,
115866
+ 56,
115867
+ 33,
115868
+ 50,
115869
+ 28,
115870
+ 56,
115871
+ 50,
115872
+ 72,
115873
+ 50,
115874
+ 50,
115875
+ 50,
115876
+ 33,
115877
+ 26,
115878
+ 33,
115879
+ 58
115880
+ ];
115881
+ function getSchematicTextObstacleWidth({
115882
+ text,
115883
+ fontSize
115884
+ }) {
115885
+ let totalAdvance = 0;
115886
+ for (const character of text) {
115887
+ const advance = ASCII_ADVANCES[character.charCodeAt(0) - 32];
115888
+ if (advance === void 0) {
115889
+ return getSchematicTextWidth({ text, fontSize });
115890
+ }
115891
+ totalAdvance += advance;
115892
+ }
115893
+ return totalAdvance * (fontSize / 100);
115894
+ }
115895
+
115896
+ // lib/components/primitive-components/Group/Group_doInitialSchematicTraceRender/getSchematicTextBounds.ts
115782
115897
  var DEFAULT_SCHEMATIC_TEXT_FONT_SIZE = 0.18;
115783
115898
  function getSchematicTextBounds2(text) {
115784
115899
  const fontSize = text.font_size ?? DEFAULT_SCHEMATIC_TEXT_FONT_SIZE;
115785
- const width = getSchematicTextWidth({
115900
+ const width = getSchematicTextObstacleWidth({
115786
115901
  text: text.text ?? "",
115787
115902
  fontSize
115788
115903
  });
@@ -118433,7 +118548,7 @@ var RoutingPhasePreparationError = class extends Error {
118433
118548
  var package_default = {
118434
118549
  name: "@tscircuit/core",
118435
118550
  type: "module",
118436
- version: "0.0.2138",
118551
+ version: "0.0.2140",
118437
118552
  types: "dist/index.d.ts",
118438
118553
  main: "dist/index.js",
118439
118554
  module: "dist/index.js",
@@ -118471,7 +118586,7 @@ var package_default = {
118471
118586
  "@tscircuit/bus-lanes-solver": "https://jscdn.tscircuit.com/@tscircuit/bus-lanes-solver/0.0.21.tgz",
118472
118587
  "@tscircuit/cableprinter": "^0.0.6",
118473
118588
  "@tscircuit/capacity-autorouter": "^0.0.974",
118474
- "@tscircuit/checks": "^0.0.250",
118589
+ "@tscircuit/checks": "^0.0.251",
118475
118590
  "@tscircuit/circuit-json-util": "^0.0.121",
118476
118591
  "@tscircuit/common": "^0.0.20",
118477
118592
  "@tscircuit/copper-pour-solver": "^0.0.67",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.2139",
4
+ "version": "0.0.2141",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -39,7 +39,7 @@
39
39
  "@tscircuit/bus-lanes-solver": "https://jscdn.tscircuit.com/@tscircuit/bus-lanes-solver/0.0.21.tgz",
40
40
  "@tscircuit/cableprinter": "^0.0.6",
41
41
  "@tscircuit/capacity-autorouter": "^0.0.974",
42
- "@tscircuit/checks": "^0.0.250",
42
+ "@tscircuit/checks": "^0.0.251",
43
43
  "@tscircuit/circuit-json-util": "^0.0.121",
44
44
  "@tscircuit/common": "^0.0.20",
45
45
  "@tscircuit/copper-pour-solver": "^0.0.67",