From bbef5c344eb317aced3139d1353ae9a8826d4e12 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 31 Aug 2009 14:16:16 +0900 Subject: Remove typo version of ReplaceableInterface property from RegionCombinerModule. --- OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs | 2 -- OpenSim/Region/Framework/Interfaces/IRegionModuleBase.cs | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs index 79c9839..a6e3859 100644 --- a/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs @@ -20,8 +20,6 @@ namespace OpenSim.Region.CoreModules.World.Land get { return null; } } - public Type ReplacableInterface { get { return null; } } - private Dictionary m_regions = new Dictionary(); private bool enabledYN = false; public void Initialise(IConfigSource source) diff --git a/OpenSim/Region/Framework/Interfaces/IRegionModuleBase.cs b/OpenSim/Region/Framework/Interfaces/IRegionModuleBase.cs index ff606b1..9b1e4ca 100644 --- a/OpenSim/Region/Framework/Interfaces/IRegionModuleBase.cs +++ b/OpenSim/Region/Framework/Interfaces/IRegionModuleBase.cs @@ -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. /// -- cgit v1.1 From 953581698d2fade30ed76cdae3f8c3a0031b35fb Mon Sep 17 00:00:00 2001 From: dr scofield (aka dirk husemann) Date: Mon, 31 Aug 2009 09:28:56 +0200 Subject: - making font name used by VectorRenderModule configurable: can be set via [VectorRender] font_name = "Comic Sans MS" in OpenSim.ini - adding osSetFontName OSSL function --- .../Scripting/VectorRender/VectorRenderModule.cs | 15 ++++++++++++--- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 9 +++++++++ .../Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 + .../Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 5 +++++ 4 files changed, 27 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index e83b1a8..bf275fa 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs @@ -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,12 @@ 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); + } } public void PostInitialise() @@ -397,7 +404,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 +456,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; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 0de5c9b..bca019b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -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"); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index b129b39..49aa45a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -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); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 45492dd..8f52d99 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -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); -- cgit v1.1 From 86521adb7e58f65215855b1576db117da8bc52f0 Mon Sep 17 00:00:00 2001 From: dr scofield (aka dirk husemann) Date: Mon, 31 Aug 2009 11:35:49 +0200 Subject: adding log message to vector render to inform about default font being used --- OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index bf275fa..50eeb59 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs @@ -130,6 +130,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender { m_fontName = cfg.GetString("font_name", m_fontName); } + m_log.DebugFormat("[VECTORRENDERMODULE]: using font \"{0}\" for text rendering."); } public void PostInitialise() -- cgit v1.1 From 5209305615ae6c2fd30d0c92a92b3085ad143d86 Mon Sep 17 00:00:00 2001 From: dr scofield (aka dirk husemann) Date: Mon, 31 Aug 2009 12:05:14 +0200 Subject: oops. fixing missing argument. --- OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index 50eeb59..bea6222 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs @@ -130,7 +130,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender { m_fontName = cfg.GetString("font_name", m_fontName); } - m_log.DebugFormat("[VECTORRENDERMODULE]: using font \"{0}\" for text rendering."); + m_log.DebugFormat("[VECTORRENDERMODULE]: using font \"{0}\" for text rendering.", m_fontName); } public void PostInitialise() -- cgit v1.1