1
shiny 2013-10-28 21:22:12 +08:00 via iPhone
需要字体支持中文,我试过可以绘制。
|
3
ijse 2013-10-29 08:32:53 +08:00
要不,换gm试下吧,觉得它更强大些。
|
4
shiny 2013-10-29 12:37:23 +08:00
|
5
favormm OP @shiny
大神,我用的是:https://github.com/LearnBoost/node-canvas 然后在sample中的font.js有一个示例,我试了一下。然后运行了一下, var Canvas = require('canvas') , Font = Canvas.Font , fs = require('fs') , path = require("path"); if (!Font) { throw new Error('Need to compile with font support'); } 会有错误,会进入if中去, Canvas.Font为空。我是用的npm install canvas的。 杂我的不支持Font呢。 |
8
shiny 2013-10-29 23:07:16 +08:00
@favormm OS X 里装这个 canvas 有点难装,虽然他的 wiki 页面里给了整个流程:https://github.com/LearnBoost/node-canvas/wiki
我在 debian 里按它 ubuntu 的方式来装是没问题的,Canvas.Font是一个 Function。 |
10
favormm OP @ijse 我好像用源码安装过graphicsmagick
后来用brew install graphicsmagick安装就会出问题 You must `brew link libpng' before graphicsmagick can be installed, 我也试着brew link libpng,然后提示: Error: Could not symlink file: /usr/local/Cellar/libpng/1.5.14/include/libpng15/pnglibconf.h Target /usr/local/include/libpng15/pnglibconf.h already exists. You may need to delete it. To force the link and overwrite all other conflicting files, do: brew link --overwrite formula_name To list all files that would be deleted: brew link --overwrite --dry-run formula_name 然后我加了--overwrite, 结果提示: Linking /usr/local/Cellar/libpng/1.5.14... Warning: Could not link libpng. Unlinking... Error: Permission denied - /usr/local/include/libpng15/pnglibconf.h 然后我又加sudo, 结果提示: Error: Cowardly refusing to `sudo brew link` You can use brew with sudo, but only if the brew executable is owned by root. However, this is both not recommended and completely unsupported so do so at your own risk. 我就无语了。 |
11
ijse 2013-10-30 18:28:35 +08:00
|