diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting/VectorRender')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index 6a348a3..c3e39ad 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | |||
@@ -89,6 +89,20 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
89 | return true; | 89 | return true; |
90 | } | 90 | } |
91 | 91 | ||
92 | public void GetDrawStringSize(string text, string fontName, int fontSize, | ||
93 | out double xSize, out double ySize) | ||
94 | { | ||
95 | Bitmap bitmap = new Bitmap(1024, 1024, PixelFormat.Format32bppArgb); | ||
96 | Graphics graph = Graphics.FromImage(bitmap); | ||
97 | |||
98 | Font myFont = new Font(fontName, fontSize); | ||
99 | SizeF stringSize = new SizeF(); | ||
100 | stringSize = graph.MeasureString(text, myFont); | ||
101 | xSize = stringSize.Width; | ||
102 | ySize = stringSize.Height; | ||
103 | } | ||
104 | |||
105 | |||
92 | #endregion | 106 | #endregion |
93 | 107 | ||
94 | #region IRegionModule Members | 108 | #region IRegionModule Members |