4 Documentation is an extremely important part of any project, and it
5 helps a lot if it uses consistent syntax and layout.
7 The documentation for the FreeType library is maintained in header
8 files in the `include/` directory in the form of code comments. These
9 comments are extracted and organized by 'docwriter' (previously
10 'docmaker'). The generated docs can be viewed in the
11 `docs/reference/site/` directory after running `make refdoc`.
13 Documentation comments follow a specific structure and format as
17 Documentation Structure
18 -----------------------
20 The documentation is divided into multiple chapters, which contain
21 sections relevant to it. The chapter details and sections contained
22 in them are listed in `include/freetype/ftchapters.h`. Any unlisted
23 section is added to the 'Miscellaneous' chapter.
25 Sections may contain sub-sections which consist of properties,
26 enumerations, and other data types.
32 Documentation blocks follow a specific format:
34 /***************************** (should end on column 77)
36 * (1 asterisk, 1 space, then content)
40 To make 'docwriter' recognize a comment block, there must be at least
41 two asterisks in the first line. As a consequence, you should change
42 the second asterisk to something else if you want to prevent a comment
43 block being handled by 'docwriter' (for example, change `/****/` to
50 Markup tags are used to indicate what comes next. The syntax for a
55 An `@`, followed by the tag, and then `:`.
61 There are some keywords that have a special meaning to docwriter.
62 As a convention, all keywords are written in lowercase.
64 * `chapter`: Defines a chapter. Usually the title with underscores.
65 * `sections`: List of sections in the chapter, in order.
66 * `section`: Defines the start or continuation of a section.
67 * `title`: Title for a chapter or section. May contain spaces.
68 * `abstract`: The abstract for a section, visible in the Table of
70 * `description`: Detailed description of a tag (except chapters),
72 * `values`: A list of 'values' for the tag. These values are used for
79 Except the ones given above, any other tags will be added as a part of
80 a subsection. All tags are lowercase by convention.
83 Public Header Definitions
84 -------------------------
86 The public headers for FreeType have their names defined in
87 `include/freetype/config/ftheader.h`. Any new public header file must
88 be defined in this file, in the following format:
90 #define FT_NEWNAME_H <freetype/newname.h>
92 Where `newname` is the name of the header file.
94 This macro is combined with the file location of a sub-section and
95 printed with the object.
98 Note on code blocks captured after comments
99 -------------------------------------------
101 All non-documentation lines after a documentation comment block are
102 captured to be displayed as the code for the sub-section. To stop
103 collection, a line with `/* */` should be added.
106 General Formatting Conventions
107 ------------------------------
109 * Use two spaces after a full stop ending a sentence.
110 * Use appropriate uppercasing in titles. Refer
112 https://english.stackexchange.com/a/34
114 for more information.
115 * Do not add trailing parentheses when citing a C function.
121 All tags, except the ones that define the name and title for a block
122 support markdown in them. Docwriter uses a markdown parser that
123 follows rules given in John Gruber's markdown guide:
125 https://daringfireball.net/projects/markdown/syntax
127 with a few exceptions and extensions, detailed below. This may also
128 be referred to as the **FreeType Flavored Markdown**.
134 Markdown headers should not be used directly, because these are added
135 based on section titles, sub-section names, and tags. However, if a
136 header needs to be added, note the following correspondence to HTML tags:
138 * Section title on top of the page is `H1`.
139 * Sub-section titles are `H2`.
140 * Parts of sub-sections are `H4`.
141 * Any header added will be visible in the Table of Contents (TOC) of
148 * Use `_underscores_` for italics.
149 * Use `**double asterisks**` for bold.
151 Although the other notations (double underscore for bold, single
152 asterisk for italics) are supported, it is recommended to use the
153 above for consistency.
155 Note that there may be cases where having two asterisks or underscores
156 in a line may lead to text being picked up as italics or bold.
157 Although unintentional, this is correct markdown behavior.
159 For inline code, wrap the sequence with backticks (see below). This
160 renders symbols correctly without modifications. If a symbol is
161 absolutely required outside of an inline code block or code sequence,
162 escape it with a backslash (like `\*` or `\_`).
168 Unordered lists can be created with asterisks:
170 * Unordered list items can use asterisks.
173 Ordered lists start with numbers:
175 1. This is an ordered list item.
176 2. Brackets after numbers won't work.
178 To continue a list over multiple paragraphs, indent them with at least
179 four spaces. For example:
181 1. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
182 Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
183 viverra nec, fringilla in, laoreet vitae, risus.
185 Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
186 Suspendisse id sem consectetuer libero luctus adipiscing.
188 2. This is the second list item.
190 This paragraph is not a part of the list.
192 More information on lists in markdown is available at
194 https://daringfireball.net/projects/markdown/syntax#list
200 Other sub-sections can be linked with the `@` symbol:
203 While FreeType's CFF driver doesn't expose API functions by
204 itself, it is possible to control its behaviour with
205 @FT_Property_Set and @FT_Property_Get.
207 If a field in the `values` table of another sub-section is linked, the
208 link leads to its parent sub-section.
214 All URLs are converted to links in the HTML documentation.
216 Markdown syntax for links and images are fully supported.
222 To indicate a span of code, wrap it with backtick quotes (`` ` ``):
224 Use the `printf()` function.
226 Cross-references, markdown, and html styling do not work in inline code
230 Code and Syntax Highlighting
231 ----------------------------
233 Blocks of code are fenced by lines with three back-ticks `` ``` ``
234 followed by the language name, if any (used for syntax highlighting),
235 as demonstrated in the following example.
245 Note that the indentation of the opening line and the closing line
246 must be exactly the same. The code sequence itself should have a
247 larger indentation than the surrounding back-ticks.
249 Like inline code, markdown and html styling is *not* supported inside
256 Tables are used to list values, input, and other fields. The FreeType
257 Flavored Markdown adopts a simple approach to tables with two columns,
258 or field definition tables.
260 Field definition names may contain alphanumeric, underscore, and the
261 `.` characters. This is followed by `::`. The following lines are
262 the second column of the table. A field definition ends with the
263 start of another field definition, or a markup tag.
267 A path to the font file.
270 See @FT_Open_Face for a detailed description of this
277 A tilde can be used to create a non-breaking space. The example
279 The encoding value~0 is reserved.
283 The encoding value 0 is reserved.
286 ----------------------------------------------------------------------
288 Copyright (C) 2018-2020 by
289 Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
291 This file is part of the FreeType project, and may only be used,
292 modified, and distributed under the terms of the FreeType project
293 license, LICENSE.TXT. By continuing to use, modify, or distribute
294 this file you indicate that you have read the license and understand
298 --- end of DOCGUIDE ---