usecanvas / canvastext Goto Github PK
View Code? Open in Web Editor NEWCanvas text system for iOS & OS X
Home Page: https://usecanvas.com
Canvas text system for iOS & OS X
Home Page: https://usecanvas.com
I am trying to build the example app. In the final version of the code, it appears to need an object implementing the Theme protocol but the example app appears to not have been updated to include an example implementation.
Any chance you might be able to provide a basic implementation? I fear that I will make a mistake in that and it will drag down exploring the use of CanvasText.
Thanks in advance,
Charlie
I am trying to update this to build on Swift 3.1.
In the LayoutManager, I see the following code:
var unfoldedRange: NSRange? {
didSet {
let wasFolding = oldValue.flatMap { foldedIndices.subtract($0.indices) } ?? foldedIndices
let nowFolding = unfoldedRange.flatMap { foldedIndices.subtract($0.indices) } ?? foldedIndices
let updated = nowFolding.exclusiveOr(wasFolding)
if updated.isEmpty {
return
}
NSRange.ranges(indices: updated).forEach { range in
invalidateGlyphsForCharacterRange(range, changeInLength: 0, actualCharacterRange: nil)
}
needsUpdateTextContainer = true
}
}
But NSRange does not seem to support flatMap, so this is no longer compiling. I am having a difficult time trying to understand the logic here. Any suggestions on how to 'modernize' this code is appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.