ios7 - Does CGGlyph depend on the font size? -


cgglyph typedef unsigned short. every font can (or @ least could) specify different cgglyph value same character. within same font, value of cgglyph depend on font size?

basically want show same character different font sizes. can set font size cgcontextsetfontsize() , reuse cgglyph value?

cgglyph holds index of glyph inside font. because inside font, order of glyphs (individual character designs) can -- in particular, unrelated character code represents.

that is, order of characters in fonts unrelated encoding. character code of "a" 65 (in ascii) not mean "the 65th character in font glyph "a". unicode it's impossible make work way: unicode of curly left double quote, example, u+201c, or 8220 in decimal.

so there 1 or more tables inside each font translate between logical index of glyph (simply counting characters appear in file itself) , 1 or more encodings. (where encoding predefined set, such "unicode", "macroman", or "windows latin1".)

this has several advantages: first of all, characters in font file don't need appear in particular order. font designer can add many encodings file needed. also, it's possible font contain glyphs appear in no encoding @ (think of rare ligatures).

all said , done:

every font can (or @ least could) specify different cgglyph value same character.

neither can nor should. since cgglyph index value, starts @ 0 , last valid valid number of characters in font, minus 1.

the index of glyph not determined size, set @ different level. indeed can re-use value different sizes.
but, noteworthy: index of particular character is uniquely tied 1 font only. ordering of individual characters inside each font should considered unique (if because 1 font may contain more or less charcaters another).

see cgglyph tounichar related discussion.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -