prettier format
parent
4f9d7c565a
commit
e691404a57
|
|
@ -1,20 +1,24 @@
|
|||
# This is a *special* directory.
|
||||
# This is a _special_ directory.
|
||||
|
||||
The files in this directory are imported by `../Face.zig` and scanned for pub
|
||||
functions with names matching a specific format, which are then used to handle
|
||||
drawing specified codepoints.
|
||||
|
||||
## IMPORTANT
|
||||
|
||||
When you add a new file here, you need to add the corresponding import in
|
||||
`../Face.zig` for its draw functions to be picked up. I tried dynamically
|
||||
listing these files to do this automatically but it was more pain than it
|
||||
was worth.
|
||||
|
||||
## `draw*` functions
|
||||
|
||||
Any function named `draw<CODEPOINT>` or `draw<MIN>_<MAX>` will be used to
|
||||
draw the codepoint or range of codepoints specified in the name. These are
|
||||
hex-encoded values with upper case letters.
|
||||
|
||||
`draw*` functions are provided with these arguments:
|
||||
|
||||
```zig
|
||||
/// The codepoint being drawn. For single-codepoint draw functions this can
|
||||
/// just be discarded, but it's needed for range draw functions to determine
|
||||
|
|
@ -44,6 +48,7 @@ metrics: font.Metrics,
|
|||
`draw*` functions may only return `DrawFnError!void` (defined in `../Face.zig`).
|
||||
|
||||
## `special.zig`
|
||||
|
||||
The functions in `special.zig` are not for drawing unicode codepoints,
|
||||
rather their names match the enum tag names in the `Sprite` enum from
|
||||
`src/font/sprite.zig`. They are called with the same arguments as the
|
||||
|
|
|
|||
Loading…
Reference in New Issue