RCSS FontEffects

From FreeSpace Wiki
Revision as of 18:23, 22 April 2023 by MjnMixael (talk | contribs) (Created page with "{{RCSS}} Font effects are an extension to CSS for RCSS for applying effects, such as outlining or shadowing, to text. Similarly to decorators, font effects are declared and na...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Librocket RCSS references
Syntax and basic data types
Selectors
Box Model
Visual Model
Visual Effects
Colors and backgrounds
Fonts
Text
Cursors, Dragging, and Tabbing
Decorators
Font Effects
Scrollbars and Sliders
Property Index

Font effects are an extension to CSS for RCSS for applying effects, such as outlining or shadowing, to text. Similarly to decorators, font effects are declared and named in a style sheet like a property, and configured with font-effect-specific properties. Custom font effects can be developed to apply arbitrary effects onto text.

Properties

Font effects are declared and configured within style sheets in exactly the same manner as decorators, except they are declared as <name>-font-effect rather that <name>-decorator, including the z-index property to resolve an ambiguous render order. The only exceptions are noted below:

Color

All font effects have a <name>-color property which is applied multiplicatively over the entire effect.

Inheritance

Unlike decorators, font effects are inherited from parent elements. For example, the following declaration:

h1
{
	header-font-effect: outline;
	header-width: 2px;
	header-color: black;
}

will add an outline effect on the text within all h1 elements and their descendants. To prevent inheritance, override the effect with none. For example, to prevent the h1 outline effect from affecting span elements, you could specify the following:

h1 span
{
	header-font-effect: none;
}

Effects

libRocket comes with two built-in font effects:

  • shadow effect, for rendering shadows.
  • outline effect, for outlining text.