字体头的魔法值:#x0A3B3B3B(期望#x00010000或#x74727565或#x74746366)



我是新来的,试图写一个vecto函数radiant-lambda:

(defun radiant-lambda (file)
(with-canvas (:width 80 :height 80) 
(let ((font (get-font "times.ttf"))
(step (/ pi 7)))
(set-font font 40)
(translate 45 45)
(draw-centered-string 0 -10 #(#x3BB))
(set-rgb-stroke 1 0 0)
(centered-circle-path 0 0 35)
(stroke)
(set-rgba-stroke 0 0 1.0 0.5)
(set-line-width 4)
(dotimes (i 14)
(with-graphics-state 
(rotate (* i step))
(move-to 30 0)
(line-to 40 0)
(stroke)))
(save-png file))))

但我得到了错误

font - header: #x0A3B3B3B(期望#x00010000或#x74727565或#x74746366)[类型ZPB-TTF:: Bad - magic的条件].

我假设在调用这个函数时,我错误地使用了这个参数,并问了这个问题(如何将。png文件作为参数传递给clip函数),但显然"times.ttf"根据一个建议,字体是问题。

请让我知道这里应该如何给出字体。

似乎您正在使用的times.ttf文件实际上不是ttf文件。你从哪儿弄来的?

由于字节0x0A3B3B3B转换为后跟三个分号的换行符,我怀疑这是一个重命名的lisp文件。

最新更新