Click or drag to resize

FontTableFindOrCreate Method (String, Boolean, Boolean)

Get a DimensionStyle with the specified characteristics the settings other than face, bold and italic are copied from the current style

Namespace:  Rhino.DocObjects.Tables
Assembly:  RhinoCommon (in RhinoCommon.dll)
Syntax
public int FindOrCreate(
	string face,
	bool bold,
	bool italic
)

Parameters

face
Type: SystemString

[Missing <param name="face"/> documentation for "M:Rhino.DocObjects.Tables.FontTable.FindOrCreate(System.String,System.Boolean,System.Boolean)"]

bold
Type: SystemBoolean

[Missing <param name="bold"/> documentation for "M:Rhino.DocObjects.Tables.FontTable.FindOrCreate(System.String,System.Boolean,System.Boolean)"]

italic
Type: SystemBoolean

[Missing <param name="italic"/> documentation for "M:Rhino.DocObjects.Tables.FontTable.FindOrCreate(System.String,System.Boolean,System.Boolean)"]

Return Value

Type: Int32

[Missing <returns> documentation for "M:Rhino.DocObjects.Tables.FontTable.FindOrCreate(System.String,System.Boolean,System.Boolean)"]

Examples
using Rhino;
using Rhino.Commands;
using Rhino.Geometry;

namespace examples_cs
{
  public class TextJustifyCommand : Command
  {
    public override string EnglishName { get { return "csTextJustify"; } }

    protected override Result RunCommand(RhinoDoc doc, RunMode mode)
    {
      var text_entity = new TextEntity
      {
        Plane = Plane.WorldXY,
        Text = "Hello Rhino!",
        Justification = TextJustification.MiddleCenter,
        FontIndex = doc.Fonts.FindOrCreate("Arial", false, false)
      };

      doc.Objects.AddText(text_entity);
      doc.Views.Redraw();

      return Result.Success;
    }
  }
}
from scriptcontext import doc
from Rhino.Geometry import *

text_entity = TextEntity()
text_entity.Plane = Plane.WorldXY
text_entity.Text = "Hello Rhino!"
text_entity.Justification = TextJustification.MiddleCenter
text_entity.FontIndex = doc.Fonts.FindOrCreate("Arial", False, False)

doc.Objects.AddText(text_entity)
doc.Views.Redraw()
Version Information

Rhino for Mac

Supported in: 5.4

Rhino for Windows

Supported in: 6.5
See Also