> For the complete documentation index, see [llms.txt](https://docs.wisej.com/system.drawing.managed/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/system.drawing.managed/api/system.drawing/system.drawing.stringformatflags.md).

# StringFormatFlags

Namespace: **System.Drawing**

Assembly: **System.Drawing.Managed** (4.0.0.0)

Specifies the display and layout information for text strings.

{% tabs %}
{% tab title="C#" %}

```csharp
public enum StringFormatFlags : Enum
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Enum StringFormatFlags As [Enum]
```

{% endtab %}
{% endtabs %}

## Fields

| Name                      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **DirectionRightToLeft**  | Specifies that text is right to left.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **DirectionVertical**     | Specifies that text is vertical.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **DisplayFormatControl**  | Causes control characters such as the left-to-right mark to be shown in the output with a representative glyph.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **FitBlackBox**           | <p>Specifies that no part of any glyph overhangs the bounding rectangle. By default some glyphs overhang the rectangle slightly where necessary to appear at the edge visually. For example when an italic lower case letter f in a font such as Garamond is aligned at the far left of a rectangle, the lower part of the f will reach slightly further left than the left edge of the rectangle. Setting this flag will ensure no painting outside the rectangle but will cause the aligned edges of adjacent lines of text to appear uneven.<br>WARNING: The GDI+ equivalent for this is StringFormatFlags::StringFormatFlagsNoFitBlackBox, which is defined as 0x4. This was a mistake introduced since the first version of the product and fixing it at this point would be a breaking change. <a href="https://docs.microsoft.com/en-us/windows/desktop/api/gdiplusenums/ne-gdiplusenums-stringformatflags">ne-gdiplusenums-stringformatflags</a></p> |
| **LineLimit**             | Specifies that only entire lines are laid out in the layout rectangle. By default, layout continues until the end of the text or until no more lines are visible as a result of clipping, whichever comes first. The default settings allow the last line to be partially obscured by a layout rectangle that is not a whole multiple of the line height. To ensure that only whole lines are seen, set this flag and be careful to provide a layout rectangle at least as tall as the height of one line.                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **MeasureTrailingSpaces** | Specifies that the space at the end of each line is included in a string measurement.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **NoClip**                | Specifies that characters overhanging the layout rectangle and text extending outside the layout rectangle are allowed to show. By default, all overhanging characters and text that extends outside the layout rectangle are clipped. Any trailing spaces (spaces that are at the end of a line) that extend outside the layout rectangle are clipped. Therefore, the setting of this flag will have an effect on a string measurement if trailing spaces are being included in the measurement. If clipping is enabled, trailing spaces that extend outside the layout rectangle are not included in the measurement. If clipping is disabled, all trailing spaces are included in the measurement, regardless of whether they are outside the layout rectangle.                                                                                                                                                                                           |
| **NoFontFallback**        | Disables fallback to alternate fonts for characters not supported in the requested font. Any missing characters are displayed with the fonts missing glyph, usually an open square.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **NoWrap**                | Specifies that the wrapping of text to the next line is disabled. NoWrap is implied when a point of origin is used instead of a layout rectangle. When drawing text within a rectangle, by default, text is broken at the last word boundary that is inside the rectangle's boundary and wrapped to the next line.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

## Used By

| Name                                                                                                       | Description                                                                                                                                                          |
| ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [StringFormat.FormatFlags](/system.drawing.managed/api/system.drawing/system.drawing.stringformatflags.md) | Gets or sets a [StringFormatFlags](/system.drawing.managed/api/system.drawing/system.drawing.stringformatflags.md) enumeration that contains formatting information. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.wisej.com/system.drawing.managed/api/system.drawing/system.drawing.stringformatflags.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
