mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-27 16:01:47 -07:00
21 lines
302 B
Odin
21 lines
302 B
Odin
#+build !js
|
|
package fontstash
|
|
|
|
import "core:log"
|
|
import "core:os"
|
|
|
|
AddFontPath :: proc(
|
|
ctx: ^FontContext,
|
|
name: string,
|
|
path: string,
|
|
) -> int {
|
|
data, ok := os.read_entire_file(path)
|
|
|
|
if !ok {
|
|
log.panicf("FONT: failed to read font at %s", path)
|
|
}
|
|
|
|
return AddFontMem(ctx, name, data, true)
|
|
}
|
|
|