Make fonts available for older versions (#1431)
Make fonts available for older versions10.7.0-preview
commit
51c38e478c
|
@ -3950,7 +3950,17 @@
|
|||
"osdDescStatTotalFlightDistance": {
|
||||
"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": {
|
||||
"message": "Source:"
|
||||
},
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
var SYM = SYM || {};
|
||||
// some of these are changed in the initialization function below
|
||||
SYM.BLANK = 0x20;
|
||||
SYM.VOLT = 0x06;
|
||||
SYM.RSSI = 0x01;
|
||||
|
@ -477,7 +478,9 @@ OSD.constants = {
|
|||
positionable: function () {
|
||||
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: {
|
||||
name: 'ARTIFICIAL_HORIZON',
|
||||
|
@ -1876,7 +1879,7 @@ TABS.osd.initialize = function (callback) {
|
|||
// Open modal window
|
||||
OSD.GUI.fontManager = new jBox('Modal', {
|
||||
width: 720,
|
||||
height: 420,
|
||||
height: 440,
|
||||
closeButton: 'title',
|
||||
animation: false,
|
||||
attach: $('#fontmanager'),
|
||||
|
@ -2405,30 +2408,38 @@ TABS.osd.initialize = function (callback) {
|
|||
// init structs once, also clears current font
|
||||
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) {
|
||||
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.preview(fontPreviewElement);
|
||||
LogoManager.drawPreview();
|
||||
updateOsdView();
|
||||
});
|
||||
});
|
||||
|
||||
// load the first font when we change tabs
|
||||
var $font = $('.fontpresets option:selected');
|
||||
$.get('./resources/osd/' + $font.data('font-file') + '.mcm', function (data) {
|
||||
FONT.parseMCMFontFile(data);
|
||||
FONT.preview(fontPreviewElement);
|
||||
LogoManager.drawPreview();
|
||||
updateOsdView();
|
||||
});
|
||||
fontPresetsElement.change();
|
||||
|
||||
|
||||
$('button.load_font_file').click(function () {
|
||||
FONT.openFontFile().then(function () {
|
||||
FONT.preview(fontPreviewElement);
|
||||
LogoManager.drawPreview();
|
||||
updateOsdView();
|
||||
$('.font-manager-version-info').text(i18n.getMessage('osdDescribeFontVersionCUSTOM'));
|
||||
}).catch(error => console.error(error));
|
||||
});
|
||||
|
||||
|
|
|
@ -148,6 +148,7 @@
|
|||
<div class="font-picker" style="margin-bottom: 10px;">
|
||||
<h1 class="tab_title" i18n="osdSetupFontPresets" />
|
||||
<!-- Font preview and list -->
|
||||
<label class="font-manager-version-info"></label>
|
||||
<div class="content_wrapper font-preview"></div>
|
||||
<div class="fontpresets_wrapper">
|
||||
<label id="font-selector-label" i18n="osdSetupFontPresetsSelector"></label>
|
||||
|
|
Loading…
Reference in New Issue