🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

298 lines
8.4 KiB

  1. Introduction
  2. ------------
  3. Documentation is an extremely important part of any project, and it
  4. helps a lot if it uses consistent syntax and layout.
  5. The documentation for the FreeType library is maintained in header
  6. files in the `include/` directory in the form of code comments. These
  7. comments are extracted and organized by 'docwriter' (previously
  8. 'docmaker'). The generated docs can be viewed in the
  9. `docs/reference/site/` directory after running `make refdoc`.
  10. Documentation comments follow a specific structure and format as
  11. described below.
  12. Documentation Structure
  13. -----------------------
  14. The documentation is divided into multiple chapters, which contain
  15. sections relevant to it. The chapter details and sections contained
  16. in them are listed in `include/freetype/ftchapters.h`. Any unlisted
  17. section is added to the 'Miscellaneous' chapter.
  18. Sections may contain sub-sections which consist of properties,
  19. enumerations, and other data types.
  20. Comment Blocks
  21. --------------
  22. Documentation blocks follow a specific format:
  23. /***************************** (should end on column 77)
  24. *
  25. * (1 asterisk, 1 space, then content)
  26. *
  27. */ (end of block)
  28. To make 'docwriter' recognize a comment block, there must be at least
  29. two asterisks in the first line. As a consequence, you should change
  30. the second asterisk to something else if you want to prevent a comment
  31. block being handled by 'docwriter' (for example, change `/****/` to
  32. `/*#**/`).
  33. Markup Tags
  34. -----------
  35. Markup tags are used to indicate what comes next. The syntax for a
  36. tag is:
  37. @foo:
  38. An `@`, followed by the tag, and then `:`.
  39. Reserved Tags
  40. -------------
  41. There are some keywords that have a special meaning to docwriter.
  42. As a convention, all keywords are written in lowercase.
  43. * `chapter`: Defines a chapter. Usually the title with underscores.
  44. * `sections`: List of sections in the chapter, in order.
  45. * `section`: Defines the start or continuation of a section.
  46. * `title`: Title for a chapter or section. May contain spaces.
  47. * `abstract`: The abstract for a section, visible in the Table of
  48. Contents (TOC).
  49. * `description`: Detailed description of a tag (except chapters),
  50. shown as synopsis.
  51. * `values`: A list of 'values' for the tag. These values are used for
  52. cross-referencing.
  53. Other Tags
  54. ----------
  55. Except the ones given above, any other tags will be added as a part of
  56. a subsection. All tags are lowercase by convention.
  57. Public Header Definitions
  58. -------------------------
  59. The public headers for FreeType have their names defined in
  60. `include/freetype/config/ftheader.h`. Any new public header file must
  61. be defined in this file, in the following format:
  62. #define FT_NEWNAME_H <freetype/newname.h>
  63. Where `newname` is the name of the header file.
  64. This macro is combined with the file location of a sub-section and
  65. printed with the object.
  66. Note on code blocks captured after comments
  67. -------------------------------------------
  68. All non-documentation lines after a documentation comment block are
  69. captured to be displayed as the code for the sub-section. To stop
  70. collection, a line with `/* */` should be added.
  71. General Formatting Conventions
  72. ------------------------------
  73. * Use two spaces after a full stop ending a sentence.
  74. * Use appropriate uppercasing in titles. Refer
  75. https://english.stackexchange.com/a/34
  76. for more information.
  77. * Do not add trailing parentheses when citing a C function.
  78. Markdown Usage
  79. --------------
  80. All tags, except the ones that define the name and title for a block
  81. support markdown in them. Docwriter uses a markdown parser that
  82. follows rules given in John Gruber's markdown guide:
  83. https://daringfireball.net/projects/markdown/syntax
  84. with a few exceptions and extensions, detailed below. This may also
  85. be referred to as the **FreeType Flavored Markdown**.
  86. Headers
  87. -------
  88. Markdown headers should not be used directly, because these are added
  89. based on section titles, sub-section names, and tags. However, if a
  90. header needs to be added, note the following correspondence to HTML tags:
  91. * Section title on top of the page is `H1`.
  92. * Sub-section titles are `H2`.
  93. * Parts of sub-sections are `H4`.
  94. * Any header added will be visible in the Table of Contents (TOC) of
  95. the page.
  96. Emphasis
  97. --------
  98. * Use `_underscores_` for italics.
  99. * Use `**double asterisks**` for bold.
  100. Although the other notations (double underscore for bold, single
  101. asterisk for italics) are supported, it is recommended to use the
  102. above for consistency.
  103. Note that there may be cases where having two asterisks or underscores
  104. in a line may lead to text being picked up as italics or bold.
  105. Although unintentional, this is correct markdown behavior.
  106. For inline code, wrap the sequence with backticks (see below). This
  107. renders symbols correctly without modifications. If a symbol is
  108. absolutely required outside of an inline code block or code sequence,
  109. escape it with a backslash (like `\*` or `\_`).
  110. Lists
  111. -----
  112. Unordered lists can be created with asterisks:
  113. * Unordered list items can use asterisks.
  114. * Another list item.
  115. Ordered lists start with numbers:
  116. 1. This is an ordered list item.
  117. 2. Brackets after numbers won't work.
  118. To continue a list over multiple paragraphs, indent them with at least
  119. four spaces. For example:
  120. 1. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  121. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
  122. viverra nec, fringilla in, laoreet vitae, risus.
  123. Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
  124. Suspendisse id sem consectetuer libero luctus adipiscing.
  125. 2. This is the second list item.
  126. This paragraph is not a part of the list.
  127. More information on lists in markdown is available at
  128. https://daringfireball.net/projects/markdown/syntax#list
  129. Cross-references
  130. ----------------
  131. Other sub-sections can be linked with the `@` symbol:
  132. @description:
  133. While FreeType's CFF driver doesn't expose API functions by
  134. itself, it is possible to control its behaviour with
  135. @FT_Property_Set and @FT_Property_Get.
  136. If a field in the `values` table of another sub-section is linked, the
  137. link leads to its parent sub-section.
  138. Links and Images
  139. ----------------
  140. All URLs are converted to links in the HTML documentation.
  141. Markdown syntax for links and images are fully supported.
  142. Inline Code
  143. -----------
  144. To indicate a span of code, wrap it with backtick quotes (`` ` ``):
  145. Use the `printf()` function.
  146. Cross-references, markdown, and html styling do not work in inline code
  147. sequences.
  148. Code and Syntax Highlighting
  149. ----------------------------
  150. Blocks of code are fenced by lines with three back-ticks `` ``` ``
  151. followed by the language name, if any (used for syntax highlighting),
  152. as demonstrated in the following example.
  153. ```c
  154. x = y + z;
  155. if ( zookoo == 2 )
  156. {
  157. foobar();
  158. }
  159. ```
  160. Note that the indentation of the opening line and the closing line
  161. must be exactly the same. The code sequence itself should have a
  162. larger indentation than the surrounding back-ticks.
  163. Like inline code, markdown and html styling is *not* supported inside
  164. code blocks.
  165. Tables
  166. ------
  167. Tables are used to list values, input, and other fields. The FreeType
  168. Flavored Markdown adopts a simple approach to tables with two columns,
  169. or field definition tables.
  170. Field definition names may contain alphanumeric, underscore, and the
  171. `.` characters. This is followed by `::`. The following lines are
  172. the second column of the table. A field definition ends with the
  173. start of another field definition, or a markup tag.
  174. @Input:
  175. pathname ::
  176. A path to the font file.
  177. face_index ::
  178. See @FT_Open_Face for a detailed description of this
  179. parameter.
  180. Non-breaking Space
  181. ------------------
  182. A tilde can be used to create a non-breaking space. The example
  183. The encoding value~0 is reserved.
  184. is converted to
  185. The encoding value&nbsp;0 is reserved.
  186. ----------------------------------------------------------------------
  187. Copyright (C) 2018-2021 by
  188. Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
  189. This file is part of the FreeType project, and may only be used,
  190. modified, and distributed under the terms of the FreeType project
  191. license, LICENSE.TXT. By continuing to use, modify, or distribute
  192. this file you indicate that you have read the license and understand
  193. and accept it fully.
  194. --- end of DOCGUIDE ---