I am having issues with a text API that I am writing and am looking for input from more experienced coders. The problem I am currently facing is with my centering method. If be used to center text to the full screen width it works great, if I am trying to center text in a smaller portion of the screen that is offset towards either edge, it fails miserably. API-in-progress below:
--[[
Text utilities API
by jaspercayne
A collection of functions to work with text
]]--
local textTools = {}
local component = require("component")
local term = require("term")
local text = require("text")
local gpu