Skip to content

Commit

Permalink
Fix font filename when font variant is missing (#433)
Browse files Browse the repository at this point in the history
* Fix font filename when font variant is missing

Fix invalid font name when the font variant is missing on the osd file.
It was creating a font_.png file name which was invalid.

* Bump version to 2.3.1
  • Loading branch information
jesuslg123 authored Nov 27, 2024
1 parent feff1b0 commit 767f296
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wtfos-configurator",
"version": "2.4.0-dev",
"version": "2.3.1-dev",
"homepage": "https://develop.fpv.wtf",
"private": true,
"dependencies": {
Expand Down
4 changes: 3 additions & 1 deletion src/osd-overlay/fonts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ export class Font {
if (file && file.size > 0) {
return [file.name, await file.arrayBuffer()];
} else {
const font_filename = `font_${reader.header.config.fontVariant.toLowerCase()}${isHd ? "_hd" : ""}.png`;
const font_variant = reader.header.config.fontVariant.toLowerCase();
const font_name = font_variant.length !== 0 ? `font_${font_variant}` : "font";
const font_filename = `${font_name}${isHd ? "_hd" : ""}.png`;
return ["font_filename", await fetch(`https://raw.githubusercontent.com/fpv-wtf/msp-osd/main/fonts/${font_filename}`).then((response) => response.arrayBuffer())];
}
})(file);
Expand Down

0 comments on commit 767f296

Please sign in to comment.