大佬教程收集整理的这篇文章主要介绍了Silverlight 引路蜂二维图形库示例:矢量字体,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
引路蜂二维图形库支持矢量字体,包括中文和英文。对于Silverlight应用,由于访问权限的问题,字库一般需作为资源文件包含在应用中,对于英文字体不是个大问题,而对于中文字库,GB2312字库文件最小也要4M以上,所以尽量是用同一字体。引路蜂二维图形库绘制文字时是采用的矢量字库。也可以对文字内部进行填充。文字方向可以从左到右,从上到下,从右到左。
字体 | 大小 | 下载 |
Arial | 34K | Download |
Courier New | 50K | Download |
Elephant | 52K | Download |
Impact | 34K | Download |
Georgia | 53K | Download |
Rockwell | 35K | Download |
Times New Roman | 44K | Download |
29K | Download | |
Verdana | 36K | Download |
幼圆 | 5128K | Download |
新魏 | 15874K | Download |
新宋体 | 5740K | Download |
行楷 | 13588K | Download |
宋体 | 5740K | Download |
隶书 | 7083K | Download |
仿宋 | 8104K | Download |
黑体 | 6108K | Download |
下例使用行楷显示“引路蜂软件”。
private void FontDemo() { TextureBrush brush1; BitmapImage img = new BitmapImage(); img.CreateOptions = BitmapCreateOptions.None; String path = "/SilverlightGraphics2DDemo;component/brick.png"; Stream s = Application.GetresourceStream (new Uri(path,UriKind.RelativE)).Stream; img.Setsource(s); WriteableBitmap writeableBitmap = new WriteableBitmap(img); brush1 = new TextureBrush(writeableBitmap.pixels,img.PixelWidth,img.PixelHeight); Pen pen = new Pen(Color.blue,1); path = "/SilverlightGraphics2DDemo;component/xingKai.fon"; int fontSize = 100; s = Application.GetresourceStream (new Uri(path,UriKind.RelativE)).Stream; s.Seek(0,SeekOrigin.begin); //Clear the canvas with white color. graphics2D.Clear(Color.WhitE); char[] longLine = null; Fontex font = new Fontex(s); String guidebee = "引路蜂软件"; longLine = guidebee.tocharArray(); graphics2D.SetPenAndBrush(pen,brush1); graphics2D.DrawChars(font,fontSize,longLine,longLine.Length,(screenWidth - fontSizE) / 2,20,Fontex.TextDirTb); int offset = 20; for (int i = 1; i < 4;i++ ) { fontSize=100-i*20; offset += fontSize+5; graphics2D.DrawChars(font,(screenWidth - fontSizE) / 2 - offset,Fontex.TextDirTb); graphics2D.DrawChars(font,(screenWidth - fontSizE) / 2 + offset,Fontex.TextDirTb); } }
除了外挂字体外,引路蜂二维图形库自带了一个英文字库可以通过Fontex.GetSystemFont()取得。此外上述.fon 字体格式为引路蜂自定义,内部使用SVG来描述字体。和Windows中的字体格式不一致。
以上是大佬教程为你收集整理的Silverlight 引路蜂二维图形库示例:矢量字体全部内容,希望文章能够帮你解决Silverlight 引路蜂二维图形库示例:矢量字体所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。