a5061ecec5
An effort was started some time ago to consolidate all internal documentation in the git tree. However, this was just an accumulation of files in various formats without any strucutre or way to browse it, which results in no one even knowing that we have docs here. This converts most of the files to restructuredtext and uses Sphinx to generate an HTML browsable user manual (with a table of content and a first attempt to put things in a global hierarchy). There are almost no changes to the documentation content in this commit (some obviously obsolete things were removed). The plan is to get the toolchain up and running to make these docs easily available, and only then see about improving the content. We can migrate some things off the wiki and website, and rework the table of contents to have some more hierarchy levels because currently it's a bit messy. Change-Id: I924ac9dc6e753887ab56f18a09bdb0a1e1793bfd Reviewed-on: https://review.haiku-os.org/c/haiku/+/4370 Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
87 lines
1.9 KiB
ReStructuredText
87 lines
1.9 KiB
ReStructuredText
FontFamily class
|
|
################
|
|
|
|
FontFamily objects are used to tie together all related font styles.
|
|
|
|
Member Functions
|
|
================
|
|
|
|
FontFamily(const char \*name)
|
|
-----------------------------
|
|
|
|
1. Create and set internal name to the one passed to the constructor
|
|
2. Create the styles list
|
|
|
|
|
|
~FontFamily(void)
|
|
-----------------
|
|
|
|
1. delete the internal name
|
|
2. empty and delete the internal style list
|
|
|
|
const char \*GetName(void)
|
|
---------------------------
|
|
|
|
Returns the internal family name
|
|
|
|
|
|
void AddStyle(const char \*path, FT_Face face)
|
|
----------------------------------------------
|
|
|
|
Adds the style to the family.
|
|
|
|
|
|
1. Create the FontStyle object and add it to the style list.
|
|
|
|
|
|
void RemoveStyle(const char \*style)
|
|
------------------------------------
|
|
|
|
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
|
|
|
|
FontStyle \*GetStyle(const char \*style)
|
|
----------------------------------------
|
|
|
|
Looks up a FontStyle object based on its style name. Returns NULL if
|
|
not found.
|
|
|
|
|
|
1. Iterate through the style list
|
|
|
|
a. 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
|
|
|
|
|
|
const char \*GetStyle(int32 index)
|
|
----------------------------------
|
|
|
|
Returns the name of the style at index
|
|
|
|
|
|
1. Get the FontStyle item at index obtained via the style list's
|
|
ItemAt call
|
|
|
|
|
|
int32 CountStyles(void)
|
|
-----------------------
|
|
|
|
Returns the number of items in the style list and, thus, the number of
|
|
styles in the family
|
|
|
|
|
|
bool HasStyle(const char \*stylename)
|
|
-------------------------------------
|
|
|
|
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.
|
|
|