Class StylistEffect
java.lang.Object
com.github.tommyettinger.textra.Effect
com.github.tommyettinger.textra.effects.StylistEffect
Enables style properties for the single glyph (or affected text, if all is true) underneath the pointer/mouse, and
disables them when not underneath. The style properties this effect controls are things like bold and underline.
There are many situations when you will want "all" mode enabled, such as to underline all of an area affected by
Stylist, or change all of it to oblique instead of just one glyph at a time. Stylist can use the textual syntax:
All of these textual options are case-insensitive and apply to whole words only (separated by whitespace, tab, or comma):
Stylist can instead use the positional syntax:
The textual syntax is preferred now, but the positional syntax was here first. Note that if a semicolon is present at all, this will treat the input as positional.
Positional syntax parameters:
Setting
Example usage:
{STYLIST=bold underline all}
or its abbreviated form:
{STYLIST=b u a}
Or symbolic abbreviated form, matching square-bracket markup where possible:
{STYLIST=* _ a}
It also just so happens that entering {STYLIST}
will enable bold, underline, and 'all' mode.
All of these textual options are case-insensitive and apply to whole words only (separated by whitespace, tab, or comma):
- Bold can be enabled with
bold
,b
, or*
. - Oblique can be enabled with
oblique
,o
,italic
,i
, or/
. - Underline can be enabled with
underline
,u
, or_
. - Strikethrough can be enabled with
strikethrough
,strike
,s
, or~
. - Subscript can be enabled with
subscript
,sub
, or.
. - Midscript can be enabled with
midscript
,mid
, or=
. - Superscript can be enabled with
superscript
,super
, or^
. - Enabling 'all' mode can be done by having
all
ora
in the String.
Stylist can instead use the positional syntax:
{STYLIST=y;n;y;n;0;y}
Which, in order, enables bold (y for yes), does not change oblique (n for no), enables underline, does not change
strikethrough, does not change any of the script options (subscript would be 1, midscript 2, or superscript 3, but
since this is 0 it won't change), and enables "all" mode as the last 'y' (which highlights the whole area using the
effect, instead of just the char being hovered over).
The textual syntax is preferred now, but the positional syntax was here first. Note that if a semicolon is present at all, this will treat the input as positional.
Positional syntax parameters:
bold;oblique;underline;strikethrough;script;all
Setting
bold
to true, y, 1, or some other true-indicating value makes this toggle bold.
Setting oblique
to true, y, 1, or some other true-indicating value makes this toggle oblique.
Setting underline
to true, y, 1, or some other true-indicating value makes this toggle underline.
Setting strikethrough
to true, y, 1, or some other true-indicating value makes this toggle strikethrough.
Setting script
to 0 will have this not affect script mode, 1 will have it enable subscript, 2 will have it
enable midscript, and 3 will have it enable superscript.
The parameter all
makes the whole span of text become affected when true, or individual glyphs be the only
things affected when false.
Example usage:
{STYLIST=italic all}This whole span of text will become oblique/italicized on mouse-over.{ENDSTYLIST}
{STYLIST=bold strike}Individual glyphs will be set to bold and be struck through while moused-over.{ENDSTYLIST}
-
Nested Class Summary
Nested classes/interfaces inherited from class com.github.tommyettinger.textra.Effect
Effect.EffectBuilder
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
onApply
(long glyph, int localIndex, int globalIndex, float delta) Called when this effect should be applied to the given glyph.Methods inherited from class com.github.tommyettinger.textra.Effect
apply, assignTokenName, calculateFadeout, calculateProgress, calculateProgress, calculateProgress, isFinished, paramAsBoolean, paramAsColor, paramAsFloat, update