From 52d10ac94b21bac5e3264e3914bdda378a18c17b Mon Sep 17 00:00:00 2001 From: Alsey Coleman Miller Date: Fri, 13 Dec 2024 22:33:27 -0500 Subject: [PATCH] Add error throwing to `Font.init() --- Sources/Cairo/Font.swift | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Sources/Cairo/Font.swift b/Sources/Cairo/Font.swift index 870a5f8..a6a03df 100755 --- a/Sources/Cairo/Font.swift +++ b/Sources/Cairo/Font.swift @@ -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