-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from dkyowell/development
v0.2.5.2
- Loading branch information
Showing
66 changed files
with
920 additions
and
2,051 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* PDF Blocks | ||
* Copyright (c) David Yowell 2024 | ||
* MIT license, see LICENSE file for details | ||
*/ | ||
|
||
import Foundation | ||
import PDFBlocks | ||
import PDFKit | ||
|
||
private struct Document: Block { | ||
let text: AttributedString = { | ||
var result: AttributedString = "One fish.\nTwo fish.\nRed fish.\nBlue fish." | ||
if let range = result.range(of: "Blue") { | ||
result[range].foregroundColor = .systemBlue | ||
} | ||
if let range = result.range(of: "Red") { | ||
result[range].foregroundColor = .systemRed | ||
} | ||
return result | ||
}() | ||
|
||
var body: some Block { | ||
Text(text) | ||
.fontSize(64) | ||
.fontDesign(.serif) | ||
.fontWeight(.semibold) | ||
} | ||
} | ||
|
||
#Preview { | ||
previewForDocument(Document()) | ||
} |
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
Oops, something went wrong.