💾 Archived View for lofi.haiku-os.org › docs › develop › servers › app_server › FontFamily.gmi captured on 2023-09-28 at 16:09:37. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
FontFamily objects are used to tie together all related font styles.
1. Create and set internal name to the one passed to the constructor
2. Create the styles list
1. delete the internal name
2. empty and delete the internal style list
Returns the internal family name
Adds the style to the family.
1. Create the FontStyle object and add it to the style list.
Removes the style from the FontFamily object.
1. Call GetStyle on the given pointer
2. If non-NULL, delete the object
3. If the style list is now empty, ask the FontServer to remove it from the family list
Looks up a FontStyle object based on its style name. Returns NULL if not found.
1. Iterate through the style list
1. compare style to each FontStyle object’s GetName method and return the object if they are the same
2. If all items have been checked and nothing has been returned, return NULL
Returns the name of the style at index
1. Get the FontStyle item at index obtained via the style list’s ItemAt call
Returns the number of items in the style list and, thus, the number of styles in the family
Returns true if the family has a style with the name stylename
1. Call GetStyle on the style name and return false if NULL, true if not.