Microsoft OpenType Specification for cmap

The cmap table in OpenType files converts a character code to a glyph identifier.

Can someone help me understand the expression of C:

*(idRangeOffset[i]/2 + (c - startCount[i]) + &idRangeOffset[i])

Here is a subtable of 4 cmap format.

+5
source share
3 answers

So, in this expression, i = segment index and c = character code. idRangeOffset gets the segment offset in glyphIdArray inside the cmap. The value you are really looking for in this case is glyphIdArray [something]. Since glyphIdArray immediately follows idRangeOffset in the font file, you use idRangeOffset as the base pointer.

glyphIdArray, idRangeOffset, , idRangeOffset - 16 , 2, . glyphIdArray.

, , c - startCount [i], .

- , , .

LOCA.

+5

, , -, .

&idRangeOffset[i] idRangeOffset[i] , .

*(x) - x.

, idRangeOffset[i], idRangeOffset[i]/2 + (c - startCount[i]), . - , .

+5

RTFM!

" idRangeOffset 0, glyphIdArray. startCode idRangeOffset. idRangeOffset , glyphIdArray. , glyphIdArray idRangeOffset . C, :

* (idRangeOffset [I]/2 + (c - startCount [i]) + & idRangeOffset [i])

The value c is the code of the character in question, and I is the index of the segment in which c is displayed. If the value obtained from the indexing operation is not 0 (which indicates the absence of Glyph), idDelta [i] is added to it to get the glyph index. Arithmetic idDelta - modulo 65536. "

-5
source

All Articles