-
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.
* Apply NSScrollView, NSClipView * Apply UIScrollView * Add supplemental config on NSHwpView * Remove Trailing Whitespace
- Loading branch information
Showing
10 changed files
with
123 additions
and
214 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#if os(iOS) | ||
import UIKit | ||
#elseif os(macOS) | ||
import AppKit | ||
#endif | ||
import CoreHwp | ||
|
||
struct TextViewManager { | ||
let textStorage: NSTextStorage | ||
let layoutManager: NSLayoutManager | ||
let textContainer: NSTextContainer | ||
|
||
init(from hwp: HwpFile) { | ||
textStorage = NSTextStorage(attributedString: makeStringForStorage(from: hwp)) | ||
layoutManager = NSLayoutManager() | ||
textStorage.addLayoutManager(layoutManager) | ||
|
||
let containerSize = CGSize(width: 1000, height: 2000) | ||
textContainer = NSTextContainer(size: containerSize) | ||
textContainer.widthTracksTextView = false | ||
layoutManager.addTextContainer(textContainer) | ||
textStorage.addLayoutManager(layoutManager) | ||
} | ||
} |
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,9 @@ | ||
import Foundation | ||
|
||
extension Dictionary where Key == NSAttributedString.Key, Value == Any { | ||
mutating func append(anotherDict: [NSAttributedString.Key: Any]) { | ||
for (key, value) in anotherDict { | ||
self.updateValue(value, forKey: key) | ||
} | ||
} | ||
} |
Oops, something went wrong.