Wrapping Text


You wrap text on a String meter by using the W and H options along with the ClipString option.

ClipString controls how strings are truncated (clipped) or wrapped to fit in or expand the containing meter. If ClipString is set to 0 or not used (default), then the String meter will just expand in width to contain the entire string on one line.

Example:

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[MeasureSomeString]
Measure=Time
Format=This is a long line of text used to demonstrate wrapping in a string meter.
UpdateDivider=-1

[MeterString1]
Meter=STRING
MeasureName=MeasureSomeString
W=160
H=18
X=0
Y=0
FontSize=11
FontFace=Tahoma
FontColor=255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
ClipString=1

[MeterString2]
Meter=STRING
MeasureName=MeasureSomeString
W=160
H=70
X=0
Y=5R
FontSize=11
FontFace=Tahoma
FontColor=255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
ClipString=1

[MeterString3]
Meter=STRING
MeasureName=MeasureSomeString
W=160
H=35
X=0
Y=5R
FontSize=11
FontFace=Tahoma
FontColor=255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
ClipString=1

[MeterString4]
Meter=STRING
MeasureName=MeasureSomeString
W=160
X=0
Y=5R
FontSize=11
FontFace=Tahoma
FontColor=255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
ClipString=2

MeterString1: If ClipString=1 is used, then the W (width) setting is followed, and the string will be truncated or "clipped" at the width defined in W. An ellipse, or ... will be added to the end of the string to indicate clipping has taken place.

MeterString2: If ClipString=1 is used, wrapping will take place if the H (height) setting is large enough to hold more than one line of text at your current FontSize setting. The string will wrap on as many lines as the H setting allows, in this example the entire string will fit in the width and height defined.

MeterString3: If ClipString=1 is used and the H setting is not large enough to contain the entire string, the text will wrap on as many lines as he H supports, and then will clip with the ... ellipse.

MeterString4: If ClipString=2 is used and W is defined, then the meter will expand in height automatically, to allow the entire string to display while wrapping to follow the defined width.

If ClipString=2 is used and H is defined, then the meter will expand in width automatically, to allow the entire string to display while wrapping to follow the defined height.

ClipStringW and ClipStringH can be used to define maximum values for width or height. If it exceeds this boundary, the string will be clipped with the ... ellipse.

Both W and H are required when ClipString=1 is used. At least one of either W/ClipStringW or H/ClipStringH is required when ClipString=2 is used.

Note: The Padding option used to format the display of the backgrounds for the meters in the example above is added after all clipping or wrapping is determined, and has no impact on ClipString functionality, which is based on the original W and H settings on the meter.