Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/API/Groups/PDFGroupContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public enum PDFGroupContainer {

/**
Array of all possible containers, expect `.none`.
Useful for initalizing default values for each container
Useful for initializing default values for each container
*/
internal static var all: [PDFGroupContainer] {
[.left, .center, .right]
Expand Down
2 changes: 1 addition & 1 deletion Source/API/Layout/PDFContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public enum PDFContainer: CaseIterable {

/**
Array of all possible containers, expect `.none`.
Useful for initalizing default values for each container
Useful for initializing default values for each container
*/
internal static var all: [PDFContainer] {
[
Expand Down
4 changes: 2 additions & 2 deletions Source/API/PDFGeneratorProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public protocol PDFGeneratorProtocol: AnyObject {
Keep in mind, the output file is in a temporary folder of the OS and should be persisted by your own logic.

- parameter filename: Name of output file, `.pdf` will be appended if not given
- parameter info: Instance of `PDFInfo` with meta file information, defaults to default initialiser of `PDFInfo`
- parameter info: Instance of `PDFInfo` with meta file information, defaults to default initializer of `PDFInfo`

- returns: Temporary URL to the output file

Expand Down Expand Up @@ -98,7 +98,7 @@ extension PDFGeneratorProtocol {
Keep in mind, the output file is in a temporary folder of the OS and should be persisted by your own logic.

- parameter filename: Name of output file, `.pdf` will be appended if not given
- parameter info: Instance of `PDFInfo` with meta file information, defaults to default initialiser of `PDFInfo`
- parameter info: Instance of `PDFInfo` with meta file information, defaults to default initializer of `PDFInfo`

- returns: Temporary URL to the output file

Expand Down
12 changes: 6 additions & 6 deletions Source/API/PDFMultiDocumentGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import AppKit
public class PDFMultiDocumentGenerator: PDFGeneratorProtocol {

/**
Bounds of first document, set on initialisation
Bounds of first document, set on initialization
*/
private let bounds: CGRect

/**
Metadata information of first document, set on initialisation
Metadata information of first document, set on initialization
*/
private let info: PDFInfo

Expand All @@ -47,10 +47,10 @@ public class PDFMultiDocumentGenerator: PDFGeneratorProtocol {
public var debug = false

/**
Initialises a new multi-document generator for generating the giving documents.
Initializes a new multi-document generator for generating the giving documents.
It will use the page layout of the first document.

The instance property `progress` is initalised to the total document count.
The instance property `progress` is initialized to the total document count.

- parameter documents: Array of `PDFDocument` instances, which will all be rendered into a single PDF context
*/
Expand Down Expand Up @@ -79,7 +79,7 @@ public class PDFMultiDocumentGenerator: PDFGeneratorProtocol {
Creates a file at the given file URL, generates the PDF context data and writes the result idata nto the file.

- parameter target: URL of output file,
- parameter info: Instance of `PDFInfo` with meta file information, defaults to default initialiser of `PDFInfo`
- parameter info: Instance of `PDFInfo` with meta file information, defaults to default initializer of `PDFInfo`

- throws: Exception, if something went wrong
*/
Expand All @@ -98,7 +98,7 @@ public class PDFMultiDocumentGenerator: PDFGeneratorProtocol {
/**
Generates and returns the PDF context data.

- parameter info: Instance of `PDFInfo` with meta file information, defaults to default initialiser of `PDFInfo`
- parameter info: Instance of `PDFInfo` with meta file information, defaults to default initializer of `PDFInfo`

- throws: Exception, if something went wrong

Expand Down
2 changes: 1 addition & 1 deletion Source/API/Text/PDFSimpleText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class PDFSimpleText: PDFText {
public weak var style: PDFTextStyle?

/**
Initalizer
Initializer

- parameter text: Text to be drawn
- parameter spacing: Spacing between text lines, defaults to 0
Expand Down
2 changes: 1 addition & 1 deletion Source/API/Text/PDFTextStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class PDFTextStyle: Hashable {
public var color: Color?

/**
Initalizer
Initializer

- parameter name: Name of style
- parameter font: Font of text, defaults to nil
Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/Image/PDFImageObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal class PDFImageObject: PDFRenderObject {
internal var captionSpacing: CGFloat

/**
Initalizer
Initializer

- parameter image: Image object
- parameter captionSpacing: Spacing to caption, defaults to zero
Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/Layout/PDFLayoutHeights.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ internal struct PDFLayoutHeights: CustomStringConvertible {
internal var content: CGFloat = 0

/**
Initialises the heights by resetting the headers and footers
Initializes the heights by resetting the headers and footers
*/
internal init() {
resetHeaderFooterHeight()
Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/Layout/PDFSectionColumnContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public enum PDFSectionColumnContainer {

/**
Array of all possible containers, expect `.none`.
Useful for initalizing default values for each container
Useful for initializing default values for each container
*/
internal static var all: [PDFSectionColumnContainer] {
[.left, .center, .right]
Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/Text/PDFAttributedTextObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ internal class PDFAttributedTextObject: PDFRenderObject {
}

/**
Initalize with simple text object.
Initialize with simple text object.
Will be converted into a attributed string using the default values from the generator.

- parameter simpleText: Simple text object
Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/Text/PDFFontObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class PDFFontObject: PDFRenderObject {
internal var font: Font

/**
Initalizer
Initializer

- parameter font: New font
*/
Expand Down
2 changes: 1 addition & 1 deletion Source/Internal/Text/PDFTextColorObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal class PDFTextColorObject: PDFRenderObject {
internal var color: Color

/**
Initalizer
Initializer

- parameter textColor: New text color
*/
Expand Down
6 changes: 3 additions & 3 deletions Tests/TPPDFTests/Graphics/PDFLineSeparatorObject_Spec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ class PDFLineSeparatorObject_Spec: QuickSpec {
}
}

context("initalizers") {
context("initializers") {

it("can be initalized without") {
it("can be initialized without") {
separator = PDFLineSeparatorObject()
expect(separator).toNot(beNil())
}

it("can be initalized with a line style") {
it("can be initialized with a line style") {
let style = PDFLineStyle(type: .dotted, color: .orange, width: 0.25)

separator = PDFLineSeparatorObject(style: style)
Expand Down
4 changes: 2 additions & 2 deletions Tests/TPPDFTests/Graphics/PDFLineStyle_Spec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ class PDFLineStyle_Spec: QuickSpec {
lineStyle = PDFLineStyle()
}

it("can be initalized with empty initalizer") {
it("can be initialized with empty initializer") {
lineStyle = PDFLineStyle()
expect(lineStyle.type) == PDFLineType.full
expect(lineStyle.color) == Color.black
expect(lineStyle.width) == 0.25
}

it("can be initalized with values") {
it("can be initialized with values") {
lineStyle = PDFLineStyle(type: type, color: color, width: width)
expect(lineStyle.type) == type
expect(lineStyle.color) == color
Expand Down
12 changes: 6 additions & 6 deletions Tests/TPPDFTests/Graphics/UIColor+Hex_Spec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,33 @@ class Color_Hex_Spec: QuickSpec {
override func spec() {
describe("Color+Hex") {

it("can be initalized with three digit hex") {
it("can be initialized with three digit hex") {
let color = try? Color(hex: "3F0")
expect(color) == Color(red: 0.2, green: 1.0, blue: 0, alpha: 1)
}

it("can be initalized with four digit hex") {
it("can be initialized with four digit hex") {
let color = try? Color(hex: "3F0C")
expect(color) == Color(red: 0.2, green: 1.0, blue: 0, alpha: 0.8)
}

it("can be initalized with six digit hex") {
it("can be initialized with six digit hex") {
let color = try? Color(hex: "FF00FF")
expect(color) == Color.magenta
}

it("can be initalized with eight digit hex") {
it("can be initialized with eight digit hex") {
let color = try? Color(hex: "FFFF0000")
expect(color) == Color.yellow.withAlphaComponent(0.0)
}

it("can not be initalized with other length") {
it("can not be initialized with other length") {
expect {
try Color(hex: "1234567890")
}.to(throwError())
}

it("can not be initalized with invalid hexadecimal characters") {
it("can not be initialized with invalid hexadecimal characters") {
expect {
try Color(hex: "%")
}.to(throwError())
Expand Down
2 changes: 1 addition & 1 deletion Tests/TPPDFTests/Image/PDFImage_Spec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class PDFImage_Spec: QuickSpec {

context("initializer") {

it("can be initalized with only an image") {
it("can be initialized with only an image") {
pdfImage = PDFImage(image: image)
expect(pdfImage.image) == image
expect(pdfImage.caption).to(beNil())
Expand Down
2 changes: 1 addition & 1 deletion Tests/TPPDFTests/List/PDFListItemSymbol_Spec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class PDFListItemSymbol_Spec : QuickSpec {
expect(PDFListItemSymbol.numbered(value: nil).rawValue) == "numbered|nil"
}

it("can be initalized with raw value") {
it("can be initialized with raw value") {
expect(PDFListItemSymbol(rawValue: "none")?.rawValue) == PDFListItemSymbol.none.rawValue
expect(PDFListItemSymbol(rawValue: "inherit")?.rawValue) == PDFListItemSymbol.inherit.rawValue
expect(PDFListItemSymbol(rawValue: "dot")?.rawValue) == PDFListItemSymbol.dot.rawValue
Expand Down
4 changes: 2 additions & 2 deletions Tests/TPPDFTests/List/PDFListItem_Spec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ class PDFListItem_Spec: QuickSpec {

describe("initializer") {

it("can be initalized with a symbol") {
it("can be initialized with a symbol") {
object = PDFListItem(symbol: .dash)
expect(object.symbol.rawValue) == PDFListItemSymbol.dash.rawValue
}

it("can be initalized with a content") {
it("can be initialized with a content") {
let content = "EXAMPLE"

object = PDFListItem(content: content)
Expand Down
10 changes: 5 additions & 5 deletions Tests/TPPDFTests/Table/PDFTableCellBorders_Spec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,30 @@ class PDFTableCellBorders_Spec: QuickSpec {
}
}

context("initalizer") {
context("initializer") {

it("can be iniatlized with a left border") {
it("can be initialized with a left border") {
let style = PDFLineStyle(type: .dotted, color: .orange, width: 10)
let borders = PDFTableCellBorders(left: style)

expect(borders.left) == style
}

it("can be iniatlized with a top border") {
it("can be initialized with a top border") {
let style = PDFLineStyle(type: .dotted, color: .orange, width: 10)
let borders = PDFTableCellBorders(top: style)

expect(borders.top) == style
}

it("can be iniatlized with a right border") {
it("can be initialized with a right border") {
let style = PDFLineStyle(type: .dotted, color: .orange, width: 10)
let borders = PDFTableCellBorders(right: style)

expect(borders.right) == style
}

it("can be iniatlized with a bottom border") {
it("can be initialized with a bottom border") {
let style = PDFLineStyle(type: .dotted, color: .orange, width: 10)
let borders = PDFTableCellBorders(bottom: style)

Expand Down
4 changes: 2 additions & 2 deletions Tests/TPPDFTests/Table/PDFTableCellPosition_Spec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class PDFTableCellPosition_Spec: QuickSpec {
}
}

context("initalizer") {
context("initializer") {

it("can be initalized with a row and a column") {
it("can be initialized with a row and a column") {
expect(position.row) == row
expect(position.column) == column
}
Expand Down
8 changes: 4 additions & 4 deletions Tests/TPPDFTests/Table/PDFTableCellStyle_Spec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@ class PDFTableCellStyle_Spec: QuickSpec {
}
}

context("initalizer") {
context("initializer") {

it("can be iniatlized with colors") {
it("can be initialized with colors") {
let colors = (fill: Color.orange, text: Color.green)
let cell = PDFTableCellStyle(colors: colors)

expect(cell.colors.fill) == Color.orange
expect(cell.colors.text) == Color.green
}

it("can be iniatlized with borders") {
it("can be initialized with borders") {
let borders = PDFTableCellBorders(left: PDFLineStyle(type: .dotted, color: .purple, width: 15))
let cell = PDFTableCellStyle(borders: borders)

expect(cell.borders) == borders
}

it("can be iniatlized with a font") {
it("can be initialized with a font") {
let font = Font.systemFont(ofSize: 25)
let cell = PDFTableCellStyle(font: font)

Expand Down
8 changes: 4 additions & 4 deletions Tests/TPPDFTests/Table/PDFTableCell_Spec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ class PDFTableCell_Spec: QuickSpec {
}
}

context("initalizer") {
context("initializer") {

it("can be iniatlized with a content") {
it("can be initialized with a content") {
let content = try! PDFTableContent(content: "EXAMPLE")
let cell = PDFTableCell(content: content)

expect(cell.content) == content
}

it("can be iniatlized with an alignment") {
it("can be initialized with an alignment") {
let alignment = PDFTableCellAlignment.bottomRight
let cell = PDFTableCell(alignment: alignment)

expect(cell.alignment) == alignment
}

it("can be iniatlized with a style") {
it("can be initialized with a style") {
let style = PDFTableCellStyle(colors: (fill: Color.blue, text: Color.green))
let cell = PDFTableCell(style: style)

Expand Down
4 changes: 2 additions & 2 deletions Tests/TPPDFTests/Table/PDFTableContent_Spec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class PDFTableContent_Spec: QuickSpec {

context("initializer") {

it("can be initalized with any") {
it("can be initialized with any") {
expect {
try PDFTableContent(content: 123)
}.toNot(throwError())
Expand All @@ -59,7 +59,7 @@ class PDFTableContent_Spec: QuickSpec {
}.to(throwError())
}

it("can be initalized with type and optional content") {
it("can be initialized with type and optional content") {
let content = PDFTableContent(type: PDFTableContent.ContentType.attributedString,
content: NSAttributedString(string: "EXAMPLE"))
expect(content.type) == PDFTableContent.ContentType.attributedString
Expand Down
Loading