Cmaps and characters code

New Here ,
Apr 02, 2009 Apr 02, 2009

Copy link to clipboard

Copied

i try to extract glyphIndex from cmap tables ,I'd like to ask about if a character code maybe appear in many cmap tables for Ex: a character code can appear in both cmap0 and cmap4 tables? and if this case happened then should the glyphIndex of the character be extracted from the higher cmap
TOPICS
Open Type FDK

Views

2.3K

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 02, 2009 Apr 02, 2009

Copy link to clipboard

Copied

LATEST
Yes, a character code may appear in multiple cmap subtables.

See the OpenType spec: http://www.microsoft.com/Typography/otspec/cmap.htm

Which cmap subtable you would use to access the character would depend on your particular needs. What kind of codepoint are you trying to look up the glyph with? You say "cmap0" and "cmap4" but you don't specify whether the 0 and 4 refer to platform, encoding, or format.

I'm going to guess that you are referring to format 0 and format 4. First, I would say that one would normally pick a cmap based first on platform/encoding, and only secondarily on format.

Cmap format 0 is an old Apple format, limited to 256 encoded glyphs, seen in conjunction with platform=specific encoding(s), notably MacRoman.

Format 4 is one of several ways of representing Unicode codepoints, with the limitation that it can only deal with codepoints in the Basic Multilingual Plane or BMP.

Cheers,

T

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines