mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-08 16:48:18 +00:00
wasm: support vendor:stb/truetype and vendor:fontstash
This commit is contained in:
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
//+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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user