aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Scripting/VectorRender
diff options
context:
space:
mode:
authordr scofield (aka dirk husemann)2009-08-31 09:28:56 +0200
committerdr scofield (aka dirk husemann)2009-08-31 10:30:10 +0200
commit953581698d2fade30ed76cdae3f8c3a0031b35fb (patch)
tree75154a48797a15df0749a57eb3aea196678b569f /OpenSim/Region/CoreModules/Scripting/VectorRender
parentRemove typo version of ReplaceableInterface property from RegionCombinerModule. (diff)
downloadopensim-SC_OLD-953581698d2fade30ed76cdae3f8c3a0031b35fb.zip
opensim-SC_OLD-953581698d2fade30ed76cdae3f8c3a0031b35fb.tar.gz
opensim-SC_OLD-953581698d2fade30ed76cdae3f8c3a0031b35fb.tar.bz2
opensim-SC_OLD-953581698d2fade30ed76cdae3f8c3a0031b35fb.tar.xz
- making font name used by VectorRenderModule configurable: can be set
via [VectorRender] font_name = "Comic Sans MS" in OpenSim.ini - adding osSetFontName OSSL function
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting/VectorRender')
-rw-r--r--OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs15
1 files changed, 12 insertions, 3 deletions
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
51 private Scene m_scene; 51 private Scene m_scene;
52 private IDynamicTextureManager m_textureManager; 52 private IDynamicTextureManager m_textureManager;
53 private Graphics m_graph; 53 private Graphics m_graph;
54 private string m_fontName = "Arial";
54 55
55 public VectorRenderModule() 56 public VectorRenderModule()
56 { 57 {
@@ -123,6 +124,12 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
123 Bitmap bitmap = new Bitmap(1024, 1024, PixelFormat.Format32bppArgb); 124 Bitmap bitmap = new Bitmap(1024, 1024, PixelFormat.Format32bppArgb);
124 m_graph = Graphics.FromImage(bitmap); 125 m_graph = Graphics.FromImage(bitmap);
125 } 126 }
127
128 IConfig cfg = config.Configs["VectorRender"];
129 if (null != cfg)
130 {
131 m_fontName = cfg.GetString("font_name", m_fontName);
132 }
126 } 133 }
127 134
128 public void PostInitialise() 135 public void PostInitialise()
@@ -397,7 +404,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
397 Point startPoint = new Point(0, 0); 404 Point startPoint = new Point(0, 0);
398 Point endPoint = new Point(0, 0); 405 Point endPoint = new Point(0, 0);
399 Pen drawPen = new Pen(Color.Black, 7); 406 Pen drawPen = new Pen(Color.Black, 7);
400 string fontName = "Arial"; 407 string fontName = m_fontName;
401 float fontSize = 14; 408 float fontSize = 14;
402 Font myFont = new Font(fontName, fontSize); 409 Font myFont = new Font(fontName, fontSize);
403 SolidBrush myBrush = new SolidBrush(Color.Black); 410 SolidBrush myBrush = new SolidBrush(Color.Black);
@@ -449,8 +456,10 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
449 } 456 }
450 else 457 else
451 { 458 {
452 graph.DrawString("URL couldn't be resolved or is", new Font("Arial",6), myBrush, startPoint); 459 graph.DrawString("URL couldn't be resolved or is", new Font(m_fontName,6),
453 graph.DrawString("not an image. Please check URL.", new Font("Arial", 6), myBrush, new Point(startPoint.X, 12 + startPoint.Y)); 460 myBrush, startPoint);
461 graph.DrawString("not an image. Please check URL.", new Font(m_fontName, 6),
462 myBrush, new Point(startPoint.X, 12 + startPoint.Y));
454 graph.DrawRectangle(drawPen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y); 463 graph.DrawRectangle(drawPen, startPoint.X, startPoint.Y, endPoint.X, endPoint.Y);
455 } 464 }
456 startPoint.X += endPoint.X; 465 startPoint.X += endPoint.X;