Merge branch 'master' of ssh://melanie@opensimulator.org/var/git/opensim
commit
9e6684661a
|
@ -51,6 +51,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
|||
private Scene m_scene;
|
||||
private IDynamicTextureManager m_textureManager;
|
||||
private Graphics m_graph;
|
||||
private string m_fontName = "Arial";
|
||||
|
||||
public VectorRenderModule()
|
||||
{
|
||||
|
@ -123,6 +124,13 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
|||
Bitmap bitmap = new Bitmap(1024, 1024, PixelFormat.Format32bppArgb);
|
||||
m_graph = Graphics.FromImage(bitmap);
|
||||
}
|
||||
|
||||
IConfig cfg = config.Configs["VectorRender"];
|
||||
if (null != cfg)
|
||||
{
|
||||
m_fontName = cfg.GetString("font_name", m_fontName);
|
||||
}
|
||||
m_log.DebugFormat("[VECTORRENDERMODULE]: using font \"{0}\" for text rendering.", m_fontName);
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
|
@ -397,7 +405,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
|||
Point startPoint = new Point(0, 0);
|
||||
Point endPoint = new Point(0, 0);
|
||||
Pen drawPen = new Pen(Color.Black, 7);
|
||||
string fontName = "Arial";
|
||||
string fontName = m_fontName;
|
||||
float fontSize = 14;
|
||||
Font myFont = new Font(fontName, fontSize);
|
||||
SolidBrush myBrush = new SolidBrush(Color.Black);
|
||||
|
@ -449,8 +457,10 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
|||
}
|
||||
else
|
||||
{
|
||||
graph.DrawString("URL couldn't be resolved or is", new Font("Arial",6), myBrush, startPoint);
|
||||
graph.DrawString("not an image. Please check URL.", new Font("Arial", 6), myBrush, new Point(startPoint.X, 12 + startPoint.Y));
|
||||
graph.DrawString("URL couldn't be resolved or is", new Font(m_fontName,6),
|
||||
myBrush, startPoint);
|
||||
graph.DrawString("not an image. Please check URL.", new Font(m_fontName, 6),
|
||||
myBrush, new Point(startPoint.X, 12 + startPoint.Y));
|
||||
graph.DrawRectangle(drawPen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y);
|
||||
}
|
||||
startPoint.X += endPoint.X;
|
||||
|
|
|
@ -20,8 +20,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
get { return null; }
|
||||
}
|
||||
|
||||
public Type ReplacableInterface { get { return null; } }
|
||||
|
||||
private Dictionary<UUID, RegionConnections> m_regions = new Dictionary<UUID, RegionConnections>();
|
||||
private bool enabledYN = false;
|
||||
public void Initialise(IConfigSource source)
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
|||
/// has registered the interface by then, this module will be
|
||||
/// activated, else it will remain inactive, letting the other module
|
||||
/// take over. This should return non-null ONLY in modules that are
|
||||
/// intended to be easily replacable, e.g. stub implementations
|
||||
/// intended to be easily replaceable, e.g. stub implementations
|
||||
/// that the developer expects to be replaced by third party provided
|
||||
/// modules.
|
||||
/// </summary>
|
||||
|
|
|
@ -880,6 +880,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
return drawList;
|
||||
}
|
||||
|
||||
public string osSetFontName(string drawList, string fontName)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osSetFontName");
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
drawList += "FontName "+ fontName +"; ";
|
||||
return drawList;
|
||||
}
|
||||
|
||||
public string osSetPenSize(string drawList, int penSize)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.None, "osSetPenSize");
|
||||
|
|
|
@ -99,6 +99,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
|||
string osDrawFilledRectangle(string drawList, int width, int height);
|
||||
string osDrawPolygon(string drawList, LSL_List x, LSL_List y);
|
||||
string osDrawFilledPolygon(string drawList, LSL_List x, LSL_List y);
|
||||
string osSetFontName(string drawList, string fontName);
|
||||
string osSetFontSize(string drawList, int fontSize);
|
||||
string osSetPenSize(string drawList, int penSize);
|
||||
string osSetPenColour(string drawList, string colour);
|
||||
|
|
|
@ -282,6 +282,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
|||
return m_OSSL_Functions.osSetFontSize(drawList, fontSize);
|
||||
}
|
||||
|
||||
public string osSetFontName(string drawList, string fontName)
|
||||
{
|
||||
return m_OSSL_Functions.osSetFontName(drawList, fontName);
|
||||
}
|
||||
|
||||
public string osSetPenSize(string drawList, int penSize)
|
||||
{
|
||||
return m_OSSL_Functions.osSetPenSize(drawList, penSize);
|
||||
|
|
|
@ -761,6 +761,10 @@
|
|||
; Density of tree population
|
||||
tree_density = 1000.0
|
||||
|
||||
[VectorRender]
|
||||
|
||||
; the font to use for rendering text (default: Arial)
|
||||
; font_name = "Arial"
|
||||
|
||||
[ScriptEngine.DotNetEngine]
|
||||
Enabled = true
|
||||
|
|
Loading…
Reference in New Issue