Repository navigation
GraphiteQuickDraw and GraphiteText: cursor state, palettes, file icons, font tables; ContiguousBytes input; swift-freetype - #23
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fills in the QuickDraw, pictures, icons, fonts and cursors survey, and moves byte input to
ContiguousBytes.GraphiteQuickDraw
InitCursor,SetCursor,HideCursorandShowCursor(nesting), and named pixel-map cursors; kept onQuickDraw.cursor.Paletteand its entries, usage and tolerance,CopyPalette; andIndex2Color,SetEntries,RestoreDeviceClutandCTabChangedon devices and color tables.IconFamily(ofItemAt:): the icon an item has of its own: an.icnsfile, a custom icon (ID -16455) in its resource fork, a bundle'sCFBundleIconFile, or a folder'sIcon\r.GraphiteQuickDrawnow depends onGraphiteFilesandGraphiteResources.GraphiteResources
InfoPlist: top-level strings of an Info.plist, XML or binary, through Foundation's property list reader.Fork.contents()returnsData, mapped into memory when a data fork is opened read-only.ResourceFileholds its bytes asData, so a mapped resource file is parsed in place and resources are copied out as asked for.GraphiteText
FontFacegainstable(_:)andhorizontalMetrics(ATS'sATSFontGetTableandATSFontGetHorizontalMetrics).SfntTablesreads an sfnt's directory (collections included) and the fields ofhead,hhea,OS/2andpost, in place.FreeTypeFaceis built on swift-freetype (masterbranch); theCFreeTypetarget is removed. Tables, styles and the extra metrics are read from the font's bytes, since the wrapper doesn't expose them.Byte input
some ContiguousBytes(arrays,Data, slices, raw buffers):IconFamily,ColorTable,ResourceMap,ResourceFile,StringList,VersionResource,AppleDouble,Picture,PackBits,Region,Polygon,Cursor,ColorIcon,FreeTypeFace. Existing[UInt8]callers are source-compatible.BigEndianReaderstoresDataand reads it where it is;readBytesnow returns aDataslice.Notes for review
996bcc1(BigEndianReaderonData; fixed by3c5eac5) and06368d7(the package change; fixed by2dcd004).swift-freetypeis a branch dependency (branch: "master"), so a package that depends on Graphite by version can't use it until that is pinned or tagged.Fork.contents()documents this.Info.plistreading now uses Foundation, so binary plists work and malformed ones throwparamErr.Testing
FreeTypetrait are left to CI.