Skip to content

Instantly share code, notes, and snippets.

View eyeplum's full-sized avatar
👀
U+1F440 EYES

Yan Li eyeplum

👀
U+1F440 EYES
  • Auckland, New Zealand
View GitHub Profile
- (void)drawRect:(NSRect)rect
{
// Drawing code here.
CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
CGContextSetTextMatrix(context, CGAffineTransformIdentity);
NSAttributedString *str = [[NSAttributedString alloc ]
initWithString:@"学习 Core Text. Learning Core Text. 中华人民共和国。"
attributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSFont fontWithName:@"Adobe Song Std" size:24.0f], (NSString *)kCTFontAttributeName, [NSNumber numberWithBool:YES], (NSString *)kCTVerticalFormsAttributeName, nil]];
CFAttributedStringRef attrString = (CFAttributedStringRef)str;
CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString(attrString);
@eyeplum
eyeplum / .gitignore
Created January 10, 2017 14:46 — forked from BennettSmith/.gitignore
Google Protobuf v2.6.0 Build Script for iOS
protobuf
protobuf-2.6.0
protobuf-2.6.1
protobuf-master
@eyeplum
eyeplum / GIF-Screencast-OSX.md
Created December 8, 2015 08:24 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: