bannerBox

The bannerbox macro allows you to add a box with repeating text on it.

It is provided by plugin-annotations, which is part of core-plugins (so it is available by default).

Signature

Javascript
macro('bannerbox', {
  String id='bannerbox',
  String textClassName='text-xs fill-note',
  String boxClassName='stroke-xs stroke-note lashed',
  Point topLeft=new Point(0,0),
  Point bottomRight=new Point(100,100),
  String text='',
  Number margin=15,
  Number dy=4,
  Number repeat=99,
  Number spaces=12,
  Boolean force = false,
})

Example

a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example              a bannerbox example

Configuration

PropertyDefaultTypeDescription
bottomRightnew Point(100,100)PointTop top-left corner of the box
boxClassNamestroke-xs stroke-note lashedstringCSS classes to apply to the box path
dy4numberControls how far the text will be located above the path
idbannerboxstringThe ID of this macro instance
margin15numberControls the margin the box will apply
repeat99numberThe number of text repetitions. See banner macro
spaces12numberThe number of spaces to place between repetitions. See banner macro
textstringThe text to place repeat along the box path
textClassNametext-xs fill-notestringCSS classes to apply to the text
topLeftnew Point(0,0)PointTop top-left corner of the box
forcefalsebooleanSet this to true to display the macro output even when complete is false

Notes

Under the hood, this macro will the banner macro to place the text on the box path.

The banner box will be larger than the box formed by the coordinates provided to the macro, The sides will be offset by approximately 1.4 times the margin.

If the total length of the text (based on text, repeat, and spaces) is less than the length of the box path, the text will simply end, leaving some of the box without text. If the total length of text is greater than the length of the box path, the remaining text will be truncated. For this reason, using a repeat value greater than what is normally needed might be a best practice to ensure that text completely surrounds the bannerbox, even if the pattern is scaled down, allowing more text to fit around the box.

This macro takes the complete setting into account and won’t output anything when both complete and force are false.