How texts, fonts, states and languages are resolved
Migrated page, not yet verified against the current code. Treat values, paths and examples as indicative until this notice is removed.
A label on a screen answers four questions: which words (the operator’s language), which typeface and size (the project’s text style), which colours right now (the object’s state), and what the engineer changed on this one object. eaxScada answers them in one place, in a fixed order, for every object type.
The order
Section titled “The order”- Service or process
Read as text
One resolver gives every label its words, font and colours in a fixed order: the language picks the words, the project's text style sets the font, the object's state adds its look, and the font settings made on the object itself come last. Each layer overwrites what the one before set.
Parts
- Language (layer 1): Which words.
- Text style (layer 2): Which typeface, size and colour.
- State (layer 3): Which look right now.
- Overrides (layer 4): What the engineer set on this object.
- Looked up in this order (service or process): the operator's language, the project's default, then English, each in the project and then the product; then the fallback after |; then the key
- The named style (service or process): the object's text style, else its family's normal style, else the default family's
- Layered, last wins (service or process): class, theme, the project's default family, the project's family, a button's own colours, the object's own states; then the state's text style
- The object's own font settings (service or process): family, size, weight, italic, spacing, case, colour; a type's default value does not count
Connections
- Looked up in this order → The named style (next step)
- The named style → Layered, last wins (next step). The state layer ends with the state's text style, then its own font and text colour.
- Layered, last wins → The object's own font settings (next step). A widget's chrome texts, such as its kind badge, take the language and the state only.
- Language. A text is a literal (
START) or a key with a fallback (t:cmd.start|START). A key is looked up in the operator’s language, then the project’s default language, then English, each in the project’s translations and then the product’s; then the fallback after|is shown, and without one the key itself. See Translate your project. - Text style. A named style of the project (Title, Heading, Label, Value, Unit, Button, Alarm, Small, or your own) sets the family, size, weight, italic, letter spacing, case and colour. An object that names no text style takes the one its family’s normal state names, else the one of the default family. See Fonts and text styles.
- State. The object’s state (normal, hover, pressed, on, disabled, bad, locked, not configured) applies, each over the one before: the object’s style class, the theme’s base look, the project’s state style for every family (
default), the project’s state style for the object’s family, a button’s own colours, then the object’s own; a text style the state names and its font and text colour come last in this layer. See Style object states. - Overrides. Font settings and a text colour set on the object itself apply last. A Text object’s own colour is its Text colour (
fill).
For the text colour this gives: the object’s own colour > the state’s colour > the text style’s colour > the type’s default colour. A member left at the type’s default (a Text’s default fill, #38bdf8, is merged into every Text) is not the engineer’s choice and does not count as an own colour, even when that exact colour was picked by hand, so a text style’s colour shows on such a Text. The Studio and the operator runtime resolve it the same way. A gradient as a Text’s fill is always drawn as the object’s own.
The project’s styles, fonts and languages are three parts of one document, the project styles (/api/dev/styles), saved with a revision so two engineers never overwrite each other. Translations and font files are stored beside it.
Why one resolver
Section titled “Why one resolver”Before, each of dozens of object types drew its own text and colours. Every new feature (a language switch, a disabled look, a project font) would have meant changing every one of them, and some would have been missed. With one resolver:
- New object types get it for free. An object registered from its own file uses the same text hook and gets languages, text styles and states without code of its own.
- Changes apply live. A language switch, a style save or a font that finishes loading redraws the texts of every open screen without a reload.
- Old screens look the same. A screen that names no text style, no state style and no key is drawn exactly as before; this was checked by comparing the drawn scenes of existing screens before and after.
What a state may and may not do
Section titled “What a state may and may not do”A state style changes colours, opacity, a hatched pattern, the cursor, the text style and the tooltip. It never decides whether the object works. The condition engine, the user’s rights and the server decide that; the resolver only reads what they recorded (the interlock and its condition, the role required, the quality) to pick the state and write the tooltip. This is why the “why disabled” tooltip can name the exact interlock: it shows the record of the engine that disabled the object.
A font is loaded only when a screen uses it, and the text is drawn again when it arrives, so a slow network never leaves a box where a glyph should be. Each family is followed by a chain of fallbacks that ends in the system fonts, so a character missing from the chosen font is drawn by the next one. A font installed only on the engineering PC is flagged as not portable (font-not-portable), because operators’ panels would draw it with a different font.
Editions
Section titled “Editions”States, fonts and languages are in every edition, without a limit on the number of languages. Drafting translations with the AI assistant needs the assistant (Pro and Enterprise).