From WikiChip
Editing mirc/identifiers/$wrap

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 6: Line 6:
  
 
== Synopsis ==
 
== Synopsis ==
<pre>$wrap(text,font,size,width [,b[N]i[N]p[N]t[N]w[N] ],N)</pre>
+
<pre>$wrap(text,font,size,width,bNiNpNtNwN,N)</pre>
  
 
== Parameters ==
 
== Parameters ==
Line 14: Line 14:
 
* '''width''' - The width at which the text should wrap
 
* '''width''' - The width at which the text should wrap
  
Previously, the 5th parameter was an optional 'word' parameter accepting either 0 (disabled) or 1 (enabled) to indicate handling of word wrapping. Though the old syntax is still enabled, it's now a set of options to go with $width and $height:
+
Before, the 4th parameter was only a one true/false value parameter to enable word wrapping, it's now a set of options to go with $width and $height:
  
* '''bNiNpNtN''' - Optional parameter, defines some options for the measurement, N can be 1 or 0 to enable or disable the option, with '1' assumed when 'N' not present:
+
* '''bNiNpNtN''' - Optional, defines some options for the measurement, N can be 1 or 0 to enable or disable the option:
** '''bN''' enables/disables the width used when the bold 'style' is enabled for that font
+
** '''bN''' enables/disables bold
** '''iN''' enables/disables the width used when the italic 'style' is enabled for that font
+
** '''iN''' enables/disables italic
** '''pN''' enables/disables control codes always handled as if zero-width characters
+
** '''pN''' enables/disables control code (-bi not needed there)
** '''tN''' enables/disables tab character 0=zero_width 1=tab-expansion
+
** '''tN''' enables/disables tab character
** '''wN''' enables word wrapping 0=chop 1=entire word on next line
+
** '''wN''' enables word wrapping
 
* '''N''' - The Nth line wrapped, use 0 to get the total number of wrapped line.
 
* '''N''' - The Nth line wrapped, use 0 to get the total number of wrapped line.
 
* Because the switches parameter is optional, it must not be present if no switches are used.
 
 
* The bN and iN settings refer to the 'style' dropdown in the 'select font' dialog, for the fonts who have different for some characters when the 'bold' or 'italic' style is enabled. They do NOT refer to the 'b' and 'i' control codes as used by $strip.
 
 
* Because /echo no longer expands the 'tab' character, the t[N] setting is no longer relevant there, but continues to be used by the /drawtext command.
 
  
 
== Properties ==
 
== Properties ==
Line 55: Line 49:
 
}</source>
 
}</source>
 
Now execute "/picwinchat test this is a very long text ok some more word please ok this is enough to illustrate the example i think maybe not"
 
Now execute "/picwinchat test this is a very long text ok some more word please ok this is enough to illustrate the example i think maybe not"
 
Note: The widths used by the various switch settings are the same ones used by $width, where some characters in some fonts can have different widths depending on whether the font has the 'bold' or 'italic' setting enabled. This example shows the width of the Verdana 'M' differs depending on whether the font is bold or not, or whether the font is italic or not, or whether both bold+italic styles are used.
 
 
<source lang="mIRC">
 
//var %c $asc(M) , %font Verdana | echo -a b1 $width($chr(%c),%font,21,b1) vs b0 $width($chr(%c),%font,21,b0) vs p1 $width($chr(%c),%font,21,p1) vs i1 $width($chr(%c),%font,21,i1) vs i0 $width($chr(%c),%font,21,i0) vs b1i1 $width($chr(%c),%font,21,b1i1)
 
</source>
 
* result: b1 20 vs b0 18 vs p1 18 vs i1 19 vs i0 18 vs b1i1 21
 
 
When changing %c to be the number 2 instead of $asc(M), the result for p1 changes to 0 because codepoint 2 is the control-code for 'bold', and the 'p1' processing of control-codes gives them all a zero width.
 
 
* result: b1 11 vs b0 10 vs p1 0 vs i1 10 vs i0 10 vs b1i1 11
 
  
 
== Compatibility ==
 
== Compatibility ==
Line 73: Line 56:
 
{{mIRC|$width}}
 
{{mIRC|$width}}
 
{{mIRC|$height}}
 
{{mIRC|$height}}
{{mIRC|$strip}}
+
 
 +
[[Category:mIRC identifiers]]

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)