fontconfig_actor/src/protocol.nim

19 lines
485 B
Nim
Raw Normal View History

2023-03-27 03:37:38 +00:00
import
std/typetraits, preserves, std/tables
type
Serve* {.preservesRecord: "serve".} = object
`cap`* {.preservesEmbedded.}: Preserve[void]
FontAssertion* {.preservesRecord: "fontconfig".} = object
2023-03-29 22:53:37 +00:00
`pattern`*: Properties
`attributes`*: Properties
2023-03-27 03:37:38 +00:00
2023-03-29 22:53:37 +00:00
Properties* = Table[Symbol, Preserve[void]]
proc `$`*(x: Serve | FontAssertion | Properties): string =
2023-03-27 03:37:38 +00:00
`$`(toPreserve(x))
2023-03-29 22:53:37 +00:00
proc encode*(x: Serve | FontAssertion | Properties): seq[byte] =
2023-03-27 03:37:38 +00:00
encode(toPreserve(x))