Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Recommendation Required: Format 0/6 or Format 4 cmap subtable for SFT

Recommendation Required: Format 0/6 or Format 4 cmap subtable for SFT

Recommendation Required: Format 0/6 or Format 4 cmap subtable for SFT


I have successfully converted donor ttf to SFT(PCL 5).

Glyf indices are extracted from cmap's Format 6 or 0 sub-table.
I know that either of these tables are found in tff files.
But not sure whether one of them must appear?

I need a recommendation to use a cmap sub-table for conversion if only first 256 characters are required.

If I have to use Format 4, what would be the process to extract the indices. Formula given in Microsoft's Open Type Documentation seems to be confusing.

RE: Recommendation Required: Format 0/6 or Format 4 cmap subtable for SFT

The specification page (in http://www.microsoft.com/typography/otspec/cmap.htm )for the 'cmap' table states:

All Microsoft Unicode BMP encodings (Platform ID = 3, Encoding ID = 1) must provide at least a Format 4 'cmap' subtable. If the font is meant to support supplementary (non-BMP) Unicode characters, it will additionally need a Format 12 subtable with a platform encoding ID 10. The contents of the Format 12 subtable need to be a superset of the contents of the Format 4 subtable. Microsoft strongly recommends using a BMP Unicode 'cmap' for all fonts.


Format 0: Byte encoding table
This is the Apple standard character to glyph index mapping table.

As I read it, if you are using a Windows platform, then the TrueType fonts are very likely to contain a 'format 4' subtable (within the Unicode BMP platform=3, encoding=0 table), but may quite possibly NOT contain_subtables of other platform/encoding/format.
.. and I don't think that the original Apple character set is a strict (8-bit) subset of Unicode.

So you almost certainly need to use 'format 4' (Segment mapping to delta values).

This supposition is reinforced by the specification (in the "PCL6 Soft Font Download Specification" document (see Tek-Tips FAQs this ('PCL') forum for where to get PCL6 documentation) for some of the fields following the GT segment header: Search Range, Entry Selector and Range Shift.

As far as I can tell (from a swift perusal) these are only defined in the 'format 4' cmap subtable.

... and I agree: the 'format 4' subtable is quite complicated, but (even if I could remember exactly how it should be interpreted) explaining how to decode it is possibly beyond what could be provided in a reasonably short response.

RE: Recommendation Required: Format 0/6 or Format 4 cmap subtable for SFT

>> ... if only first 256 characters are required ...

Note that the 'format 0' (Apple) subtable will prove access only to the first 256 GLYPHS - this is NOT necessarily the same as the first 256 CHARACTERS (as identified by their Unicode code-point values).

RE: Recommendation Required: Format 0/6 or Format 4 cmap subtable for SFT

The sample code for generating PCL XL Encapsulated TrueType Outline fonts, provided by HP with their source for 'xlttlib' MAY help you to understand the 'format 4' subtable of the 'cmap' table.

Note that this code ONLY proceeds if there is a 'format 4' subtable - otherwise it reports an error, and exits.

The process should be exactly the same for PCL5, except that the 'encapsulation' is different.

Documentation and code for 'xlttlib' can be obtained, along with other PCL6 documentation, from the HP Developer web site:


Select the "Public Software Development Kits" option.

Then select the "LaserJet and Digital Sender" kit area.

Then select the "Printer Languages | PCL 6 | PCL 6 documents" folder, which gives access to various PCL6 documents (most are in PDF format) and tools.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close