Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loads the .ttf files from the same directory as the .kttf file. #284

Merged
merged 1 commit into from
Mar 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading