Add files via upload

more fonts, and a python font generation program will be uploaded in a few days
This commit is contained in:
AAAB60
2025-02-11 18:14:44 +08:00
committed by GitHub
parent 5fbc4d6df4
commit af9de2daf0
14 changed files with 1492980 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
---@module "cctAPI"
local monitor = peripheral.find("monitor")
local computer = term.redirect(monitor)
-- suggested
monitor.setTextScale(0.5)
term.clear()
term.setCursorPos(1, 1)
local M = require("utf8textutils")
---@param str string
---@param fps number films per second
local function pirntScrolling(str, fps)
str = str .. " "
local termWidth = term.getSize()
local cfg1 = M.getCfg("noauto")
cfg1.masking = { 2, 2, termWidth - 1, cfg1.fontFamily.maxHeight + 1 }
local spf = 1 / fps
---@type FontFamily
local fontFamily = cfg1.fontFamily
local wid = 0
for _, code in M.codes(str) do
local bm = M.getCharMap(code, fontFamily)
wid = wid + #bm[1]
end
local cursorX = 2
local cursorY = 2
local maskingWidth = cfg1.masking[3] - cfg1.masking[1]
local repeatNum = math.max(maskingWidth, wid)
while true do
cursorX = 2
for i = 1, repeatNum do
term.setCursorPos(cursorX, cursorY)
M.printUtf8(str, cfg1)
term.setCursorPos(cursorX + repeatNum, cursorY)
M.printUtf8(str, cfg1)
cursorX = cursorX - 1
os.sleep(spf)
end
end
end
pirntScrolling("hello -- by AAAB60", 5)