Skip to content

Commit

Permalink
Add error throwing to `Font.init()
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Dec 14, 2024
1 parent b1a04dd commit 52d10ac
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Sources/Cairo/Font.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,10 @@ public final class ScaledFont: OpaquePointerOwner {
matrix: Matrix,
currentTransformation: Matrix,
options: FontOptions
) {

) throws(CairoError) {
var matrixCopy = (matrix, currentTransformation)

self.internalPointer = cairo_scaled_font_create(face.internalPointer, &matrixCopy.0, &matrixCopy.1, options.internalPointer)!

guard self.status != CAIRO_STATUS_NO_MEMORY
else { fatalError("Out of memory") }
try self.status.throwsError()
}

// MARK: - Accessors
Expand Down

0 comments on commit 52d10ac

Please sign in to comment.