| font | required, use font name constant or font file name |
| rotate | optional, set font rotation angle (0~360) |
| transparent | only draw font's foreground pixels |
| fixedwidth | draw proportional font with fixed character width, max character width from the font is used |
| dist | only for 7-seg font, the distance between bars |
| width | only for 7-seg font, the width of the bar |
| outline | only for 7-seg font, draw the outline |
| color | font color, if not given the current foreground color is used |
### lcd.attrib7seg(dist, width, outline, color)
Set characteristics of the 7-segment font
| Argument | Description |
| - | - |
| dist | the distance between bars |
| width | the width of the bar |
| outline | outline color |
| color | fill color |
### lcd.fontSize()
Return width and height of the active font
### lcd.print(text[,x, y, color, rotate, transparent, fixedwidth, wrap])
Display the string *text* at possition (x,y).<br>
If *color* is not given, current foreground color is used.
* **x**: horizontal position of the upper left point in pixels, special values can be given:
* CENTER, centers the text
* RIGHT, right justifies the text
* LASTX, continues from last X position; offset can be used: LASTX+n
* **y**: vertical position of the upper left point in pixels, special values can be given:
* CENTER, centers the text
* BOTTOM, bottom justifies the text
* LASTY, continues from last Y position; offset can be used: LASTY+n
* **text**: string to be displayed. Two special characters are allowed in strings:
*‘\r’ CR (0x0D), clears the display to EOL
*‘\n’ LF (ox0A), continues to the new line, x=0
### lcd.text(x, y, text [, color])
Display the string *text* at possition (x,y).<br>
If *color* is not given, current foreground color is used.
* **x**: horizontal position of the upper left point in pixels, special values can be given:
* CENTER, centers the text
* RIGHT, right justifies the text
* LASTX, continues from last X position; offset can be used: LASTX+n
* **y**: vertical position of the upper left point in pixels, special values can be given:
* CENTER, centers the text
* BOTTOM, bottom justifies the text
* LASTY, continues from last Y position; offset can be used: LASTY+n
* **text**: string to be displayed. Two special characters are allowed in strings:
*‘\r’ CR (0x0D), clears the display to EOL
*‘\n’ LF (ox0A), continues to the new line, x=0
### lcd.textWidth(text)
Return the width of the string *text* using the active font fontSize
### lcd.textClear(x, y, text [, color])
Clear the the screen area used by string *text* at possition (x,y) using the bacckground color *color*.<br>
If *color* is not given, current background color is used.
### lcd.image(x, y, file [,scale, type])
Display the image from the file *file* on position (x,y)
* **JPG** and **BMP** can be displayed.
* Constants **lcd.CENTER**, **lcd.BOTTOM**, **lcd.RIGHT** can be used for x&y
* **x** and **y** values can be negative
**scale** (jpg): image scale factor: 0 to 3; if scale>0, image is scaled by factor 1/(2^scale) (1/2, 1/4 or 1/8)<br>
**scale** (bmp): image scale factor: 0 to 7; if scale>0, image is scaled by factor 1/(scale+1)<br>
**type**: optional, set the image type, constants *lcd.JPG* or *lcd.BMP* can be used. If not set, file extension and/or file content will be used to determine the image type.
### lcd.setwin(x, y, x1, y1)
Set active display window to screen rectangle (x,y) - (x1,y1)
### lcd.resetwin()
Reset active display window to full screen size.
### lcd.savewin()
Save active display window dimensions.
### lcd.restorewin()
Restore active display window dimensions previously saved wint savewin().
### lcd.screensize()
Return the display size, (width, height)
### lcd.winsize()
Return the active display window size, (width, height)
### lcd.hsb2rgb(hue, saturation, brightness)
Converts the components of a color, as specified by the HSB model, to an equivalent set of values for the default RGB model.<br>
Returns 24-bit integer value suitable to be used as color argiment
Arguments
* **hue**: float: any number, the floor of this number is subtracted from it to create a fraction between 0 and 1. This fractional number is then multiplied by 360 to produce the hue angle in the HSB color model.
* **saturation**: float; 0 ~ 1.0
* **brightness**: float; 0 ~ 1.0
### lcd.compileFont(file_name [,debug])
Compile the source font file (must have **.c** extension) to the binary font file (same name, **.fon** extension) which can be used as external font.<br>
If *debug=True* the information about compiled font will be printed.
You can create the **c** source file from any **tft** font using the included [ttf2c_vc2003.exe](https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/tree/master/MicroPython_BUILD/components/micropython/esp32/modules_examples/tft/font_tool/) program.
See [README](https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/tree/master/MicroPython_BUILD/components/micropython/esp32/modules_examples/tft/font_tool/README.md) for instructions.