1FontFamily class 2################ 3 4FontFamily objects are used to tie together all related font styles. 5 6Member Functions 7================ 8 9FontFamily(const char \*name) 10----------------------------- 11 121. Create and set internal name to the one passed to the constructor 132. Create the styles list 14 15 16~FontFamily(void) 17----------------- 18 191. delete the internal name 202. empty and delete the internal style list 21 22const char \*GetName(void) 23--------------------------- 24 25Returns the internal family name 26 27 28void AddStyle(const char \*path, FT_Face face) 29---------------------------------------------- 30 31Adds the style to the family. 32 33 341. Create the FontStyle object and add it to the style list. 35 36 37void RemoveStyle(const char \*style) 38------------------------------------ 39 40Removes the style from the FontFamily object. 41 42 431. Call GetStyle on the given pointer 442. If non-NULL, delete the object 453. If the style list is now empty, ask the FontServer to remove it from the family list 46 47FontStyle \*GetStyle(const char \*style) 48---------------------------------------- 49 50Looks up a FontStyle object based on its style name. Returns NULL if 51not found. 52 53 541. Iterate through the style list 55 56 a. compare style to each FontStyle object's GetName method and return the object if they are the same 57 582. If all items have been checked and nothing has been returned, return NULL 59 60 61const char \*GetStyle(int32 index) 62---------------------------------- 63 64Returns the name of the style at index 65 66 671. Get the FontStyle item at index obtained via the style list's 68ItemAt call 69 70 71int32 CountStyles(void) 72----------------------- 73 74Returns the number of items in the style list and, thus, the number of 75styles in the family 76 77 78bool HasStyle(const char \*stylename) 79------------------------------------- 80 81Returns true if the family has a style with the name stylename 82 83 841. Call GetStyle on the style name and return false if NULL, true if 85not. 86 87