-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use font representable to support multi platform (#17)
* Update font with representable
- Loading branch information
1 parent
7d742ef
commit d0b4dea
Showing
9 changed files
with
88 additions
and
58 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: build_package | ||
|
||
run-name: build | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
name: Swift ${{ matrix.swift }} on ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: swift-actions/setup-swift@65540b95f51493d65f5e59e97dcef9629ddf11bf | ||
- uses: actions/checkout@v4 | ||
- name: Build | ||
run: swift build | ||
- name: Run tests | ||
run: swift test |
This file contains 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
34 changes: 34 additions & 0 deletions
34
Sources/RichEditorSwiftUI/Fonts/FontMetricsRepresentable.swift
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Divyesh Vekariya on 17/01/24. | ||
// | ||
|
||
import Foundation | ||
|
||
#if canImport(AppKit) && !targetEnvironment(macCatalyst) | ||
import AppKit | ||
|
||
/** | ||
This typealias bridges platform-specific font matrics to | ||
simplify multi-platform support. | ||
The typealias also defines additional functionality as type | ||
extensions for the platform-specific types. | ||
*/ | ||
public typealias FontMetricsRepresentable = NSFont.NSFontMetrics | ||
#endif | ||
|
||
#if canImport(UIKit) | ||
import UIKit | ||
|
||
/** | ||
This typealias bridges platform-specific font matrics to | ||
simplify multi-platform support. | ||
The typealias also defines additional functionality as type | ||
extensions for the platform-specific types. | ||
*/ | ||
public typealias FontMetricsRepresentable = UIFontMetrics | ||
#endif |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
20 changes: 0 additions & 20 deletions
20
Sources/RichEditorSwiftUI/UI/Extensions/UIFontDescriptor+Extension.swift
This file was deleted.
Oops, something went wrong.
This file contains 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