GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing ja.wikipedia.org — Core Text - Wikipedia Core Textは、Mac OS X v10.4で初めて導入され、Mac OS X v10.5で公開されたmacOSのCore Foundation風のAPIで、古くからmacOSにあり非推奨となったQuickDrawやATSUIに代わってテキストレンダリングの機能を担うものである。Appleによると、Core Textは高いパフォーマンスと利用の容易さを意識して設計され、このレイアウトAPIはシンプルで安定しており、Core FoundationやCore Graphics、Cocoaと密接に関連している。[1] 特徴Core Textは次のような不透過型を提供している。
使用例次のコードは与えられたグラフィックコンテクストに「Hello, World!」と表示する。 // フォントの準備 CTFontRef font = CTFontCreateWithName(CFSTR("Times"), 48, NULL); // 属性付き文字列の生成 CFStringRef keys[] = { kCTFontAttributeName }; CFTypeRef values[] = { font }; CFDictionaryRef attr = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFAttributedStringRef attrString = CFAttributedStringCreate(NULL, CFSTR("Hello, World!"), attr); CFRelease(attr); // 文字列の描画 CTLineRef line = CTLineCreateWithAttributedString(attrString); CGContextSetTextMatrix(context, CGAffineTransformIdentity); CGContextSetTextPosition(context, 10, 20); CTLineDraw(line, context); // 後片付け CFRelease(line); CFRelease(attrString); CFRelease(font); 参照外部リンク
隠しカテゴリ: | ||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |