AccessKit / AccessKit/accesskit

Which text properties are required?

Open
#578 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.5k
Forks
114
Avg merge
8h 25m
Merged PRs (30d)
28

Description

Setting a Node's label or string value is easy — but which is used when? Is set_label only for a label on something else (like a checkbox) when not specified as an independent node?

It appears that all of the below must be specified as new Nodes with role TextRun under another node of role Label / TextInput / etc., at least for complex text or where selection may be supported.

Can a simple (non-selectable) label specify its own text directly or should this also use a Role::TextRun sub-Node?

When a sub-tree of Nodes is used to specify text, is the text only provided in parts split between that sub-tree, or on the parent, or both? (Most of the time my representation uses a single contiguous text, with style attributes applying to sub-ranges.)

Fonts

Are font family, size and weight expected for all text items or only when differing from the default? Aha, the font_family specifies "Only present when different from parent." Does this imply that the root should specify the default font family?

Font size is in pixels.

Physical pixels per Em, I presume?

Is font style (italic/oblique) missing?

What are the above font properties even useful for? I'm not certain if they are sufficient to recreate the exact font face used. Likely not without style and without knowing whether font synthesis is enabled; also since the text system might use its own sources of fonts.

They are also a little problematic to specify the font family; it's always going to require a lookup in the local font database.

Characters

character_lengths, word_lengths, character positions and widths all need to come from the text backend and are a significant amount of data.

It is expected that these are provided for all texts in the tree all the time? Or only for those texts supporting selection?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the accesskit::Node API and the docs.rs entries for set_label, font_family, character_lengths, and word_lengths. Review how the Node tree represents text, fonts, and character metrics, then document the expected cases for direct text, TextRun subtrees, inherited font properties, and selection-related data.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
accessibility
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.