j
This commit is contained in:
parent
5b65c4c0e4
commit
985aa16236
13 changed files with 1381 additions and 241 deletions
|
|
@ -617,6 +617,31 @@ gpu_create_font_atlas :: proc(gpu: ^GPU_Renderer) -> bool {
|
|||
}
|
||||
|
||||
gpu_read_font_file :: proc() -> (bytes: []u8, path: string, owned: bool) {
|
||||
env_font := os.get_env("NATIVE_EDITOR_FONT", context.temp_allocator)
|
||||
if len(env_font) > 0 {
|
||||
data, err := os.read_entire_file(env_font, context.allocator)
|
||||
if err == nil && len(data) > 0 {
|
||||
return data, env_font, true
|
||||
}
|
||||
if err == nil {
|
||||
delete(data)
|
||||
}
|
||||
fmt.println("configured font could not be loaded:", env_font)
|
||||
}
|
||||
|
||||
settings := editor_settings_load()
|
||||
defer editor_settings_destroy(&settings)
|
||||
if len(settings.font_path) > 0 {
|
||||
data, err := os.read_entire_file(settings.font_path, context.allocator)
|
||||
if err == nil && len(data) > 0 {
|
||||
return data, settings.font_path, true
|
||||
}
|
||||
if err == nil {
|
||||
delete(data)
|
||||
}
|
||||
fmt.println("settings font could not be loaded:", settings.font_path)
|
||||
}
|
||||
|
||||
for override_path in GPU_FONT_OVERRIDE_PATHS {
|
||||
data, err := os.read_entire_file(override_path, context.allocator)
|
||||
if err == nil && len(data) > 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue