From 79fcb7b7dd9ff019297a9f4c9d28afe750ff8e71 Mon Sep 17 00:00:00 2001 From: geerzo Date: Thu, 14 Mar 2024 17:39:19 -0400 Subject: [PATCH] Loads the .ttf files from the same directory as the .kttf file. --- kayak_font/src/ttf/loader.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kayak_font/src/ttf/loader.rs b/kayak_font/src/ttf/loader.rs index 4f2930eb..09720a5b 100644 --- a/kayak_font/src/ttf/loader.rs +++ b/kayak_font/src/ttf/loader.rs @@ -62,12 +62,14 @@ impl AssetLoader for TTFLoader { u32::from_str_radix(kttf.char_range_start.trim_start_matches("0x"), 16).unwrap(); let char_range_end = u32::from_str_radix(kttf.char_range_end.trim_start_matches("0x"), 16).unwrap(); + + let mut cache_path = std::path::PathBuf::from(load_context.path()); + cache_path.set_file_name(kttf.file.clone()); let font_bytes = load_context - .read_asset_bytes(kttf.file.clone()) + .read_asset_bytes(cache_path.clone()) .await .unwrap(); - let mut cache_path = std::path::PathBuf::from(load_context.path()); let file_name = load_context .path() .file_name()