Skip to content
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.

Commit

Permalink
the fonts relative path should include the parent dir
Browse files Browse the repository at this point in the history
  • Loading branch information
djbe committed Aug 16, 2017
1 parent 510e67e commit 8c851a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Sources/Parsers/FontsParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public final class FontsParser: Parser {

public func parse(path: Path) {
let dirChildren = path.iterateChildren(options: [.skipsHiddenFiles, .skipsPackageDescendants])
let parentDir = path.absolute().parent()

for file in dirChildren {
var value: AnyObject? = nil
let url = file.url as NSURL
Expand All @@ -93,7 +95,7 @@ public final class FontsParser: Parser {
continue
}
guard UTTypeConformsTo(uti as CFString, "public.font" as CFString) else { continue }
let fonts = CTFont.parse(file: file, relativeTo: path)
let fonts = CTFont.parse(file: file, relativeTo: parentDir)
fonts.forEach { addFont($0) }
}
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Resources
Submodule Resources updated 70 files
+9 −2 CHANGELOG.md
+21 −21 Contexts/Fonts/defaults.plist
+1 −1 Documentation/MigrationGuide.md
+53 −0 Documentation/colors/swift4.md
+1 −0 Documentation/fonts/swift2.md
+1 −0 Documentation/fonts/swift3.md
+53 −0 Documentation/fonts/swift4.md
+72 −0 Documentation/storyboards/swift4.md
+53 −0 Documentation/strings/flat-swift4.md
+69 −0 Documentation/strings/structured-swift4.md
+51 −0 Documentation/xcassets/swift4.md
+0 −0 Fixtures/stub-env/swift4/.gitkeep
+1 −1 Podfile
+4 −3 Podfile.lock
+4 −3 Pods/Manifest.lock
+6 −1 Pods/StencilSwiftKit/README.md
+8 −1 Pods/StencilSwiftKit/Sources/Environment.swift
+93 −7 Pods/StencilSwiftKit/Sources/Filters+Strings.swift
+10 −2 Rakefile
+14 −2 Templates.xcodeproj/project.pbxproj
+3 −1 Templates.xcodeproj/xcshareddata/xcschemes/Generate Output.xcscheme
+3 −1 Templates.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme
+50 −0 Tests/Expected/Colors/swift4-context-defaults-customname.swift
+50 −0 Tests/Expected/Colors/swift4-context-defaults.swift
+3 −0 Tests/Expected/Colors/swift4-context-empty.swift
+75 −0 Tests/Expected/Colors/swift4-context-multiple.swift
+86 −0 Tests/Expected/Fonts/swift2-context-defaults-preservepath.swift
+86 −0 Tests/Expected/Fonts/swift3-context-defaults-preservepath.swift
+86 −0 Tests/Expected/Fonts/swift4-context-defaults-customname.swift
+86 −0 Tests/Expected/Fonts/swift4-context-defaults-preservepath.swift
+86 −0 Tests/Expected/Fonts/swift4-context-defaults.swift
+3 −0 Tests/Expected/Fonts/swift4-context-empty.swift
+124 −0 Tests/Expected/Storyboards-iOS/swift4-context-all-customname.swift
+123 −0 Tests/Expected/Storyboards-iOS/swift4-context-all-ignore-module.swift
+124 −0 Tests/Expected/Storyboards-iOS/swift4-context-all.swift
+3 −0 Tests/Expected/Storyboards-iOS/swift4-context-empty.swift
+106 −0 Tests/Expected/Storyboards-macOS/swift4-context-all-customname.swift
+105 −0 Tests/Expected/Storyboards-macOS/swift4-context-all-ignore-module.swift
+106 −0 Tests/Expected/Storyboards-macOS/swift4-context-all.swift
+3 −0 Tests/Expected/Storyboards-macOS/swift4-context-empty.swift
+3 −0 Tests/Expected/Strings/flat-swift4-context-empty.swift
+49 −0 Tests/Expected/Strings/flat-swift4-context-localizable-customname.swift
+38 −0 Tests/Expected/Strings/flat-swift4-context-localizable-no-comments.swift
+49 −0 Tests/Expected/Strings/flat-swift4-context-localizable.swift
+63 −0 Tests/Expected/Strings/flat-swift4-context-multiple.swift
+3 −0 Tests/Expected/Strings/structured-swift4-context-empty.swift
+97 −0 Tests/Expected/Strings/structured-swift4-context-localizable-customname.swift
+86 −0 Tests/Expected/Strings/structured-swift4-context-localizable-no-comments.swift
+97 −0 Tests/Expected/Strings/structured-swift4-context-localizable.swift
+111 −0 Tests/Expected/Strings/structured-swift4-context-multiple.swift
+87 −0 Tests/Expected/XCAssets/swift4-context-defaults-customname.swift
+76 −0 Tests/Expected/XCAssets/swift4-context-defaults-no-all-values.swift
+87 −0 Tests/Expected/XCAssets/swift4-context-defaults.swift
+3 −0 Tests/Expected/XCAssets/swift4-context-empty.swift
+7 −0 Tests/TemplatesTests/ColorsTests.swift
+11 −1 Tests/TemplatesTests/FontsTests.swift
+8 −0 Tests/TemplatesTests/StoryboardsMacOSTests.swift
+8 −0 Tests/TemplatesTests/StoryboardsiOSTests.swift
+14 −0 Tests/TemplatesTests/StringsTests.swift
+7 −0 Tests/TemplatesTests/XCAssetsTests.swift
+1 −1 circle.yml
+1 −1 rakelib/utils.rake
+60 −0 templates/colors/swift4.stencil
+8 −1 templates/fonts/swift2.stencil
+8 −1 templates/fonts/swift3.stencil
+73 −0 templates/fonts/swift4.stencil
+109 −0 templates/storyboards/swift4.stencil
+60 −0 templates/strings/flat-swift4.stencil
+64 −0 templates/strings/structured-swift4.stencil
+106 −0 templates/xcassets/swift4.stencil

0 comments on commit 8c851a8

Please sign in to comment.