To install click the Add extension button. That's it.

The source code for the WIKI 2 extension is being checked by specialists of the Mozilla Foundation, Google, and Apple. You could also do it yourself at any point in time.

4,5
Kelly Slayton
Congratulations on this excellent venture… what a great idea!
Alexander Grigorievskiy
I use WIKI 2 every day and almost forgot how the original Wikipedia looks like.
Live Statistics
English Articles
Improved in 24 Hours
Added in 24 Hours
Languages
Recent
Show all languages
What we do. Every page goes through several hundred of perfecting techniques; in live mode. Quite the same Wikipedia. Just better.
.
Leo
Newton
Brights
Milds

From Wikipedia, the free encyclopedia

Core Text is a Core Foundation style API in macOS, first introduced in Mac OS X 10.4 Tiger, made public in Mac OS X 10.5 Leopard, and introduced for the iPad with iPhone SDK 3.2. Exposing a C API, it replaces the text rendering abilities of the now-deprecated QuickDraw and ATSUI frameworks in previous versions of Mac OS X. According to Apple, Core Text is "designed for high performance and ease of use" and its layout API is "simple, consistent, and tightly integrated with Core Foundation, Core Graphics, and Cocoa."[1]

YouTube Encyclopedic

  • 1/1
    Views:
    1 628
  • How to: Common Core Text Analysis Response

Transcription

Features

Core Text provides the following opaque types:

  • CTFramesetter - creates CTFrame objects from given attributed string object and CGPath object using CTTypesetter.
  • CTTypesetter - performs line layouts; e.g., line breaking
  • CTFrame - represents an array of lines (i.e., CTLine objects).
  • CTLine - represents an array of glyph runs.
  • CTRun - an ordered collection of glyphs sharing the same attribute.
  • CTFont - represents a font.

Example

The following code displays the text "Hello, World!" to the given graphics context in Objective-C.

// Prepare font
CTFontRef font = CTFontCreateWithName(CFSTR("Times"), 48, NULL);

// Create an attributed string
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);

// Draw the string
CTLineRef line = CTLineCreateWithAttributedString(attrString);
CGContextSetTextMatrix(context, CGAffineTransformIdentity);  //Use this one when using standard view coordinates
//CGContextSetTextMatrix(context, CGAffineTransformMakeScale(1.0, -1.0)); //Use this one if the view's coordinates are flipped

CGContextSetTextPosition(context, 10, 20);
CTLineDraw(line, context);

// Clean up
CFRelease(line);
CFRelease(attrString);
CFRelease(font);

References

External links

This page was last edited on 4 February 2024, at 18:46
Basis of this page is in Wikipedia. Text is available under the CC BY-SA 3.0 Unported License. Non-text media are available under their specified licenses. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. WIKI 2 is an independent company and has no affiliation with Wikimedia Foundation.