Skip to content

Commit 627177d

Browse files
Add significant padding to articles.
1 parent d631755 commit 627177d

102 files changed

Lines changed: 1832 additions & 494 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# API Documentation
22

3-
The API documentation is automatically generated from source-code-level comments. Often, more information can be found by looking into the [source code](https://github.com/sixlabors) itself.
3+
The API documentation is generated from the public source comments for the Six Labors libraries. Use it when you need exact type names, overloads, constructor signatures, enum values, default behavior, inherited members, and namespace-level navigation.
4+
5+
These reference pages are designed to sit alongside the article guides. Start with the articles when you are learning a feature or choosing an approach, then use the API reference when you need the precise member contract for implementation work.
6+
7+
The API reference covers the libraries documented on this site, including ImageSharp, ImageSharp.Drawing, ImageSharp.Web, Fonts, and PolygonClipper. Each product area is grouped by namespace so you can move from high-level entry points, such as image processing extensions or drawing canvas APIs, down to the supporting options, primitives, and model types.
8+
9+
When a reference page does not answer a design question, check the matching article section first. The source repositories remain available on [GitHub](https://github.com/sixlabors) for contributors and for cases where you need to inspect implementation details that are intentionally not part of the public API contract.

articles/fonts/caretsandselection.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,10 @@ Use the full [`TextMetrics`](xref:SixLabors.Fonts.TextMetrics) overloads for sel
144144
Per-line selection uses the line-box height rather than per-glyph height, which matches normal text editor and browser behavior: selecting mixed font sizes on the same line paints a consistent line-height rectangle rather than one rectangle per glyph height. The selection geometry stays visually stable across mixed fonts and font sizes.
145145

146146
For a wider tour of the measurement model and how line metrics are derived, see [Measuring Text](measuringtext.md).
147+
148+
### Practical guidance
149+
150+
- Paint the selection rectangles returned by the API instead of reconstructing selection geometry yourself.
151+
- Keep anchor and focus as logical text positions; let the metrics map them into visual rectangles.
152+
- Use editor interaction mode when selections must include terminal blank lines.
153+
- Test mixed LTR/RTL selections with real strings, not only simple Latin text.

articles/fonts/checkglyphcoverage.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,10 @@ Glyph coverage is only the first question. A font can contain glyphs for individ
4444
Emoji and complex scripts are the usual cases where this distinction matters. A visible emoji can be a grapheme made from several code points, and Arabic, Indic, or Southeast Asian scripts can require shaping features that are not captured by a one-code-point probe.
4545

4646
For the conceptual fallback guidance, see [Fallback Fonts and Multilingual Text](fallbackfonts.md). For face-level coverage inspection, see [Font Metrics](fontmetrics.md).
47+
48+
### Practical guidance
49+
50+
- Use coverage checks to choose fallback candidates, not to prove final rendered quality.
51+
- Test grapheme clusters such as emoji sequences as whole strings with production layout options.
52+
- Prefer face-level coverage inspection when building diagnostics or font picker tooling.
53+
- Keep fallback order intentional so broad-coverage fonts do not hide preferred design choices.

articles/fonts/colorfonts.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,10 @@ Color-font support is part of text layout, not just final painting. If you measu
103103
Use the same [`TextOptions`](xref:SixLabors.Fonts.TextOptions) instance for both [`TextMeasurer`](xref:SixLabors.Fonts.TextMeasurer) and [`TextRenderer`](xref:SixLabors.Fonts.Rendering.TextRenderer) when you want a guaranteed match.
104104

105105
For renderer implementation details, see [Custom Rendering](customrendering.md). For fallback across multiple families, see [Fallback Fonts and Multilingual Text](fallbackfonts.md).
106+
107+
### Practical guidance
108+
109+
- Use the same `ColorFontSupport` setting when measuring and rendering.
110+
- Test the actual emoji or color glyph set you intend to support; technologies vary by font.
111+
- Decide fallback order deliberately when both monochrome and color families can cover the same text.
112+
- Custom renderers should handle painted glyph callbacks even if most text is outline-based.

articles/fonts/customrendering.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,10 @@ public TextDecorations EnabledDecorations()
143143
```
144144

145145
This makes it possible to render underline, overline, or strikeout using the same backend as the glyph outlines.
146+
147+
### Practical guidance
148+
149+
- Implement only the renderer callbacks your backend can honor correctly.
150+
- Keep layout in Fonts and rendering in your backend; do not recompute shaping inside the renderer.
151+
- Honor layer and paint callbacks when color-font output matters.
152+
- Use decoration callbacks instead of drawing underlines from guessed metrics.

articles/fonts/fallbackfonts.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,10 @@ If a script needs shaping support, make sure the selected font actually supports
108108
- Mixing many broad-coverage fonts can make fallback order hard to reason about.
109109

110110
If layout still looks wrong after fallback is configured, see [Troubleshooting](troubleshooting.md).
111+
112+
### Practical guidance
113+
114+
- Put the preferred design family first, then add fallbacks in the order you want missing glyphs to be searched.
115+
- Use `TextRuns` when a specific grapheme range must use a specific font rather than normal fallback.
116+
- Validate fallback with real content, especially emoji, RTL text, CJK text, and combining marks.
117+
- Remember that fallback solves missing glyphs; it does not guarantee matching style, metrics, or shaping behavior.

articles/fonts/fittexttowidth.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,10 @@ For interactive systems, consider a two-stage search: probe coarse sizes first,
5050
>This example is intentionally naive. It remeasures from scratch on each iteration to keep the recipe easy to follow. Production layout engines would usually cache measurements, font instances, or intermediate fit results instead of doing a full linear probe every time.
5151
5252
See [Measuring Text](measuringtext.md) and [Text Layout and Options](textlayout.md) for the fuller discussion.
53+
54+
### Practical guidance
55+
56+
- Fit with the same options you will use to render.
57+
- Define a minimum readable size before starting the search.
58+
- Use wrapping or truncation when shrinking would make the text unusable.
59+
- Cache fit results when the same string, font family, and target width repeat often.

articles/fonts/fontmetadata.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,10 @@ FontDescription description = font.FontMetrics.Description;
113113
For loading fonts into collections, see [Loading Fonts and Collections](gettingstarted.md). For working with installed machine fonts, see [System Fonts](systemfonts.md).
114114

115115
If you want the face-level metrics that drive layout and glyph inspection rather than just the descriptive metadata, see [Font Metrics](fontmetrics.md).
116+
117+
### Practical guidance
118+
119+
- Use metadata inspection before loading untrusted or user-supplied font files into normal collections.
120+
- Store invariant names for stable configuration and localized names for UI.
121+
- Inspect family styles before assuming bold or italic faces are available.
122+
- Use font paths for diagnostics, not as the only identity for a face.

articles/fonts/fontmetrics.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,10 @@ Use [`FontMetrics`](xref:SixLabors.Fonts.FontMetrics) when you care about:
229229
- direct glyph inspection
230230

231231
For face names and other descriptive metadata, see [Font Metadata and Inspection](fontmetadata.md). For variable-font usage, see [Variable Fonts](variablefonts.md).
232+
233+
### Practical guidance
234+
235+
- Use font metrics when layout, decoration, glyph coverage, or variation axes matter.
236+
- Use font descriptions when the question is identity, naming, style, or version metadata.
237+
- Treat glyph availability as a layout input, not as a guarantee of final script quality.
238+
- Cache metrics-derived decisions with the font face and variation values that produced them.

articles/fonts/gettingstarted.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,13 @@ Font font = family.CreateFont(
121121

122122
The active variation values become part of the [`Font`](xref:SixLabors.Fonts.Font) instance, so the same family can be reused to create multiple design-space instances.
123123

124+
### Practical guidance
125+
126+
- Use a private `FontCollection` when output must be stable across machines.
127+
- Use `SystemFonts` for host-dependent behavior such as diagnostics, user font pickers, or "use what is installed here" workflows.
128+
- Create `Font` instances for the size, style, culture, and variation values you actually intend to measure or render.
129+
- Keep font loading separate from per-request or per-frame layout work when the same files are reused.
130+
124131
### Next steps
125132

126133
- Use [Measuring Text](measuringtext.md) when you need layout metrics before rendering.

0 commit comments

Comments
 (0)