Conformance and Samples
About 899 words
This page explains the meaning of the normative words in the specification, how to verify on your own that you meet a level, and lists the public samples used for verification.
Normative words
| Word | Meaning |
|---|---|
| must | Not meeting it means not conforming to the level the rule belongs to |
| must not | A prohibited behavior, as binding as "must" |
| should | Recommended practice; if not followed, make sure this causes no misplaced content, silent loss of content or security risk |
| may | Optional; does not affect interoperability |
The "Requirement" column in field tables:
| Value | Meaning |
|---|---|
| Required | Must be written and pass the field checks |
| Optional | May be omitted; when written, must still pass the field checks |
| Conditional | Whether it is required is determined by the field's description |
The "Level" column in field tables states from which level a reader must understand the field. Required fields must always be written, whatever level a writer declares.
Rule IDs
Every normative rule has a stable ID, for example INK-11. ID prefixes correspond to pages:
| Prefix | Page | Prefix | Page |
|---|---|---|---|
| VER | Versions and Changes | CANVAS | Canvas Block |
| TYPE | Block Types and Encoding | INK | Ink Block |
| COMPAT | Compatibility and Fallback | SHAPE | Shape Block |
| FILE | Main Ink File | MEDIA | Media Block |
| SAVE | Saving, Appending and Recovery | CLEAR | Clear Block |
| EXTRA | Resource Package | COLOR | Color Map |
| HDR | Header Block | NIB | Nibs and Caps |
| HEXT | Header Extension Block | PRESET | Shape Preset Registry |
| DEV | Device Structure |
Once published, an ID never changes its meaning and is never reused; deleted rules are recorded in Versions and Changes.
Self-certifying a level
UInk has no certification body and provides no automated test tool. An app verifies itself with the following steps and then declares its level:
- Choose the target levels, deciding the read level and the write level separately.
- Check every item on the checklists of that level and all levels below it in Levels and Certification.
- Verify with the public samples below: a reader opens each sample and compares the result with the expected result for that level in
fixtures.json; files produced by a writer are opened and checked with another reader known to be correct. - Declare it in the app's documentation, for example:
UInk 1.1 read: Standard + Inkeys extension; write: Basic.
Reading process
- Validate the first block, the Header (VER-3, HDR-2); refuse to parse if it does not conform.
- Read the optional Header Extension and create implicit singletons for missing registries (HEXT-3).
- Decode the remaining objects in order: a Canvas starts a new scope; content blocks belong to the preceding Canvas (FILE-3); for the same Canvas unique key, the last one wins (FILE-8); unknown Type IDs are skipped (TYPE-9).
- When the end is incomplete, discard the last object; when the middle is corrupt, stop reading without resynchronizing (FILE-16, FILE-17).
- Recalculate the page count and other state from the objects actually read, without relying on the statistics in the Header (HDR-5).
- Display according to your own level, and handle content beyond your level as described in Compatibility and Fallback.
Public samples
The 1.1 samples are produced by the generator script in the repository and are all published in /dist-standard/uink-v11/(Open in new window). fixtures.json(Open in new window) records each sample's purpose, the rule IDs it covers, its objects in readable form, and the expected result at each level; SHA256SUMS.txt(Open in new window) is for verifying the downloads.
Tips
If you find that a sample's expected result disagrees with the specification text, the specification text wins; please report it.
| Sample | Primary level | What it verifies |
|---|---|---|
core-pages.uink | Core | Multiple pages, varying Pen width, the seven basic Shapes, implicit singletons |
core-page-append.uink | Core | A new version of the same page is appended and the last one to appear wins; pageIndex temporarily duplicated |
basic-appearance.uink | Basic | Opacity, highlighter rectangle nib, caps, dashed lines, arrows, rounded corners, dot background |
standard-ppt.uink | Standard | PowerPoint Workspace, slideId binding, binding by pageIndex, retained pages, end page |
standard-media.uink + .extra | Standard | Image fit and crop, Media mapped by viewport |
standard-shape-object.uink | Standard | Shape object layer: first part and subsequent parts, shared undoId |
full-layers-devices.uink | Full | Multiple layers, multiple Devices, nested Workspaces |
full-hdr-advanced.uink | Full | HDR colors, Advanced Highlighter, renderOnlyWhenLatest |
full-shape-preset.uink | Full | construction of registered presets; unknown presets fall back to the object layer |
inkeys-erase-clear.uink | Inkeys | Erase Ink, eraser nibs, Clear intervals |
compat-v10.uink | Core | A 1.1 reader reads a version 10 file on a best-effort basis |
fallback-unknown.uink | Core | Fallback for unknown blocks, keys and enum values |
truncated-tail.uink | Core | Recovery when the last object is incomplete |
corrupt-middle.uink | Core | When an object in the middle is corrupt, keep the content before it and stop reading |
future-minor.uink | Core | A file with version = 12: skip unknown blocks and keys, read on a best-effort basis |
core-shape-curves.uink | Core | Curves and free-form shapes: the two branches of a hyperbola written as two Polylines grouped into an object, a heart written as a Polygon |
The 1.0 samples are kept in /dist-standard/uink-v10/(Open in new window) and are no longer updated.