Font


Node Information
Font.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Value OUT Font MULTIPLE FALSE FALSE
Family IN String ONE FALSE FALSE
Size IN Single ONE FALSE FALSE
Style IN FontStyle ONE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.Variables
{
    [IsNode("Font")]
    public class VarFont : Node
    {
        Port font = new Port(PortType.OUT, typeof(System.Drawing.Font), AcceptsLinks.MULTIPLE, "Value");
        Port fontfamily = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "Family");
        Port fontsize = new Port(PortType.IN, typeof(float), AcceptsLinks.ONE, "Size");
        Port fontstyle = new Port(PortType.IN, typeof(System.Drawing.FontStyle), AcceptsLinks.ONE, "Style");
        public string FontFamily
        {
            set { fontfamily.Value = value; }
            get { return GetRuntimeValue(fontfamily); }
        }
        public float FontSize
        {
            set { fontsize.Value = value.ToString(); }
            get { return GetRuntimeValue(fontsize); }
        }
        public System.Drawing.FontStyle FontStyle
        {
            set { fontstyle.Value = value.ToString(); }
            get { return (System.Drawing.FontStyle)Enum.Parse(typeof(System.Drawing.FontStyle), fontstyle.Value); }
        }
        public VarFont()
        {
            NodeType = KGraph.NodeType.Variable;
            ReturnType = typeof(System.Drawing.Font);
            fontstyle.DataType = typeof(System.Drawing.FontStyle);
            FontFamily = "Arial";
            FontSize = 12f;
            FontStyle = System.Drawing.FontStyle.Regular;
            Name = "Font";
            AddPort(font);
            AddPort(fontfamily);
            AddPort(fontsize);
            AddPort(fontstyle);
            Information = "Font.";
        }
        public override string Code()
        {
            return "new System.Drawing.Font(@" + q + FontFamily + q + ", " + FontSize + "f, " + "FontStyle." + FontStyle.ToString() + ")";
        }
    }
}