<div dir="ltr">> 

OK, this brings me to another question: what should I in general pass as the 2nd argument of hb_face_create?  Suppose I'm using a TTF or OTF font file, should I always pass zero as the 2nd argument?  What is the semantics of that argument?<div><br></div><div>0 in ttf and otf and the index you like when you have .otc, .ttc or .dfont and you like to reference the other faces in the file.</div><div><br></div><div>> If you mean the 'destroy" argument of hb_blob_create, then AFAIU this is called only to destroy user_data, and I don't have user_data,</div><div><br></div><div>user_data is whatever you like to pass to your destroy callback whenever is called, possibly the very memory returned from malloc when destory function is free</div><div><br></div><div>> But now you seem to say I shouldn't?<br></div><div><br></div><div>Yes, I think now I understand what you want is to pass destroy as soon you have another reference from it.</div><div><br></div><div>> Still, the questions about memory management for hb_face_t and about the semantics of the hb_memory_mode_t enum values are left unanswered.</div><div><br></div><div>About the former, it is just some ref counting technique, nothing weird, the latter, it indicated how should use think about the allocated memory, IIUC if you are not changing the blob after giving to harfbuzz just use the common used one.</div><div><br></div><div>> AFAIU, you are saying that if hb_face_get_glyph_count returns zero, the face is empty and shouldn't be used, is that right?</div><div><br></div><div>Yes</div><div><br></div><div>> Does this mean I should use the factor of 64 in my code as well?  Or does that value depend on some properties of the font?<br></div><div><br></div><div>It is some factor you are choosing, if you are using floats, just divide it by the 64, it is not font some properties, however there is an `upem`, the scale font is in, you can use that and that is the default setting also.</div></div>