Special text markup

The LedSign->setText($text) function accepts some powerful special markup in its $text parameter. Special markup is used for controlling font styles, adding multiple frames, setting transitions and inserting dynamic text, such as the current date.

Special markup is always enclosed within curly brackets {}.

Time & Date

{%m/%d/%C} 09/21/08
{%d/%m/%C} 21/09/08
{%m-%d-%C} 09-21-08
{%d-%m-%C} 21-09-08
{%m.%d.%C} 09-21-08
{%C} Year in two-digit-notation. Example: 08
{%C} Year in four-digit-notation. Example: 2008
{%m} Month as number. (01-12)
{%b} Abbreviated month name. Example: Sep.
{%d} Day of month. (01-31)
{%u} Weekday as decimal. (1-7)
{%a} Abbreviated weekday. Example: Mon.
{%H} Hour of day. (00-23)
{%M} Minute of hour. (00-59)
{%S} Second of minute. (00-59)
{%R} Time in 24 hour notation. Example: 16:25.
{%r} Time in am/pm notation. Example: 4:25 pm.

Time & Date example

<?
 
require_once('LedSign.php');
$ledSign = new LedSign('192.168.0.106');
// shows the text "Today is 09/25/2008" on the sign
$ledSign->setText('Today is %m/%d/%C')
 
?>

Font styles

{f1} Set font size to
{f2} Set font size to
{f3} Set font size to
{f4} Set font size to
{green} Set font color to green
{red} Set font color to red
{amber} Set font color to amber (orange)
{f4} Set font color to mixed1
{f4} Set font color to mixed2
{f4} Set font color to mixed3

Font styles example

<?
 
require_once('LedSign.php');
$ledSign = new LedSign('192.168.0.106');
 
// shows text "I love sushi" with the text "love" 
// being red and other text being green
$ledSign->setText('{green}I {red}love {green} sushi');
 
?>

Lines and frames

{nl} New line
{nf} New frame
{pt} Pause for t seconds. Can be between 1-59.
{nf} New frame

Lines and frames example

<?
 
require_once('LedSign.php');
$ledSign = new LedSign('192.168.0.106');
 
// shows the text "Hello", waits for 5 seconds and then shows 
// the text "World". Then waits for 3 seconds and shows the text
// "Hello" again.
$ledSign->setText('Hello{p5}{nf}World{p3}');
 
?>
<?
 
require_once('LedSign.php');
$ledSign = new LedSign('192.168.0.106');
 
// Shows the texts "Hello" and "World on two separate lines
// on a led sign that supports multiple lines. 
$ledSign->setText('Hello{nl}World');
 
?>

Transitions

{transitionNameIn} Set transition transitionName as the IN transition starting from current frame.
{transitionNameOut} Set transition transitionName as the OUT transition starting from current frame.

The following transition names are valid:

random, jumpOut, moveLeft, moveRight, scrollLeft, scrollRight, moveUp, moveDown, scrollToLR, scrollUp, scrollDown, foldFromLR, foldFromUD, scrollToUD, shuttleFromLR, shuttleFromUD, peelOffL, peelOffR, shutterFromUD, shutterFromLR, raindrops, randomMosaic, twinklingStars, hipHop, radarScan, fanOut, fanIn, spiralR, spiralL, toFourCorners, fromFourCorners, toFourSides, fromFourSides, scrollOutFromFourBlocks, scrollInToFourBlocks, moveOutFromFourBlocks, moveInToFourBlocks, scrollFromUpperLeftSquare, scrollFromUpperRightSquare, scrollFromLowerLeftSquare, scrollFromLowerRightSquare, scrollFromUpperLeftSlanting, scrollFromUpperRightSlanting, scrollFromLowerLeftSlanting, scrollFromLowerRightSlanting, moveInFromUpperLeftCorner, moveInFromUpperRightCorner, moveInFromLowerRightCorner, growingUp

Video showing all transitions:

Transitions example

<?
 
require_once('LedSign.php');
$ledSign = new LedSign('192.168.0.106');
 
// 1. the text "this" appears with a radar scan transition
// 2. the text "this" disappears with a scroll left transition
// 3. the text "is an" appears with a move up transition
// 4. the text "this" disappears with a scroll left transition
// 5. the text "example" appears with a twinkling stars transition
// 6. the text "this" disappears with a random mosaic transition
$text = "This{radarScanIn}{scrollLeftOut}{nf}"
      . "is an{moveUpIn}{nf}"
      . "example{twinklingStarsIn}{randomMosaicOut}"
$ledSign->setText($text);
 
?>


Leave a Reply