Fixed a bug in text object
Adding nunito font Working to be able to change the default font
This commit is contained in:
parent
521a9437d4
commit
bfd5a02edf
9 changed files with 42 additions and 3 deletions
|
|
@ -42,11 +42,13 @@ using MatterHackers.VectorMath;
|
|||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using MatterHackers.PolygonMesh;
|
||||
|
||||
namespace MatterHackers.MatterControl.DesignTools
|
||||
{
|
||||
[HideChildrenFromTreeView]
|
||||
public class TextObject3D : PrimitiveObject3D
|
||||
public class TextObject3D : Object3D
|
||||
{
|
||||
public TextObject3D()
|
||||
{
|
||||
|
|
@ -54,6 +56,23 @@ namespace MatterHackers.MatterControl.DesignTools
|
|||
Color = Operations.Object3DExtensions.PrimitiveColors["Text"];
|
||||
}
|
||||
|
||||
public override Mesh Mesh
|
||||
{
|
||||
get
|
||||
{
|
||||
// if all of our children (the characters) don't have a mesh, rebuild
|
||||
if (!this.Children.Where(c => c.Mesh != null).Any()
|
||||
&& !RebuildLocked)
|
||||
{
|
||||
this.Invalidate(InvalidateType.Properties);
|
||||
}
|
||||
|
||||
return base.Mesh;
|
||||
}
|
||||
|
||||
set => base.Mesh = value;
|
||||
}
|
||||
|
||||
public static async Task<TextObject3D> Create()
|
||||
{
|
||||
var item = new TextObject3D();
|
||||
|
|
@ -95,10 +114,12 @@ namespace MatterHackers.MatterControl.DesignTools
|
|||
|
||||
private string MapIfSymbol(string newName)
|
||||
{
|
||||
switch(newName)
|
||||
switch (newName)
|
||||
{
|
||||
case " ":
|
||||
return "space";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return newName;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue