public
Description: A Cocoa View to draw Annotated Pinyin above Hanzi text
Homepage:
Clone URL: git://github.com/jjgod/pinyinview.git
jjgod (author)
Fri Jul 25 01:47:10 -0700 2008
commit  1d8c868d26b559d534fcac09e795629514c024a5
tree    24596714885d12ed4d295124f5016af0ba19ea84
parent  79a293bdf3d1999386c90e240974e37729303a9d
name age message
file .gitignore Loading commit data...
file PYView.h
file PYView.m
directory PYViewTest/
file README.markdown
README.markdown

PinyinView

PinyinView (PYView) is an Objective-C class for Cocoa framework to display annotated Pinyin text above Chinese characters (Hanzi).

Usage

Basically, PYView can be embeded into your app like this:

#include "PYView.h"

NSRect viewRect = NSMakeRect(50, 250, 700, 80);
view = [[PYView alloc] initWithFrame: viewRect
                            fontName: @"FZKai-Z03"
                               color: [NSColor whiteColor]];
NSArray *pinyin = [NSArray arrayWithObjects: @"nǐ", @"hǎo", @"zhōng", @"huá", 
                   @"rén", @"mín", @"gòng", @"hé", @"guó", nil];
PYMarkerItem *item = [[PYMarkerItem alloc] initWithHanzi: @"你好中华人民共和国"
                                                  pinyin: pinyin
                                                    type: 1];
[view setMarkerItem: item];
[item release];

For more details, check the PYViewTest project.

Contact

Bugs, feature requests & advices, please send to gzjjgod@gmail.com.