Documentation


Alberto Corbi Bellot made a video tutorial in Spanish about how to combine WinFIG and LyX.

He also made another tutorial that introduces Xfig and WinFIG.

The Xfig user manual might be useful for WinFIG users too.

Javad Taghia has written a a short tutorial that you might find useful.

FigSchema.json

Following is JSON schema that describes the data structures of objects that can be used with within JavaScript script files.

{
{
    "RGB": {
        "r": {
            "type": "number",
            "minimum": 0,
            "maximum": 255
        },
        "g": {
            "type": "number",
            "minimum": 0,
            "maximum": 255
        },
        "b": {
            "type": "number",
            "minimum": 0,
            "maximum": 255
        }
    },
    "Color": {
        "index": {
            "type": "number",
            "minimum": 0,
            "maximum": 31
        },
        "rgb": {
            "type": "RGB"
        }
    },
    "Colors": {
        "type": "object",
        "properties": {
            "penColor": {
                "type": "number",
                "minimum": 0,
                "maximum": 31
            },
            "fillColor": {
                "type": "number",
                "minimum": -1,
                "maximum": 31
            },
            "fillShade": {
                "type": "number",
                "minimum": -1,
                "maximum": 41
            },
            "fillPattern": {
                "type": "number",
                "minimum": 0,
                "maximum": 21
            }
        }
    },
    "Pen": {
        "type": "object",
        "properties": {
            "width": {
                "type": "number"
            },
            "lineStyle": {
            	"description": "solid, dashed, dotted, dashdot, dash2dots, dash3dots",
                "type": "string"
            },
            "dashValue": {
                "type": "number"
            },
            "capStyle": {
                "type": "string"
            },
            "joinStyle": {
                "type": "string"
            },
            "colors": {
                "type": "Colors"
            }
        }
    },
    "Point": {
        "type": "object",
        "properties": {
            "x": {
                "type": "number"
            },
            "y": {
                "type": "number"
            }
        }
    },
    "Arrow": {
        "type": "object",
        "properties": {
            "type": {
                "type": "number"
            },
            "thickness": {
                "type": "number"
            },
            "width": {
                "type": "number"
            },
            "height": {
                "type": "number"
            }
        }
    },
    "Arc": {
        "type": "object",
        "properties": {
            "pen": {
                "type": "Pen"
            },
            "depth": {
                "type": "number"
            },
            "comment": {
                "type": "string"
            },
            "p1": {
                "type": "Point"
            },
            "p2": {
                "type": "Point"
            },
            "p3": {
                "type": "Point"
            },
            "type": {
                "type": "string"
            },
            "backwardArrow": {
                "type": "Arrow"
            },
            "forwardArrow": {
                "type": "Arrow"
            }
        }
    },
    "Line": {
        "type": "object",
        "properties": {
            "pen": {
                "type": "Pen"
            },
            "depth": {
                "type": "number"
            },
            "comment": {
                "type": "string"
            },
            "backwardArrow": {
                "type": "Arrow"
            },
            "forwardArrow": {
                "type": "Arrow"
            },
            "closed": {
                "type": "boolean"
            },
            "points": {
                "type": "array",
                "items": {
                    "type": "Point"
                }
            }
        }
    },
    "Spline": {
        "type": "object",
        "properties": {
            "pen": {
                "type": "Pen"
            },
            "depth": {
                "type": "number"
            },
            "comment": {
                "type": "string"
            },
            "backwardArrow": {
                "type": "Arrow"
            },
            "forwardArrow": {
                "type": "Arrow"
            },
            "type": {
                "type": "string",
                "pattern": "interpolated|interp|approximated|approx"
            },
            "closed": {
                "type": "boolean"
            },
            "points": {
                "type": "array",
                "items": {
                    "type": "Point"
                }
            }
        }
    },
    "Rectangle": {
        "type": "object",
        "properties": {
            "pen": {
                "type": "Pen"
            },
            "depth": {
                "type": "number"
            },
            "comment": {
                "type": "string"
            },
            "cornerType": {
                "type": "string"
            },
            "cornerRadius": {
                "type": "number"
            },
            "p1": {
                "type": "Point"
            },
            "p2": {
                "type": "Point"
            }
        }
    },
    "Picture": {
        "type": "object",
        "properties": {
            "fileName": {
                "type": "number"
            },
            "depth": {
                "type": "number"
            },
            "comment": {
                "type": "string"
            },
            "useOriginalRatio": {
                "type": "boolean"
            },
            "scale": {
                "type": "number"
            },
            "p1": {
                "type": "Point"
            },
            "p2": {
                "type": "Point"
            },
            "angle": {
                "type": "number"
            }
        }
    },
    "RegPolygon": {
        "type": "object",
        "properties": {
            "pen": {
                "type": "Pen"
            },
            "depth": {
                "type": "number"
            },
            "comment": {
                "type": "string"
            },
            "center": {
                "type": "Point"
            },
            "radius": {
                "type": "number"
            },
            "angle": {
                "type": "number"
            },
            "sides": {
                "type": "number",
                "minimum": 3
            }
        }
    },
    "Circle": {
        "type": "object",
        "properties": {
            "pen": {
                "type": "Pen"
            },
            "depth": {
                "type": "number"
            },
            "comment": {
                "type": "string"
            },
            "center": {
                "type": "Point"
            },
            "radius": {
                "type": "number"
            }
        }
    },
    "Ellipse": {
        "type": "object",
        "properties": {
            "pen": {
                "type": "Pen"
            },
            "depth": {
                "type": "number"
            },
            "comment": {
                "type": "string"
            },
            "center": {
                "type": "Point"
            },
            "radiusx": {
                "type": "number"
            },
            "radiusy": {
                "type": "number"
            },
            "angle": {
                "type": "number"
            }
        }
    },
    "Text": {
        "type": "object",
        "properties": {
            "pen": {
                "type": "Pen"
            },
            "depth": {
                "type": "number"
            },
            "comment": {
                "type": "string"
            },
            "base": {
                "type": "Point"
            },
            "font": {
                "type": "string"
            },
            "fontSize": {
                "type": "number"
            },
            "angle": {
                "type": "number"
            },
            "alignment": {
                "type": "string"
            },
            "text": {
                "type": "string"
            },
            "rigid": {
                "type": "boolean"
            },
            "latex": {
                "type": "boolean"
            }
        }
    },
    "Compound": {
        "type": "object",
        "properties": {
            "comment": {
                "type": "string"
            },
            "arcs": {
                "type": "array",
                "items": {
                    "type": "Arc"
                }
            },
            "lines": {
                "type": "array",
                "items": {
                    "type": "Line"
                }
            },
            "splines": {
                "type": "array",
                "items": {
                    "type": "Spline"
                }
            },
            "rectangles": {
                "type": "array",
                "items": {
                    "type": "Rectangle"
                }
            },
            "pictures": {
                "type": "array",
                "items": {
                    "type": "Picture"
                }
            },
            "regPolygons": {
                "type": "array",
                "items": {
                    "type": "RegPolygon"
                }
            },
            "circles": {
                "type": "array",
                "items": {
                    "type": "Circle"
                }
            },
            "ellipses": {
                "type": "array",
                "items": {
                    "type": "Ellipse"
                }
            },
            "texts": {
                "type": "array",
                "items": {
                    "type": "Text"
                }
            },
            "compounds": {
                "type": "array",
                "items": {
                    "type": "Compound"
                }
            }
        }
    }
}

Other Resources