From: Christopher Yeoh <yeohc@au1.ibm.com>

The attached patch implements osGetDrawStringSize that looks like:

vector osGetDrawStringSize(string contentType, string text, string
fontName, int fontSize)

in LSL. It is meant to be used in conjunction with the osDraw*
functions. It returns accurate information on the size that a given
string will be rendered given the specified font and font size.
This allows for nicely formatted and positioned text on the generated
image.
This commit is contained in:
Sean Dague
2009-02-18 12:56:36 +00:00
parent 8d23d97084
commit 383f8b3ac6
7 changed files with 62 additions and 0 deletions

View File

@@ -143,6 +143,18 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
return UUID.Zero;
}
public void GetDrawStringSize(string contentType, string text, string fontName, int fontSize,
out double xSize, out double ySize)
{
xSize = 0;
ySize = 0;
if (RenderPlugins.ContainsKey(contentType))
{
RenderPlugins[contentType].GetDrawStringSize(text, fontName, fontSize, out xSize, out ySize);
}
}
#endregion
#region IRegionModule Members