Font Awesome有一个非常好的图标集合,可用于Web项目.我想使用其中一个图标作为光标(自定义光标).
根据我的理解,Custom Cursors需要一个图片网址,但我无法找到Font Awesome图标的图片网址.
FontAwesome在其CSS文件中指定字形,如下所示:
/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure
screen readers do not read off random characters that represent icons */
.icon-glass:before { content: "\f000"; }
.icon-music:before { content: "\f001"; }
Run Code Online (Sandbox Code Playgroud)
我试图将图标从此字体渲染到画布元素,但无法看到如何访问这些字形.
ctx.font = "40px FontAwesome";
ctx.fillText("\f000",20,20); // no cigar
Run Code Online (Sandbox Code Playgroud)
如何在JavaScript字符串中指定这些字形?
我想仅使用带有svg/canvas和js最大值的css来逐行绘制线条.可以在这里找到我想绘制的线条的想法
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg">
<!-- Created with SVG-edit - http://svg-edit.googlecode.com/ -->
<g>
<title>Layer 1</title>
<path d="m33,104c1,0 2.1306,-0.8037 23,3c9.07012,1.65314 10,2 24,2c7,0 29,0 33,0c8,0 9,0 11,0c2,0 8,0 11,0c9,0 17,0 18,0c10,0 12,0 20,0c1,0 6,0 7,0c2,0 3.07613,0.38268 4,0c2.61313,-1.08239 2,-3 2,-6c0,-1 0,-2 0,-3c0,-1 0,-2 0,-3c0,-1 0,-2 0,-3c0,-1 0.30745,-3.186 -1,-5c-0.8269,-1.14727 -0.09789,-2.82443 -2,-4c-0.85065,-0.52573 -2.82443,-0.09789 -4,-2c-0.52573,-0.85065 -2.58578,-0.58578 -4,-2c-0.70711,-0.70711 -1.81265,-1.20681 -4,-3c-2.78833,-2.28588 -3.64749,-2.97251 -8,-4c-2.91975,-0.68926 -4.82375,-2.48626 -7,-3c-2.91975,-0.68926 -5.15224,-0.23463 -7,-1c-1.30656,-0.5412 -4.38687,-1.91761 -7,-3c-1.84776,-0.76537 -5.03609,0.37821 -7,0c-5.28799,-1.01837 -8,-3 -9,-3c-2,0 -5.0535,-0.54049 -7,-1c-2.17625,-0.51374 -4.15224,-0.23463 -6,-1c-1.30656,-0.54119 -3,-1 -4,-1c-2,0 -5,-1 -6,-1c-1,0 -3,-2 -6,-2c-2,0 -5,-2 -6,-2c-2,0 -2.02583,-0.67963 …Run Code Online (Sandbox Code Playgroud) javascript ×3
canvas ×2
css ×2
html5 ×2
css3 ×1
font-awesome ×1
html5-canvas ×1
svg ×1
webfonts ×1