如何在 guile 中创建 cairo 曲面
我有这段代码
guile> (cairo-pdf-surface-create "foo.pdf" 100.0 100.0)
; and get this error
standard input:29:1: In procedure cairo-pdf-surface-create in expression (cairo-pdf-surface-create "foo.pdf" 100.0 ...):
standard input:29:1: Wrong type (expecting string): 100.0
ABORT: (wrong-type-arg)
,当我使用字符串作为宽度和高度时,
guile> (cairo-pdf-surface-create "foo.pdf" "100.0" "100.0")
Backtrace:
In standard input:
30: 0* [cairo-pdf-surface-create "foo.pdf" {"100.0"} "100.0"]
standard input:30:1: In procedure cairo-pdf-surface-create in expression (cairo-pdf-surface-create "foo.pdf" "100.0" ...):
standard input:30:1: Wrong type (expecting real number): "100.0"
文档说:
cairo-pdf-surface-create(文件名
) ; [函数]
(点宽度)(以点为单位的高度 )
⇒(ret <开罗表面-t>)
I have this code
guile> (cairo-pdf-surface-create "foo.pdf" 100.0 100.0)
; and get this error
standard input:29:1: In procedure cairo-pdf-surface-create in expression (cairo-pdf-surface-create "foo.pdf" 100.0 ...):
standard input:29:1: Wrong type (expecting string): 100.0
ABORT: (wrong-type-arg)
and when I use strings as width and height
guile> (cairo-pdf-surface-create "foo.pdf" "100.0" "100.0")
Backtrace:
In standard input:
30: 0* [cairo-pdf-surface-create "foo.pdf" {"100.0"} "100.0"]
standard input:30:1: In procedure cairo-pdf-surface-create in expression (cairo-pdf-surface-create "foo.pdf" "100.0" ...):
standard input:30:1: Wrong type (expecting real number): "100.0"
Documentation says:
cairo-pdf-surface-create (filename <char>) [Function]
(width-in-points
<double>) (height-in-points <double>)
⇒ (ret <cairo-surface-t>)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
至少对于最新版本,请尝试以下操作:
请参阅源,按
(sx sy 文件名)
的顺序指定参数,文件名是可选的(如果未指定,则使用当前输出端口) 。At least for the most recent version, try this:
See the source, which specifies the arguments in the order
(sx sy filename)
, with the filename being optional (using the current output port if not specified).