HexText

From Second Life Wiki
Revision as of 13:00, 4 October 2020 by Hexadeci Mole (talk | contribs)
Jump to navigation Jump to search

About

HexText is an LSL script to display Unicode text on 8 faced prims within Second Life. Supported is included for Japanese/Chinese, as well as many other languages and symbols. It is not all-inclusive There are some code pages that are missing. It does cover the majority of characters that avatars use in Unicode enhanced display names. Emojis that are outside of the first 256 Unicode code pages, are not included.

There are two display scripts. One is optimized for general usage, the other is optimized for Japanese/Chinese.

The primary font used is Google's Noto Monospace (Bold & Regular), supplemented with other open source or public domain fonts for code pages not covered by Noto.

The character set is broken up into individual textures for each supported Unicode code page, each texture a 16 x 16 matrix of characters. To minimize texture memory usage, the majority of textures are rendered at 512 x 256 pixels (Kanji is rendered at 512 x 384 which gets reduced to 512 x 256 at upload.)

Acknowledgments

HexText uses a subset of the FURWARE_text/Reference command set. HexText does not support virtual text boxes or touch queries.

The HexText texture set was created with FURWARE_text/TextureCreator.

HexText can use displays set up by the FURWARE_text#Texture_creator, however it can only use the 8 faced prim displays. HexText uses display prims with the same description format used by FURWARE. HexText only supports a single display set per linkset, unlike FURWARE that can handle multiple displays per linkset.

Use of both HexText and the FURWARE scripts in the same linkset is not recommended.

Supported commands

Commands

fw_data

llMessageLinked(LINK_SET, 0, "Some text to draw.",   "fw_data");

fw_direct

This command is not supported by FURWARE. It is unique to HexText to display text at specific display coordinates. It does not erase the display when called, instead, it overwrites existing characters in the display.

llMessageLinked(LINK_SET, 0, "Some text to draw.",   "fw_direct:10:2");

Display the string "Some text to draw." starting at the 10th column, 2nd row (both start at 0.)

fw_conf & fw_defaultconf

Sets global style preferences. Unlike FURWARE, fw_conf is treated the same as fw_default_conf.

llMessageLinked(LINK_SET, 0, "c=red; a=center", "fw_defaultconf");
llMessageLinked(LINK_SET, 0, "c=red; a=center", "fw_conf");

The three variants set the global style preferences for all boxes, all root-boxes and all non-root boxes.

fw_notify

Enable or disable link message notifications when the script has done rendering. Off by default.

llMessageLinked(LINK_SET, 0, "on", "fw_notify");
llMessageLinked(LINK_SET, 0, "off", "fw_notify");

When notifications are enabled, the text script will send a link message with "id" set to "fw_done" to the whole linkset to let you know when all pending rendering actions have been completed.

fw_memory

Tells the owner how much memory is available.

llMessageLinked(LINK_SET, 0, "", "fw_memory");

fw_reset

Performs a full reset on the text script.

llMessageLinked(LINK_SET, 0, "", "fw_reset");

Style settings

Text styles and format settings are specified using special strings. They are used for global settings ("fw_conf").

A single setting is given as a key=value pair, for example c=red.

Multiple settings are separated by ";", for example c=red; a=center; w=none.

In the following table: Italic = Default

Setting Key Values Description
Font color c R,G,B Font color as red, green, blue (each in range 0.0-1.0)
R,G,B,A Font color as red, green, blue, alpha (each in range 0.0-1.0)
rand Random color (with alpha = 1)
(predefined) Predefined color, see table below (default is White)
Alignment a left Alignment left
center Alignment centered
right Alignment right
Wrapping w word Wrap after words, if possible
char Wrap at any position
none No wrapping; cuts overlong lines
Trimming t on Trims whitespace from beginning and end of lines
off Keeps whitespace (except with wrap=word)
Force refresh force on Enables forced refresh of all faces (disables optimizations!)
off Disables forced refresh of all faces (enables optimizations)

Predefined colors

You may use the following names in place of color vectors in styles.


FURWARE text colors.png