I have downloaded font js file using Cufon builder. But when I use in my canvas that font is not working. Please help me...

<script src="js/Verdana_400.font.js"></script>

                 var textObj = new fabric.Text("Sample", { 
                      fontFamily:'Verdana_400', 
                      left: 100,
                      fontSize: 80,
                      top: 100
                  }); 
canvas.add(textObj);
有帮助吗?

解决方案

You should try fontFamily: 'Verdana'

400 is the normal weight for fonts, as I recall. Typically, the name of the font file doesn't match the fontFamily name. It's better to look in your computer to see what how fonts are typically named, and use that name. For instance, I have a font file called airalbd.tff, and I just say fontFaimly: 'Arial' and `fontWeight: 'Bold' to make use of it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top