EhhLang Help

Ehhlang Basic Syntax

Introduction

Ehhlang is a domain specific language (DSL) to create images. It is designed to be simple and easy to use. This document will cover the basic syntax of Ehhlang and how to use it.

Basic Syntax

We can learn about basic Ehhlang syntax using the following example

ehh { width: 840 height: 480 background: 0, 0, 0 output: "HelloEhh.png" } text :: HelloEhh { fontScale: 5 thickness: 5 color: 255, 255, 255 position: 100, 100 text: "Hello Ehh!!!" }
  1. Canvas (ehh):

    Canvas is the main block of Ehhlang. It is used to define the canvas properties like width, height, background color, and output file name.

    • width: Width of the canvas

    • height: Height of the canvas

    • background: Background color of the canvas

    • output: Output file name

  2. Objects:

    Objects are the elements that are drawn on the canvas. In the above example, we have used the text object to draw the text on the canvas.

    • fontScale: Font size of the text

    • thickness: Thickness of the text

    • color: Color of the text

    • position: Position of the text

    • text: Text to be drawn

  3. Properties:

    Properties are the attributes of the objects. In the above example, we have used the fontScale, thickness, color, position, and text properties of the text object.

  4. Inheritance (::):

    Inheritance is used to create a new object from an existing object. In the above example, we have used the :: operator to create a new object HelloEhh from the existing object text.

Last modified: 25 February 2024