cocoa绘画中文
来源:互联网 发布:mac虚拟机win10镜像 编辑:程序博客网 时间:2024/05/01 01:57
绘画中文:
Quartz中CGContextShowTextAtPoint不支持中文,用以下方式绘画
NSGraphicsContext *gc = [NSGraphicsContextgraphicsContextWithGraphicsPort:context flipped:NO];
[NSGraphicsContextsetCurrentContext:gc];
[gcflushGraphics];
[strtextdrawAtPoint:origin withAttributes:nil];
[NSGraphicsContextrestoreGraphicsState];
以下是将字符串内容转换为矢量路径图形
- (NSBezierPath *) makePathFromString: (NSString *) string
forFont: (NSFont *) font
{
NSTextView *textview;
textview = [[NSTextView alloc] init];
[textview setString: string];
[textview setFont: font];
NSLayoutManager *layoutManager;
layoutManager = [textview layoutManager];
NSRange range;
range = [layoutManager glyphRangeForCharacterRange:
NSMakeRange (0, [string length])
actualCharacterRange: NULL];
NSGlyph *glyphs;
glyphs = (NSGlyph *) malloc (sizeof(NSGlyph)
* (range.length * 2));
[layoutManager getGlyphs: glyphs range: range];
NSBezierPath *path;
path = [NSBezierPath bezierPath];
[path moveToPoint: NSMakePoint (20.0, 20.0)];
[path appendBezierPathWithGlyphs: glyphs
count: range.length inFont: font];
free (glyphs);
[textview release];
return (path);
}
- cocoa绘画中文
- 绘画
- 绘画
- 绘画
- Cocoa
- Cocoa
- Cocoa
- Cocoa
- 《64-Bit transition Guide for Cocoa Touch》中文PDF版
- SketchBook for Enterprise (数字绘画设计软件)2017 V8.3.1中文破解版
- 绘画工具
- 绘画对话框
- IPHONE 绘画
- 绘画工具
- 综合绘画
- Excel绘画
- UIView 绘画
- 高级绘画
- 将数组中指定位置的元素删除
- 在Ofbiz中使用源生sql
- SQLITE3使用总结
- 《算法竞赛入门经典》之语言篇总结
- 渐变文字
- cocoa绘画中文
- C#获取IP地址
- SSH整合
- android 多点触控
- 解决org.hibernate.QueryException illegal attempt to dereference collection 异常错误
- 如何成为移动游戏业的1%
- android各个版本的名称和更新
- java实现打印PDF文件解决方案
- JdbcTemplate学习笔记