PeachBrackets
PeachBrackets.Annotations
FormFieldAppearance Class
Paints how a form control looks, onto any Canvas: the control’s real resolved CSS border and background (shared with the page painter) and its real resolved font, color and padding, so it draws the way any other box’s content would, including real font embedding for whatever glyphs its text needs. A consumer that makes controls interactive (a PDF writer making an AcroForm widget) draws each state it needs - the text, the checked and unchecked box - once, into whatever surface holds that state.
public sealed class FormFieldAppearance
Inheritance System.Object → FormFieldAppearance
Remarks
All geometry is in the layout space CssBox’s own Actual* properties are in: the control’s size in points
scaled up by pixelsPerPoint. Each paint call takes the size in points and does that scaling itself, then draws onto a canvas
whose own pixels-per-point is the same, so the control’s border, padding and font stay sized consistently with the rest of the
box, including under ShrinkToFit or a non-default PixelsPerInch.
| Properties | |
|---|---|
| PixelsPerPoint | The pixels per point the control was laid out with, which the canvas passed to the paint calls must use too. |
| Methods | |
|---|---|
| PaintCheckbox(Canvas, Size, bool) | Paints a checkbox: the border and background, plus the check mark in the field’s real text color when it is checked. |
| PaintRadio(Canvas, Size, bool) | Paints a radio button: the circular background and ring, plus the filled inner dot in the field’s real text color when it is selected. |
| PaintText(Canvas, Size, string, bool, Nullable<int>, bool) | Paints a single-line text (or combo-box) appearance: the border and background, then the value in the field’s real font and color, left aligned and vertically centered in the content box. With combCells, each character is instead centered in its own evenly divided cell (ISO 32000-1 §12.7.4.3’s “comb” field), with divider lines between cells in the field’s own border color and width. |
| TextFontSizePt(Size, bool, bool) | The size in points of the font a text appearance of this size draws with. |