Skip to content

Commit

Permalink
Loads the .ttf files from the same directory as the .kttf file.
Browse files Browse the repository at this point in the history
  • Loading branch information
geerzo committed Mar 14, 2024
1 parent 6f96dc6 commit 79fcb7b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kayak_font/src/ttf/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 79fcb7b

Please sign in to comment.