diff --git a/Sample Project/iPad Pro 10_5.frame b/Sample Project/iPad Pro 10_5.frame index 6509f69..635c794 100644 --- a/Sample Project/iPad Pro 10_5.frame +++ b/Sample Project/iPad Pro 10_5.frame @@ -34,7 +34,7 @@ { "color" : null, "file" : "$language\/screenshots.strings", - "font" : "Paul Grotesk Soft Medium", + "font" : "", "fontSize" : 90, "frame" : "{{0, 1490}, {2224, 130}}", "isRoot" : false, diff --git a/Sample Project/iPad Pro 12_9.frame b/Sample Project/iPad Pro 12_9.frame index 8ee3937..748a5f0 100644 --- a/Sample Project/iPad Pro 12_9.frame +++ b/Sample Project/iPad Pro 12_9.frame @@ -34,7 +34,7 @@ { "color" : null, "file" : "$language\/screenshots.strings", - "font" : "Paul Grotesk Soft Medium", + "font" : "", "fontSize" : 90, "frame" : "{{0, 1830}, {2732, 150}}", "isRoot" : false, diff --git a/Sample Project/iPhone 8 Plus.frame b/Sample Project/iPhone 8 Plus.frame index 9f1c14e..063cd47 100644 --- a/Sample Project/iPhone 8 Plus.frame +++ b/Sample Project/iPhone 8 Plus.frame @@ -34,7 +34,7 @@ { "color" : null, "file" : "$language\/screenshots.strings", - "font" : "Paul Grotesk Soft Medium", + "font" : "", "fontSize" : 80, "frame" : "{{0, 1980}, {1242, 140}}", "isRoot" : false, diff --git a/Sample Project/iPhone 8.frame b/Sample Project/iPhone 8.frame index f7860f6..514bb1c 100644 --- a/Sample Project/iPhone 8.frame +++ b/Sample Project/iPhone 8.frame @@ -34,7 +34,7 @@ { "color" : null, "file" : "$language\/screenshots.strings", - "font" : "Paul Grotesk Soft Medium", + "font" : "", "fontSize" : 45, "frame" : "{{0, 1225}, {750, 70}}", "isRoot" : false, diff --git a/Sample Project/iPhone SE.frame b/Sample Project/iPhone SE.frame index 1d780d1..89ecbe4 100644 --- a/Sample Project/iPhone SE.frame +++ b/Sample Project/iPhone SE.frame @@ -34,7 +34,7 @@ { "color" : "#FFFFFFFF", "file" : "$language\/screenshots.strings", - "font" : "Paul Grotesk Soft Medium", + "font" : "", "fontSize" : 45, "frame" : "{{0, 1035}, {640, 70}}", "isRoot" : false, diff --git a/Screenshot Framer.xcodeproj/project.pbxproj b/Screenshot Framer.xcodeproj/project.pbxproj index ed7e6ae..4c19ed0 100644 --- a/Screenshot Framer.xcodeproj/project.pbxproj +++ b/Screenshot Framer.xcodeproj/project.pbxproj @@ -34,6 +34,7 @@ CDB6590F1FE3DAF800430F20 /* NSColor+Hex.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB6590E1FE3DAF800430F20 /* NSColor+Hex.swift */; }; CDB659111FE3F00000430F20 /* MNCoalescing.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB659101FE3F00000430F20 /* MNCoalescing.swift */; }; CDB659131FE4268200430F20 /* FileController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDB659121FE4268200430F20 /* FileController.swift */; }; + CDE9C3541FEBDBD100168B40 /* Document Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = CDE9C3531FEBDBD100168B40 /* Document Icon.icns */; }; CDFF69981FD827B800E652EE /* ScreenshotFramerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDFF69971FD827B800E652EE /* ScreenshotFramerTests.swift */; }; CDFF699F1FD827D900E652EE /* LayerStateHistory.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD26F83C1FCEEB1C00449B4A /* LayerStateHistory.swift */; }; CDFF69A01FD8280100E652EE /* LayerState.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD26F83A1FCEE01800449B4A /* LayerState.swift */; }; @@ -85,6 +86,7 @@ CDB6590E1FE3DAF800430F20 /* NSColor+Hex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSColor+Hex.swift"; sourceTree = ""; }; CDB659101FE3F00000430F20 /* MNCoalescing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MNCoalescing.swift; sourceTree = ""; }; CDB659121FE4268200430F20 /* FileController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileController.swift; sourceTree = ""; }; + CDE9C3531FEBDBD100168B40 /* Document Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "Document Icon.icns"; sourceTree = ""; }; CDFF69951FD827B800E652EE /* Screenshot FramerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Screenshot FramerTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; CDFF69971FD827B800E652EE /* ScreenshotFramerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScreenshotFramerTests.swift; sourceTree = ""; }; CDFF69991FD827B800E652EE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -200,6 +202,7 @@ children = ( CD5EE0461FCD557200AD2ED7 /* Assets.xcassets */, CDFF69A91FD849E300E652EE /* CenterClipView.swift */, + CDE9C3531FEBDBD100168B40 /* Document Icon.icns */, CD5EE04C1FCD557200AD2ED7 /* Framer.entitlements */, CD5EE04B1FCD557200AD2ED7 /* Info.plist */, CD5EE0481FCD557200AD2ED7 /* MainMenu.xib */, @@ -332,6 +335,7 @@ buildActionMask = 2147483647; files = ( CD2EC1CC1FD7F10800C17756 /* ContentViewController.xib in Resources */, + CDE9C3541FEBDBD100168B40 /* Document Icon.icns in Resources */, CD5EE0471FCD557200AD2ED7 /* Assets.xcassets in Resources */, CD5EE0451FCD557200AD2ED7 /* DocumentWindowController.xib in Resources */, CDFF69A61FD834AE00E652EE /* TimeTravelWindowController.xib in Resources */, diff --git a/Screenshot Framer/Document Window/Content View Controller/Help Controller/LayoutController.swift b/Screenshot Framer/Document Window/Content View Controller/Help Controller/LayoutController.swift index 08152aa..74ccb65 100644 --- a/Screenshot Framer/Document Window/Content View Controller/Help Controller/LayoutController.swift +++ b/Screenshot Framer/Document Window/Content View Controller/Help Controller/LayoutController.swift @@ -41,6 +41,7 @@ class LayoutController { let firstLayoutableObject = layoutableObjects[0] let rootView = self.view(from: firstLayoutableObject) + (rootView as? pkView)?.backgroundColor = NSColor.lightGray for object in layoutableObjects where object != layoutableObjects[0] { let view: NSView @@ -59,7 +60,6 @@ class LayoutController { rootView.addSubview(view) } - return rootView } } @@ -87,16 +87,13 @@ private extension LayoutController { textField.backgroundColor = NSColor.red } - if let font = NSFont(name: object.font ?? "", size: object.fontSize ?? 25) { - textField.font = font - } + textField.font = self.font(for: object) if let color = object.color { textField.textColor = color } self.limitFontSize(for: textField) - return textField } @@ -121,7 +118,6 @@ private extension LayoutController { size = string.size(withAttributes: [NSAttributedStringKey.font: newFont]) textField.font = newFont } - return limited } @@ -139,4 +135,19 @@ private extension LayoutController { return view } } + + func font(for object: LayoutableObject) -> NSFont? { + var fontName: String? + + if let fontFamily = object.font { + fontName = fontFamily + } + + if fontName == nil || fontName?.count == 0 { + fontName = "Helvetica Neue" + } + + let font = NSFont(name: fontName!, size: object.fontSize ?? 25) + return font + } } diff --git a/Screenshot Framer/Supporting Files/Document Icon.icns b/Screenshot Framer/Supporting Files/Document Icon.icns new file mode 100644 index 0000000..fd561af Binary files /dev/null and b/Screenshot Framer/Supporting Files/Document Icon.icns differ diff --git a/Screenshot Framer/Supporting Files/Info.plist b/Screenshot Framer/Supporting Files/Info.plist index b10750a..a9ce867 100644 --- a/Screenshot Framer/Supporting Files/Info.plist +++ b/Screenshot Framer/Supporting Files/Info.plist @@ -12,7 +12,7 @@ frame CFBundleTypeIconFile - + Document Icon CFBundleTypeName DocumentType CFBundleTypeOSTypes