Main Page

From Gsocicu

Jump to: navigation, search

Contents

Status

<a href="http://web.archive.org/web/20040209045054/oss.software.ibm.com/icu/userguide/layoutEngine.html">Missing code from manual located</a> <a href="Also here">Also here</a>

Currently I have a xcode project (several really) which contains basic code for rendering to a graphics context, and the beginnings of a working Mac specific font instance.

  1. It uses c++/obj. c, as much of the required data must be accessed through the CoreText framework. Many of the basic data types are interchangable with their Cocoa counterparts (<a href="http://developer.apple.com/documentation/Cocoa/Conceptual/CarbonCocoaDoc/Articles/InterchangeableDataTypes.html#//apple_ref/doc/uid/20002401">Interchangable Data Types</a>) so can likely be made more Cocoa-ish without much trouble.
  2. It has a graphics context view (currently called TestView) prepared to draw on - this will be the area to draw the glyphs once I am done with the data side of it. This renders a couple of test bits of text - not derived from the LE.
  3. It currently accesses font data through a <a href="CTFont">CTFont</a>. BUT - should this be a <a href="CGFont">CGFont</a> - <a href="CGFontCopyTableForTag">CGFontCopyTableForTag</a>??? Check this as a CGFont seems to return the data I want (which may make it easier to access the font metrics).

What needs to be done:

  • The character to unicode mapper is a bit of an issue (I think). I need to access data in the cmap table, and it is structured so you initally can find out how many subtables there are, then you search <a href="http://ibsdietplan.org">ibs</a> for the one you want by platformID (Mac/Windows/Unicode/Other), then by specific platform ID's. At this point you have the glyph indices, and <a href="http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6cmap.html">other relvant information</a>. The example code shows how to use a font on Windows and Linux (platformID 3, SpecificID 1 or 10 - unicode). These are Windows specific Unicode tables.
I am now concentrating on the microsoft font table only.
  • It needs the character code mapping, and some way to draw to the graphics context. This should be possible with CGContext/CGFont.
  • It needs bits and pieces ported from the sample - file loading, processing (bidi, finding runs, etc). Most of this code was created to be portable so it should not be difficult.

<a href="Program outputs">program outputs</a>

Various Notes

Fonts

Opentype and truetype, have the minimum required tables for font information. The cmaps.h/cpp class looks *only* for the Windows encoding (3), and the platform specific ID of 1, or 10 (both Unicode related). See the following tables:

<a href="http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6name.html#ID">Table 39: Macintosh platform-specific encoding identifiers</a>

<a href="http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6name.html#ID">Table 38: Name records</a>

<a href="http://www.microsoft.com/OpenType/OTSpec/name.htm">Microsoft Opentype platform specific identifiers</a>

TODO: Fonts with tables (3, 1) is only supported by cmaps.cpp. Not all the fonts have this particular cmap subtable.

Misc

Mac OS X is built to allow internationalisation to be easily built into an application. At the lowest level Apple Type Services for Unicode Imaging (ATSUI) exists to allow developers to manipulate and convert unicode strings. ATSUI is reasonably old now, and the Cocoa API's are the most supported so using Cocoa and various other libraries is preferred in most situations. In Leopard, a new framework called Coretext became available (it was a private framework in 10.4). Coretext is for handling fonts, and text layout.

The LayoutEngine requires the following system dependent classes:

To do these the following methods must be implemented

There must also be some way to render the glyphs to the screen.

Fonts

Much of the data requested must be accessed through font tables. In particular (for truetype):

  • head table tag - for ascent, descent, linegap (leading)
  • variety of other information available (will document as required)

Links

<a href="ICU Reference">ICU Reference</a>

Fonts

<a href="http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=IWS-Chapter08">Overview of Truetype</a>

ICU

Apple




Consult the <a href="http://meta.wikimedia.org/wiki/Help:Contents">User's Guide</a> for information on using the wiki software.

Getting started


Personal tools

sl
דומיין בעברית  דומיין  דומין  תוכנה לניהול  קשרי לקוחות  CRM, ניהול קשרי לקוחות  דומין בעברית  פורומים  ספרדית  גיבוי