mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 16:25:22 +03:00
Make fonts available for older versions
All of the changes to the fonts have been backwards compatible, except for the recent move of crosshair I've just taken the latest font files, and copied 0x7B to 0x26 0x7D to 0x27
This commit is contained in:
parent
bf9c4fece7
commit
02afabf320
23 changed files with 163884 additions and 12 deletions
|
@ -3946,7 +3946,17 @@
|
||||||
"osdDescStatTotalFlightDistance": {
|
"osdDescStatTotalFlightDistance": {
|
||||||
"message": "Total distance traveled"
|
"message": "Total distance traveled"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"osdDescribeFontVersion1": {
|
||||||
|
"message": "Font version: 1 (firmware version <= 4.0)"
|
||||||
|
},
|
||||||
|
"osdDescribeFontVersion2": {
|
||||||
|
"message": "Font version: 2 (firmware version >= 4.1)"
|
||||||
|
},
|
||||||
|
"osdDescribeFontVersionCUSTOM": {
|
||||||
|
"message": "Font version: user provided"
|
||||||
|
},
|
||||||
|
|
||||||
"osdTimerSource": {
|
"osdTimerSource": {
|
||||||
"message": "Source:"
|
"message": "Source:"
|
||||||
},
|
},
|
||||||
|
|
16385
resources/osd/1/betaflight.mcm
Normal file
16385
resources/osd/1/betaflight.mcm
Normal file
File diff suppressed because it is too large
Load diff
16385
resources/osd/1/bold.mcm
Normal file
16385
resources/osd/1/bold.mcm
Normal file
File diff suppressed because it is too large
Load diff
16385
resources/osd/1/clarity.mcm
Normal file
16385
resources/osd/1/clarity.mcm
Normal file
File diff suppressed because it is too large
Load diff
16385
resources/osd/1/default.mcm
Normal file
16385
resources/osd/1/default.mcm
Normal file
File diff suppressed because it is too large
Load diff
16385
resources/osd/1/digital.mcm
Normal file
16385
resources/osd/1/digital.mcm
Normal file
File diff suppressed because it is too large
Load diff
16385
resources/osd/1/extra_large.mcm
Normal file
16385
resources/osd/1/extra_large.mcm
Normal file
File diff suppressed because it is too large
Load diff
16385
resources/osd/1/impact.mcm
Normal file
16385
resources/osd/1/impact.mcm
Normal file
File diff suppressed because it is too large
Load diff
16385
resources/osd/1/impact_mini.mcm
Normal file
16385
resources/osd/1/impact_mini.mcm
Normal file
File diff suppressed because it is too large
Load diff
16385
resources/osd/1/large.mcm
Normal file
16385
resources/osd/1/large.mcm
Normal file
File diff suppressed because it is too large
Load diff
16385
resources/osd/1/vision.mcm
Normal file
16385
resources/osd/1/vision.mcm
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var SYM = SYM || {};
|
var SYM = SYM || {};
|
||||||
|
// some of these are changed in the initialization function below
|
||||||
SYM.BLANK = 0x20;
|
SYM.BLANK = 0x20;
|
||||||
SYM.VOLT = 0x06;
|
SYM.VOLT = 0x06;
|
||||||
SYM.RSSI = 0x01;
|
SYM.RSSI = 0x01;
|
||||||
|
@ -473,7 +474,9 @@ OSD.constants = {
|
||||||
positionable: function () {
|
positionable: function () {
|
||||||
return semver.gte(CONFIG.apiVersion, "1.39.0") ? true : false;
|
return semver.gte(CONFIG.apiVersion, "1.39.0") ? true : false;
|
||||||
},
|
},
|
||||||
preview: FONT.symbol(SYM.AH_CENTER_LINE) + FONT.symbol(SYM.AH_CENTER) + FONT.symbol(SYM.AH_CENTER_LINE_RIGHT)
|
preview: function () {
|
||||||
|
return FONT.symbol(SYM.AH_CENTER_LINE) + FONT.symbol(SYM.AH_CENTER) + FONT.symbol(SYM.AH_CENTER_LINE_RIGHT);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
ARTIFICIAL_HORIZON: {
|
ARTIFICIAL_HORIZON: {
|
||||||
name: 'ARTIFICIAL_HORIZON',
|
name: 'ARTIFICIAL_HORIZON',
|
||||||
|
@ -1872,7 +1875,7 @@ TABS.osd.initialize = function (callback) {
|
||||||
// Open modal window
|
// Open modal window
|
||||||
OSD.GUI.fontManager = new jBox('Modal', {
|
OSD.GUI.fontManager = new jBox('Modal', {
|
||||||
width: 720,
|
width: 720,
|
||||||
height: 420,
|
height: 440,
|
||||||
closeButton: 'title',
|
closeButton: 'title',
|
||||||
animation: false,
|
animation: false,
|
||||||
attach: $('#fontmanager'),
|
attach: $('#fontmanager'),
|
||||||
|
@ -2401,30 +2404,38 @@ TABS.osd.initialize = function (callback) {
|
||||||
// init structs once, also clears current font
|
// init structs once, also clears current font
|
||||||
FONT.initData();
|
FONT.initData();
|
||||||
|
|
||||||
|
// Some of these definitions are determined by version.
|
||||||
|
SYM.AH_CENTER_LINE = 0x26;
|
||||||
|
SYM.AH_CENTER_LINE_RIGHT = 0x27;
|
||||||
|
if(semver.gte(CONFIG.apiVersion, "1.42.0")) {
|
||||||
|
SYM.AH_CENTER_LINE = 0x7B;
|
||||||
|
SYM.AH_CENTER_LINE_RIGHT = 0x7D;
|
||||||
|
}
|
||||||
|
|
||||||
fontPresetsElement.change(function (e) {
|
fontPresetsElement.change(function (e) {
|
||||||
var $font = $('.fontpresets option:selected');
|
var $font = $('.fontpresets option:selected');
|
||||||
$.get('./resources/osd/' + $font.data('font-file') + '.mcm', function (data) {
|
var fontver = 1;
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.42.0")) {
|
||||||
|
fontver = 2;
|
||||||
|
}
|
||||||
|
$('.font-manager-version-info').text(i18n.getMessage('osdDescribeFontVersion' + fontver));
|
||||||
|
$.get('./resources/osd/' + fontver + '/' + $font.data('font-file') + '.mcm', function (data) {
|
||||||
FONT.parseMCMFontFile(data);
|
FONT.parseMCMFontFile(data);
|
||||||
FONT.preview(fontPreviewElement);
|
FONT.preview(fontPreviewElement);
|
||||||
LogoManager.drawPreview();
|
LogoManager.drawPreview();
|
||||||
updateOsdView();
|
updateOsdView();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// load the first font when we change tabs
|
// load the first font when we change tabs
|
||||||
var $font = $('.fontpresets option:selected');
|
fontPresetsElement.change();
|
||||||
$.get('./resources/osd/' + $font.data('font-file') + '.mcm', function (data) {
|
|
||||||
FONT.parseMCMFontFile(data);
|
|
||||||
FONT.preview(fontPreviewElement);
|
|
||||||
LogoManager.drawPreview();
|
|
||||||
updateOsdView();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('button.load_font_file').click(function () {
|
$('button.load_font_file').click(function () {
|
||||||
FONT.openFontFile().then(function () {
|
FONT.openFontFile().then(function () {
|
||||||
FONT.preview(fontPreviewElement);
|
FONT.preview(fontPreviewElement);
|
||||||
LogoManager.drawPreview();
|
LogoManager.drawPreview();
|
||||||
updateOsdView();
|
updateOsdView();
|
||||||
|
$('.font-manager-version-info').text(i18n.getMessage('osdDescribeFontVersionCUSTOM'));
|
||||||
}).catch(error => console.error(error));
|
}).catch(error => console.error(error));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -148,6 +148,7 @@
|
||||||
<div class="font-picker" style="margin-bottom: 10px;">
|
<div class="font-picker" style="margin-bottom: 10px;">
|
||||||
<h1 class="tab_title" i18n="osdSetupFontPresets" />
|
<h1 class="tab_title" i18n="osdSetupFontPresets" />
|
||||||
<!-- Font preview and list -->
|
<!-- Font preview and list -->
|
||||||
|
<label class="font-manager-version-info"></label>
|
||||||
<div class="content_wrapper font-preview"></div>
|
<div class="content_wrapper font-preview"></div>
|
||||||
<div class="fontpresets_wrapper">
|
<div class="fontpresets_wrapper">
|
||||||
<label id="font-selector-label" i18n="osdSetupFontPresetsSelector"></label>
|
<label id="font-selector-label" i18n="osdSetupFontPresetsSelector"></label>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue