1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

docs: unify format of notes (#17294)

This commit is contained in:
Makhnev Petr
2023-02-13 12:29:02 +04:00
committed by GitHub
parent e7fcf66095
commit c8c70de87d
24 changed files with 422 additions and 252 deletions

View File

@@ -17,7 +17,10 @@ mut ttf_font := ttf.TTF_File{}
ttf_font.buf = os.read_bytes("arial.ttf") or { panic(err) }
ttf_font.init()
```
*Note: the font must be passed to the `TTF_file` as RAM buffer.*
> **Note**
> The font must be passed to the `TTF_file` as RAM buffer.
At this point the font "arial" is loaded and parsed and if it is a valid TTF font it is
ready for the rendering.
We can get some quick info on the font as string using the `get_info_string` function:
@@ -115,7 +118,9 @@ fn main() {
```
This is the low level render that draw ther text on a bitmap and save the bitmap on a disk as
`.ppm` file.
*Note: The render in this case is a raw rendering without any postfiltering or other processing.*
> **Note**
> The render in this case is a raw rendering without any postfiltering or other processing.
Using the low level rendering you need to manage all the amenities like allocate and release
memory and other tasks like calc the character dimensions.