From 5774724d18ba53daa6db068a7f68eae826f1af41 Mon Sep 17 00:00:00 2001 From: Guille Gonzalez Date: Tue, 30 Dec 2025 14:45:54 +0100 Subject: [PATCH] Rename package and address warnings --- Package.swift | 18 ++---- .../MathBundle/MTFontMathTableV2.swift | 0 .../MathBundle/MTFontV2.swift | 0 .../MathBundle/MathFont.swift | 0 .../MathBundle/MathImage.swift | 0 .../MathRender/MTBezierPath.swift | 0 .../MathRender/MTColor.swift | 0 .../MathRender/MTConfig.swift | 0 .../MathRender/MTFont.swift | 0 .../MathRender/MTFontManager.swift | 0 .../MathRender/MTFontMathTable.swift | 0 .../MathRender/MTLabel.swift | 0 .../MathRender/MTMathAtomFactory.swift | 0 .../MathRender/MTMathImage.swift | 0 .../MathRender/MTMathList.swift | 0 .../MathRender/MTMathListBuilder.swift | 0 .../MathRender/MTMathListDisplay.swift | 0 .../MathRender/MTMathListIndex.swift | 0 .../MathRender/MTMathUILabel.swift | 0 .../MathRender/MTTypesetter.swift | 0 .../MathRender/MTUnicode.swift | 0 .../MathRender/RWLock.swift | 0 .../mathFonts.bundle/Asana-Math.otf | Bin .../mathFonts.bundle/Asana-Math.plist | 0 .../mathFonts.bundle/Euler-Math.otf | Bin .../mathFonts.bundle/Euler-Math.plist | 0 .../mathFonts.bundle/FiraMath-Regular.otf | Bin .../mathFonts.bundle/FiraMath-Regular.plist | 0 .../mathFonts.bundle/GUST-FONT-LICENSE.txt | 0 .../mathFonts.bundle/Garamond-Math.otf | Bin .../mathFonts.bundle/Garamond-Math.plist | 0 .../mathFonts.bundle/KpMath-Light.otf | Bin .../mathFonts.bundle/KpMath-Light.plist | 0 .../mathFonts.bundle/KpMath-Sans.otf | Bin .../mathFonts.bundle/KpMath-Sans.plist | 0 .../mathFonts.bundle/LICENSE | 0 .../mathFonts.bundle/LeteSansMath.otf | Bin .../mathFonts.bundle/LeteSansMath.plist | 0 .../LibertinusMath-Regular.otf | Bin .../LibertinusMath-Regular.plist | 0 .../mathFonts.bundle/NotoSansMath-Regular.otf | Bin .../NotoSansMath-Regular.plist | 0 .../mathFonts.bundle/OFL.txt | 0 .../mathFonts.bundle/latinmodern-math.otf | Bin .../mathFonts.bundle/latinmodern-math.plist | Bin .../mathFonts.bundle/math_table_to_plist.py | 0 .../mathFonts.bundle/texgyretermes-math.otf | Bin .../mathFonts.bundle/texgyretermes-math.plist | Bin .../mathFonts.bundle/xits-math.otf | Bin .../mathFonts.bundle/xits-math.plist | 0 .../ConcurrencyThreadsafeTests.swift | 2 +- .../MTFontMathTableV2Tests.swift | 36 +---------- .../MTFontV2Tests.swift | 2 +- .../MTMathListBuilderTests.swift | 2 +- .../MTMathListTests.swift | 2 +- .../MTMathUILabelLineWrappingTests.swift | 6 +- .../MTTypesetterTests.swift | 59 ++---------------- .../MathFontTests.swift | 2 +- .../MathImageTests.swift | 2 +- 59 files changed, 19 insertions(+), 112 deletions(-) rename Sources/{SwiftMath => SwiftUIMath}/MathBundle/MTFontMathTableV2.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathBundle/MTFontV2.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathBundle/MathFont.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathBundle/MathImage.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/MTBezierPath.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/MTColor.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/MTConfig.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/MTFont.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/MTFontManager.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/MTFontMathTable.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/MTLabel.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/MTMathAtomFactory.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/MTMathImage.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/MTMathList.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/MTMathListBuilder.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/MTMathListDisplay.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/MTMathListIndex.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/MTMathUILabel.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/MTTypesetter.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/MTUnicode.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/MathRender/RWLock.swift (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/Asana-Math.otf (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/Asana-Math.plist (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/Euler-Math.otf (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/Euler-Math.plist (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/FiraMath-Regular.otf (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/FiraMath-Regular.plist (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/GUST-FONT-LICENSE.txt (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/Garamond-Math.otf (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/Garamond-Math.plist (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/KpMath-Light.otf (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/KpMath-Light.plist (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/KpMath-Sans.otf (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/KpMath-Sans.plist (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/LICENSE (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/LeteSansMath.otf (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/LeteSansMath.plist (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/LibertinusMath-Regular.otf (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/LibertinusMath-Regular.plist (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/NotoSansMath-Regular.otf (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/NotoSansMath-Regular.plist (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/OFL.txt (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/latinmodern-math.otf (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/latinmodern-math.plist (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/math_table_to_plist.py (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/texgyretermes-math.otf (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/texgyretermes-math.plist (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/xits-math.otf (100%) rename Sources/{SwiftMath => SwiftUIMath}/mathFonts.bundle/xits-math.plist (100%) rename Tests/{SwiftMathTests => SwiftUIMathTests}/ConcurrencyThreadsafeTests.swift (98%) rename Tests/{SwiftMathTests => SwiftUIMathTests}/MTFontMathTableV2Tests.swift (50%) rename Tests/{SwiftMathTests => SwiftUIMathTests}/MTFontV2Tests.swift (99%) rename Tests/{SwiftMathTests => SwiftUIMathTests}/MTMathListBuilderTests.swift (99%) rename Tests/{SwiftMathTests => SwiftUIMathTests}/MTMathListTests.swift (99%) rename Tests/{SwiftMathTests => SwiftUIMathTests}/MTMathUILabelLineWrappingTests.swift (99%) rename Tests/{SwiftMathTests => SwiftUIMathTests}/MTTypesetterTests.swift (98%) rename Tests/{SwiftMathTests => SwiftUIMathTests}/MathFontTests.swift (99%) rename Tests/{SwiftMathTests => SwiftUIMathTests}/MathImageTests.swift (99%) diff --git a/Package.swift b/Package.swift index bae8301..a861cf2 100755 --- a/Package.swift +++ b/Package.swift @@ -1,33 +1,27 @@ // swift-tools-version: 5.7 -// The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( - name: "SwiftMath", + name: "swiftui-math", defaultLocalization: "en", platforms: [.iOS("11.0"), .macOS("12.0")], products: [ - // Products define the executables and libraries a package produces, and make them visible to other packages. .library( - name: "SwiftMath", - targets: ["SwiftMath"]), + name: "SwiftUIMath", + targets: ["SwiftUIMath"]), ], dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), ], targets: [ - // Targets are the basic building blocks of a package. A target can define a module or a test suite. - // Targets can depend on other targets in this package, and on products in packages this package depends on. .target( - name: "SwiftMath", + name: "SwiftUIMath", dependencies: [], resources: [ .copy("mathFonts.bundle") ]), .testTarget( - name: "SwiftMathTests", - dependencies: ["SwiftMath"]), + name: "SwiftUIMathTests", + dependencies: ["SwiftUIMath"]), ] ) diff --git a/Sources/SwiftMath/MathBundle/MTFontMathTableV2.swift b/Sources/SwiftUIMath/MathBundle/MTFontMathTableV2.swift similarity index 100% rename from Sources/SwiftMath/MathBundle/MTFontMathTableV2.swift rename to Sources/SwiftUIMath/MathBundle/MTFontMathTableV2.swift diff --git a/Sources/SwiftMath/MathBundle/MTFontV2.swift b/Sources/SwiftUIMath/MathBundle/MTFontV2.swift similarity index 100% rename from Sources/SwiftMath/MathBundle/MTFontV2.swift rename to Sources/SwiftUIMath/MathBundle/MTFontV2.swift diff --git a/Sources/SwiftMath/MathBundle/MathFont.swift b/Sources/SwiftUIMath/MathBundle/MathFont.swift similarity index 100% rename from Sources/SwiftMath/MathBundle/MathFont.swift rename to Sources/SwiftUIMath/MathBundle/MathFont.swift diff --git a/Sources/SwiftMath/MathBundle/MathImage.swift b/Sources/SwiftUIMath/MathBundle/MathImage.swift similarity index 100% rename from Sources/SwiftMath/MathBundle/MathImage.swift rename to Sources/SwiftUIMath/MathBundle/MathImage.swift diff --git a/Sources/SwiftMath/MathRender/MTBezierPath.swift b/Sources/SwiftUIMath/MathRender/MTBezierPath.swift similarity index 100% rename from Sources/SwiftMath/MathRender/MTBezierPath.swift rename to Sources/SwiftUIMath/MathRender/MTBezierPath.swift diff --git a/Sources/SwiftMath/MathRender/MTColor.swift b/Sources/SwiftUIMath/MathRender/MTColor.swift similarity index 100% rename from Sources/SwiftMath/MathRender/MTColor.swift rename to Sources/SwiftUIMath/MathRender/MTColor.swift diff --git a/Sources/SwiftMath/MathRender/MTConfig.swift b/Sources/SwiftUIMath/MathRender/MTConfig.swift similarity index 100% rename from Sources/SwiftMath/MathRender/MTConfig.swift rename to Sources/SwiftUIMath/MathRender/MTConfig.swift diff --git a/Sources/SwiftMath/MathRender/MTFont.swift b/Sources/SwiftUIMath/MathRender/MTFont.swift similarity index 100% rename from Sources/SwiftMath/MathRender/MTFont.swift rename to Sources/SwiftUIMath/MathRender/MTFont.swift diff --git a/Sources/SwiftMath/MathRender/MTFontManager.swift b/Sources/SwiftUIMath/MathRender/MTFontManager.swift similarity index 100% rename from Sources/SwiftMath/MathRender/MTFontManager.swift rename to Sources/SwiftUIMath/MathRender/MTFontManager.swift diff --git a/Sources/SwiftMath/MathRender/MTFontMathTable.swift b/Sources/SwiftUIMath/MathRender/MTFontMathTable.swift similarity index 100% rename from Sources/SwiftMath/MathRender/MTFontMathTable.swift rename to Sources/SwiftUIMath/MathRender/MTFontMathTable.swift diff --git a/Sources/SwiftMath/MathRender/MTLabel.swift b/Sources/SwiftUIMath/MathRender/MTLabel.swift similarity index 100% rename from Sources/SwiftMath/MathRender/MTLabel.swift rename to Sources/SwiftUIMath/MathRender/MTLabel.swift diff --git a/Sources/SwiftMath/MathRender/MTMathAtomFactory.swift b/Sources/SwiftUIMath/MathRender/MTMathAtomFactory.swift similarity index 100% rename from Sources/SwiftMath/MathRender/MTMathAtomFactory.swift rename to Sources/SwiftUIMath/MathRender/MTMathAtomFactory.swift diff --git a/Sources/SwiftMath/MathRender/MTMathImage.swift b/Sources/SwiftUIMath/MathRender/MTMathImage.swift similarity index 100% rename from Sources/SwiftMath/MathRender/MTMathImage.swift rename to Sources/SwiftUIMath/MathRender/MTMathImage.swift diff --git a/Sources/SwiftMath/MathRender/MTMathList.swift b/Sources/SwiftUIMath/MathRender/MTMathList.swift similarity index 100% rename from Sources/SwiftMath/MathRender/MTMathList.swift rename to Sources/SwiftUIMath/MathRender/MTMathList.swift diff --git a/Sources/SwiftMath/MathRender/MTMathListBuilder.swift b/Sources/SwiftUIMath/MathRender/MTMathListBuilder.swift similarity index 100% rename from Sources/SwiftMath/MathRender/MTMathListBuilder.swift rename to Sources/SwiftUIMath/MathRender/MTMathListBuilder.swift diff --git a/Sources/SwiftMath/MathRender/MTMathListDisplay.swift b/Sources/SwiftUIMath/MathRender/MTMathListDisplay.swift similarity index 100% rename from Sources/SwiftMath/MathRender/MTMathListDisplay.swift rename to Sources/SwiftUIMath/MathRender/MTMathListDisplay.swift diff --git a/Sources/SwiftMath/MathRender/MTMathListIndex.swift b/Sources/SwiftUIMath/MathRender/MTMathListIndex.swift similarity index 100% rename from Sources/SwiftMath/MathRender/MTMathListIndex.swift rename to Sources/SwiftUIMath/MathRender/MTMathListIndex.swift diff --git a/Sources/SwiftMath/MathRender/MTMathUILabel.swift b/Sources/SwiftUIMath/MathRender/MTMathUILabel.swift similarity index 100% rename from Sources/SwiftMath/MathRender/MTMathUILabel.swift rename to Sources/SwiftUIMath/MathRender/MTMathUILabel.swift diff --git a/Sources/SwiftMath/MathRender/MTTypesetter.swift b/Sources/SwiftUIMath/MathRender/MTTypesetter.swift similarity index 100% rename from Sources/SwiftMath/MathRender/MTTypesetter.swift rename to Sources/SwiftUIMath/MathRender/MTTypesetter.swift diff --git a/Sources/SwiftMath/MathRender/MTUnicode.swift b/Sources/SwiftUIMath/MathRender/MTUnicode.swift similarity index 100% rename from Sources/SwiftMath/MathRender/MTUnicode.swift rename to Sources/SwiftUIMath/MathRender/MTUnicode.swift diff --git a/Sources/SwiftMath/MathRender/RWLock.swift b/Sources/SwiftUIMath/MathRender/RWLock.swift similarity index 100% rename from Sources/SwiftMath/MathRender/RWLock.swift rename to Sources/SwiftUIMath/MathRender/RWLock.swift diff --git a/Sources/SwiftMath/mathFonts.bundle/Asana-Math.otf b/Sources/SwiftUIMath/mathFonts.bundle/Asana-Math.otf similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/Asana-Math.otf rename to Sources/SwiftUIMath/mathFonts.bundle/Asana-Math.otf diff --git a/Sources/SwiftMath/mathFonts.bundle/Asana-Math.plist b/Sources/SwiftUIMath/mathFonts.bundle/Asana-Math.plist similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/Asana-Math.plist rename to Sources/SwiftUIMath/mathFonts.bundle/Asana-Math.plist diff --git a/Sources/SwiftMath/mathFonts.bundle/Euler-Math.otf b/Sources/SwiftUIMath/mathFonts.bundle/Euler-Math.otf similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/Euler-Math.otf rename to Sources/SwiftUIMath/mathFonts.bundle/Euler-Math.otf diff --git a/Sources/SwiftMath/mathFonts.bundle/Euler-Math.plist b/Sources/SwiftUIMath/mathFonts.bundle/Euler-Math.plist similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/Euler-Math.plist rename to Sources/SwiftUIMath/mathFonts.bundle/Euler-Math.plist diff --git a/Sources/SwiftMath/mathFonts.bundle/FiraMath-Regular.otf b/Sources/SwiftUIMath/mathFonts.bundle/FiraMath-Regular.otf similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/FiraMath-Regular.otf rename to Sources/SwiftUIMath/mathFonts.bundle/FiraMath-Regular.otf diff --git a/Sources/SwiftMath/mathFonts.bundle/FiraMath-Regular.plist b/Sources/SwiftUIMath/mathFonts.bundle/FiraMath-Regular.plist similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/FiraMath-Regular.plist rename to Sources/SwiftUIMath/mathFonts.bundle/FiraMath-Regular.plist diff --git a/Sources/SwiftMath/mathFonts.bundle/GUST-FONT-LICENSE.txt b/Sources/SwiftUIMath/mathFonts.bundle/GUST-FONT-LICENSE.txt similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/GUST-FONT-LICENSE.txt rename to Sources/SwiftUIMath/mathFonts.bundle/GUST-FONT-LICENSE.txt diff --git a/Sources/SwiftMath/mathFonts.bundle/Garamond-Math.otf b/Sources/SwiftUIMath/mathFonts.bundle/Garamond-Math.otf similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/Garamond-Math.otf rename to Sources/SwiftUIMath/mathFonts.bundle/Garamond-Math.otf diff --git a/Sources/SwiftMath/mathFonts.bundle/Garamond-Math.plist b/Sources/SwiftUIMath/mathFonts.bundle/Garamond-Math.plist similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/Garamond-Math.plist rename to Sources/SwiftUIMath/mathFonts.bundle/Garamond-Math.plist diff --git a/Sources/SwiftMath/mathFonts.bundle/KpMath-Light.otf b/Sources/SwiftUIMath/mathFonts.bundle/KpMath-Light.otf similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/KpMath-Light.otf rename to Sources/SwiftUIMath/mathFonts.bundle/KpMath-Light.otf diff --git a/Sources/SwiftMath/mathFonts.bundle/KpMath-Light.plist b/Sources/SwiftUIMath/mathFonts.bundle/KpMath-Light.plist similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/KpMath-Light.plist rename to Sources/SwiftUIMath/mathFonts.bundle/KpMath-Light.plist diff --git a/Sources/SwiftMath/mathFonts.bundle/KpMath-Sans.otf b/Sources/SwiftUIMath/mathFonts.bundle/KpMath-Sans.otf similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/KpMath-Sans.otf rename to Sources/SwiftUIMath/mathFonts.bundle/KpMath-Sans.otf diff --git a/Sources/SwiftMath/mathFonts.bundle/KpMath-Sans.plist b/Sources/SwiftUIMath/mathFonts.bundle/KpMath-Sans.plist similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/KpMath-Sans.plist rename to Sources/SwiftUIMath/mathFonts.bundle/KpMath-Sans.plist diff --git a/Sources/SwiftMath/mathFonts.bundle/LICENSE b/Sources/SwiftUIMath/mathFonts.bundle/LICENSE similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/LICENSE rename to Sources/SwiftUIMath/mathFonts.bundle/LICENSE diff --git a/Sources/SwiftMath/mathFonts.bundle/LeteSansMath.otf b/Sources/SwiftUIMath/mathFonts.bundle/LeteSansMath.otf similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/LeteSansMath.otf rename to Sources/SwiftUIMath/mathFonts.bundle/LeteSansMath.otf diff --git a/Sources/SwiftMath/mathFonts.bundle/LeteSansMath.plist b/Sources/SwiftUIMath/mathFonts.bundle/LeteSansMath.plist similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/LeteSansMath.plist rename to Sources/SwiftUIMath/mathFonts.bundle/LeteSansMath.plist diff --git a/Sources/SwiftMath/mathFonts.bundle/LibertinusMath-Regular.otf b/Sources/SwiftUIMath/mathFonts.bundle/LibertinusMath-Regular.otf similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/LibertinusMath-Regular.otf rename to Sources/SwiftUIMath/mathFonts.bundle/LibertinusMath-Regular.otf diff --git a/Sources/SwiftMath/mathFonts.bundle/LibertinusMath-Regular.plist b/Sources/SwiftUIMath/mathFonts.bundle/LibertinusMath-Regular.plist similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/LibertinusMath-Regular.plist rename to Sources/SwiftUIMath/mathFonts.bundle/LibertinusMath-Regular.plist diff --git a/Sources/SwiftMath/mathFonts.bundle/NotoSansMath-Regular.otf b/Sources/SwiftUIMath/mathFonts.bundle/NotoSansMath-Regular.otf similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/NotoSansMath-Regular.otf rename to Sources/SwiftUIMath/mathFonts.bundle/NotoSansMath-Regular.otf diff --git a/Sources/SwiftMath/mathFonts.bundle/NotoSansMath-Regular.plist b/Sources/SwiftUIMath/mathFonts.bundle/NotoSansMath-Regular.plist similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/NotoSansMath-Regular.plist rename to Sources/SwiftUIMath/mathFonts.bundle/NotoSansMath-Regular.plist diff --git a/Sources/SwiftMath/mathFonts.bundle/OFL.txt b/Sources/SwiftUIMath/mathFonts.bundle/OFL.txt similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/OFL.txt rename to Sources/SwiftUIMath/mathFonts.bundle/OFL.txt diff --git a/Sources/SwiftMath/mathFonts.bundle/latinmodern-math.otf b/Sources/SwiftUIMath/mathFonts.bundle/latinmodern-math.otf similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/latinmodern-math.otf rename to Sources/SwiftUIMath/mathFonts.bundle/latinmodern-math.otf diff --git a/Sources/SwiftMath/mathFonts.bundle/latinmodern-math.plist b/Sources/SwiftUIMath/mathFonts.bundle/latinmodern-math.plist similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/latinmodern-math.plist rename to Sources/SwiftUIMath/mathFonts.bundle/latinmodern-math.plist diff --git a/Sources/SwiftMath/mathFonts.bundle/math_table_to_plist.py b/Sources/SwiftUIMath/mathFonts.bundle/math_table_to_plist.py similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/math_table_to_plist.py rename to Sources/SwiftUIMath/mathFonts.bundle/math_table_to_plist.py diff --git a/Sources/SwiftMath/mathFonts.bundle/texgyretermes-math.otf b/Sources/SwiftUIMath/mathFonts.bundle/texgyretermes-math.otf similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/texgyretermes-math.otf rename to Sources/SwiftUIMath/mathFonts.bundle/texgyretermes-math.otf diff --git a/Sources/SwiftMath/mathFonts.bundle/texgyretermes-math.plist b/Sources/SwiftUIMath/mathFonts.bundle/texgyretermes-math.plist similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/texgyretermes-math.plist rename to Sources/SwiftUIMath/mathFonts.bundle/texgyretermes-math.plist diff --git a/Sources/SwiftMath/mathFonts.bundle/xits-math.otf b/Sources/SwiftUIMath/mathFonts.bundle/xits-math.otf similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/xits-math.otf rename to Sources/SwiftUIMath/mathFonts.bundle/xits-math.otf diff --git a/Sources/SwiftMath/mathFonts.bundle/xits-math.plist b/Sources/SwiftUIMath/mathFonts.bundle/xits-math.plist similarity index 100% rename from Sources/SwiftMath/mathFonts.bundle/xits-math.plist rename to Sources/SwiftUIMath/mathFonts.bundle/xits-math.plist diff --git a/Tests/SwiftMathTests/ConcurrencyThreadsafeTests.swift b/Tests/SwiftUIMathTests/ConcurrencyThreadsafeTests.swift similarity index 98% rename from Tests/SwiftMathTests/ConcurrencyThreadsafeTests.swift rename to Tests/SwiftUIMathTests/ConcurrencyThreadsafeTests.swift index 220c19e..ae906b1 100755 --- a/Tests/SwiftMathTests/ConcurrencyThreadsafeTests.swift +++ b/Tests/SwiftUIMathTests/ConcurrencyThreadsafeTests.swift @@ -6,7 +6,7 @@ // import XCTest -@testable import SwiftMath +@testable import SwiftUIMath final class ConcurrencyThreadsafeTests: XCTestCase { diff --git a/Tests/SwiftMathTests/MTFontMathTableV2Tests.swift b/Tests/SwiftUIMathTests/MTFontMathTableV2Tests.swift similarity index 50% rename from Tests/SwiftMathTests/MTFontMathTableV2Tests.swift rename to Tests/SwiftUIMathTests/MTFontMathTableV2Tests.swift index 8cf49f8..efa4b5f 100755 --- a/Tests/SwiftMathTests/MTFontMathTableV2Tests.swift +++ b/Tests/SwiftUIMathTests/MTFontMathTableV2Tests.swift @@ -6,7 +6,7 @@ // import XCTest -@testable import SwiftMath +@testable import SwiftUIMath final class MTFontMathTableV2Tests: XCTestCase { func testMTFontV2Script() throws { @@ -14,14 +14,6 @@ final class MTFontMathTableV2Tests: XCTestCase { MathFont.allCases.forEach { let mTable = $0.mtfont(size: size).mathTable XCTAssertNotNil(mTable) - let values = [ - mTable?.fractionNumeratorDisplayStyleShiftUp, - mTable?.fractionNumeratorShiftUp, - mTable?.fractionDenominatorDisplayStyleShiftDown, - mTable?.fractionDenominatorShiftDown, - mTable?.fractionNumeratorDisplayStyleGapMin, - mTable?.fractionNumeratorGapMin, - ].compactMap{$0} } } private let executionQueue = DispatchQueue(label: "com.swiftmath.mathbundle", attributes: .concurrent) @@ -45,35 +37,9 @@ final class MTFontMathTableV2Tests: XCTestCase { func helperConcurrentMTFontMathTableV2(_ count: Int, mtfont: MTFontV2, in group: DispatchGroup, on queue: DispatchQueue) { let workitem = DispatchWorkItem { let mTable = mtfont.mathTable - let values = [ - mTable?.fractionNumeratorDisplayStyleShiftUp, - mTable?.fractionNumeratorShiftUp, - mTable?.fractionDenominatorDisplayStyleShiftDown, - mTable?.fractionDenominatorShiftDown, - mTable?.fractionNumeratorDisplayStyleGapMin, - mTable?.fractionNumeratorGapMin, - ].compactMap{$0} - // if count % 50 == 0 { - // print(values) // accessed these values on global thread. - // } XCTAssertNotNil(mTable) } workitem.notify(queue: .main) { [weak self] in - // print("\(Thread.isMainThread ? "main" : "global") completed .....") - let mTable = mtfont.mathTable - if count % 70 == 0 { - let values = [ - mTable?.fractionNumeratorDisplayStyleShiftUp, - mTable?.fractionNumeratorShiftUp, - mTable?.fractionDenominatorDisplayStyleShiftDown, - mTable?.fractionDenominatorShiftDown, - mTable?.fractionNumeratorDisplayStyleGapMin, - mTable?.fractionNumeratorGapMin, - ].compactMap{$0} - // if count % 50 == 0 { - // print(values) - // } - } self?.testCount += 1 } queue.async(group: group, execute: workitem) diff --git a/Tests/SwiftMathTests/MTFontV2Tests.swift b/Tests/SwiftUIMathTests/MTFontV2Tests.swift similarity index 99% rename from Tests/SwiftMathTests/MTFontV2Tests.swift rename to Tests/SwiftUIMathTests/MTFontV2Tests.swift index f98f58c..f6d1614 100755 --- a/Tests/SwiftMathTests/MTFontV2Tests.swift +++ b/Tests/SwiftUIMathTests/MTFontV2Tests.swift @@ -6,7 +6,7 @@ // import XCTest -@testable import SwiftMath +@testable import SwiftUIMath final class MTFontV2Tests: XCTestCase { func testMTFontV2Script() throws { diff --git a/Tests/SwiftMathTests/MTMathListBuilderTests.swift b/Tests/SwiftUIMathTests/MTMathListBuilderTests.swift similarity index 99% rename from Tests/SwiftMathTests/MTMathListBuilderTests.swift rename to Tests/SwiftUIMathTests/MTMathListBuilderTests.swift index 576436f..b487ea7 100644 --- a/Tests/SwiftMathTests/MTMathListBuilderTests.swift +++ b/Tests/SwiftUIMathTests/MTMathListBuilderTests.swift @@ -1,5 +1,5 @@ import XCTest -@testable import SwiftMath +@testable import SwiftUIMath // // MathRenderSwiftTests.swift diff --git a/Tests/SwiftMathTests/MTMathListTests.swift b/Tests/SwiftUIMathTests/MTMathListTests.swift similarity index 99% rename from Tests/SwiftMathTests/MTMathListTests.swift rename to Tests/SwiftUIMathTests/MTMathListTests.swift index be69252..dfa2e9f 100755 --- a/Tests/SwiftMathTests/MTMathListTests.swift +++ b/Tests/SwiftUIMathTests/MTMathListTests.swift @@ -1,5 +1,5 @@ import XCTest -@testable import SwiftMath +@testable import SwiftUIMath // // MathRenderSwiftTests.swift diff --git a/Tests/SwiftMathTests/MTMathUILabelLineWrappingTests.swift b/Tests/SwiftUIMathTests/MTMathUILabelLineWrappingTests.swift similarity index 99% rename from Tests/SwiftMathTests/MTMathUILabelLineWrappingTests.swift rename to Tests/SwiftUIMathTests/MTMathUILabelLineWrappingTests.swift index 33186c6..8a49bf8 100644 --- a/Tests/SwiftMathTests/MTMathUILabelLineWrappingTests.swift +++ b/Tests/SwiftUIMathTests/MTMathUILabelLineWrappingTests.swift @@ -6,7 +6,7 @@ // import XCTest -@testable import SwiftMath +@testable import SwiftUIMath class MTMathUILabelLineWrappingTests: XCTestCase { @@ -388,8 +388,6 @@ class MTMathUILabelLineWrappingTests: XCTestCase { label.font = MTFontManager.fontManager.defaultFont label.labelMode = .text - let unconstrainedSize = label.intrinsicContentSize - label.preferredMaxLayoutWidth = 200 let constrainedSize = label.intrinsicContentSize @@ -415,8 +413,6 @@ class MTMathUILabelLineWrappingTests: XCTestCase { label.font = MTFontManager.fontManager.defaultFont label.labelMode = .text - let unconstrainedSize = label.intrinsicContentSize - label.preferredMaxLayoutWidth = 250 let constrainedSize = label.intrinsicContentSize diff --git a/Tests/SwiftMathTests/MTTypesetterTests.swift b/Tests/SwiftUIMathTests/MTTypesetterTests.swift similarity index 98% rename from Tests/SwiftMathTests/MTTypesetterTests.swift rename to Tests/SwiftUIMathTests/MTTypesetterTests.swift index 5052b70..daa015e 100755 --- a/Tests/SwiftMathTests/MTTypesetterTests.swift +++ b/Tests/SwiftUIMathTests/MTTypesetterTests.swift @@ -1,5 +1,5 @@ import XCTest -@testable import SwiftMath +@testable import SwiftUIMath // // MathTypesetterTests.swift @@ -2306,10 +2306,6 @@ final class MTTypesetterTests: XCTestCase { let display = MTTypesetter.createLineForMathList(mathList, font: self.font, style: .text, maxWidth: maxWidth) XCTAssertNotNil(display) - // In text style, large operator should be inline-sized and stay with surrounding content - // Should be 1 line if it fits - let lineCount = display!.subDisplays.count - // Verify width constraints are respected for (index, subDisplay) in display!.subDisplays.enumerated() { XCTAssertLessThanOrEqual(subDisplay.width, maxWidth * 1.2, @@ -2348,9 +2344,6 @@ final class MTTypesetterTests: XCTestCase { let display = MTTypesetter.createLineForMathList(mathList, font: self.font, style: .text, maxWidth: maxWidth) XCTAssertNotNil(display) - // In text style with wide constraint, might fit on 1-2 lines - let lineCount = display!.subDisplays.count - XCTAssertGreaterThan(display!.subDisplays.count, 0, "Operators render") // Verify width constraints @@ -2372,9 +2365,6 @@ final class MTTypesetterTests: XCTestCase { let display = MTTypesetter.createLineForMathList(mathList, font: self.font, style: .display, maxWidth: maxWidth) XCTAssertNotNil(display) - // Should stay on 1 line when it fits - let lineCount = display!.subDisplays.count - // Verify width constraints are respected for (index, subDisplay) in display!.subDisplays.enumerated() { XCTAssertLessThanOrEqual(subDisplay.width, maxWidth * 1.2, @@ -2433,9 +2423,6 @@ final class MTTypesetterTests: XCTestCase { let display = MTTypesetter.createLineForMathList(mathList, font: self.font, style: .display, maxWidth: maxWidth) XCTAssertNotNil(display) - // Should intelligently break between delimiters if needed - let lineCount = display!.subDisplays.count - // Verify width constraints for (index, subDisplay) in display!.subDisplays.enumerated() { XCTAssertLessThanOrEqual(subDisplay.width, maxWidth * 1.2, @@ -2455,9 +2442,6 @@ final class MTTypesetterTests: XCTestCase { let display = MTTypesetter.createLineForMathList(mathList, font: self.font, style: .display, maxWidth: maxWidth) XCTAssertNotNil(display) - // Should stay on 1 line when it fits - let lineCount = display!.subDisplays.count - // Verify width constraints are respected for (index, subDisplay) in display!.subDisplays.enumerated() { XCTAssertLessThanOrEqual(subDisplay.width, maxWidth * 1.2, @@ -2498,9 +2482,6 @@ final class MTTypesetterTests: XCTestCase { let display = MTTypesetter.createLineForMathList(mathList, font: self.font, style: .display, maxWidth: maxWidth) XCTAssertNotNil(display) - // Should intelligently break between colored sections if needed - let lineCount = display!.subDisplays.count - // Verify width constraints for (index, subDisplay) in display!.subDisplays.enumerated() { XCTAssertLessThanOrEqual(subDisplay.width, maxWidth * 1.2, @@ -2520,9 +2501,6 @@ final class MTTypesetterTests: XCTestCase { let display = MTTypesetter.createLineForMathList(mathList, font: self.font, style: .display, maxWidth: maxWidth) XCTAssertNotNil(display) - // Small 1x2 matrix should stay inline - let lineCount = display!.subDisplays.count - // Verify width constraints are respected for (index, subDisplay) in display!.subDisplays.enumerated() { XCTAssertLessThanOrEqual(subDisplay.width, maxWidth * 1.2, @@ -2540,9 +2518,6 @@ final class MTTypesetterTests: XCTestCase { let display = MTTypesetter.createLineForMathList(mathList, font: self.font, style: .display, maxWidth: maxWidth) XCTAssertNotNil(display) - // Should break with narrow width - let lineCount = display!.subDisplays.count - // Verify width constraints (matrices can be slightly wider) for (index, subDisplay) in display!.subDisplays.enumerated() { XCTAssertLessThanOrEqual(subDisplay.width, maxWidth * 1.5, @@ -2632,12 +2607,6 @@ final class MTTypesetterTests: XCTestCase { // Get the subdisplays to check ordering let subDisplays = display!.subDisplays - // Print positions and types for debugging - for (index, subDisplay) in subDisplays.enumerated() { - if let lineDisplay = subDisplay as? MTCTLineDisplay { - } - } - // The expected order should be: sum (with limits), i, =, fraction // We need to verify that the x positions are monotonically increasing var previousX: CGFloat = -1 @@ -2694,17 +2663,8 @@ final class MTTypesetterTests: XCTestCase { // Get the subdisplays to check ordering let subDisplays = display!.subDisplays - // Print positions and types for debugging - for (index, subDisplay) in subDisplays.enumerated() { - if let lineDisplay = subDisplay as? MTCTLineDisplay { - } - } - // Track what we find and their y positions var sumX: CGFloat? - var sumY: CGFloat? - var iX: CGFloat? - var iY: CGFloat? var equalsX: CGFloat? var equalsY: CGFloat? var fractionX: CGFloat? @@ -2714,12 +2674,10 @@ final class MTTypesetterTests: XCTestCase { if subDisplay is MTLargeOpLimitsDisplay { // Display mode: sum with limits as single display sumX = subDisplay.position.x - sumY = subDisplay.position.y } else if subDisplay is MTGlyphDisplay { // Text mode: sum symbol as glyph display (check if it's the sum symbol) if sumX == nil { sumX = subDisplay.position.x - sumY = subDisplay.position.y } } else if let lineDisplay = subDisplay as? MTCTLineDisplay, let text = lineDisplay.attributedString?.string { @@ -2728,15 +2686,8 @@ final class MTTypesetterTests: XCTestCase { equalsX = subDisplay.position.x equalsY = subDisplay.position.y } else if text.contains("i") && text.contains("=") { - // i and = together (ideal case) - iX = subDisplay.position.x - iY = subDisplay.position.y equalsX = subDisplay.position.x // They're together equalsY = subDisplay.position.y - } else if text.contains("i") { - // Just i - iX = subDisplay.position.x - iY = subDisplay.position.y } } else if subDisplay is MTFractionDisplay { fractionX = subDisplay.position.x @@ -2781,7 +2732,7 @@ final class MTTypesetterTests: XCTestCase { // Check for line breaks (large y position gaps indicate line breaks) // Note: Superscripts/subscripts have different y positions but are on same "line" // Line breaks use fontSize * 1.5 spacing, so look for gaps > fontSize - var yPositions = display!.subDisplays.map { $0.position.y }.sorted() + let yPositions = display!.subDisplays.map { $0.position.y }.sorted() var lineBreakCount = 0 for i in 1..