function normalizeFontSettings(val) {
  const fontMethods = {};

  $labelMethod.each(function() {
    fontMethods[$(this).data('labelMethod')] = null;
  });

  if (val)
    val.forEach(function(item) {
      if (item) {
        $fontSettings.find('[data-label-method]').each(function() {
          const $that = $(this);
          const $el = $that.find('option').length ?
            $that.find('option') :
            $that;

          $el.each(function() {
            if ($(this).val() === item) {
              fontMethods[$that.attr('data-label-method')] = item;
            }
          });
        });
      }
    });

  
  updateAnnotationsState();

  return fontMethods;
}
/**
 * create font settings method->value object from select values
 * @param {Array} val font settings select values
 * @return {Object} Object of font methods
 */
create font settings method->value object from select values
@param {Array} val font settings select values
@return {Object} Object of font methods
create font settings method - > value object from select values @param { Array } val font settings select values @return { Object } Object of font methods
function normalizeFontSettings(val) {
  const fontMethods = {};
  $labelMethod.each(function() {
    fontMethods[$(this).data('labelMethod')] = null;
  });
  if (val)
    val.forEach(function(item) {
      if (item) {
        $fontSettings.find('[data-label-method]').each(function() {
          const $that = $(this);
          const $el = $that.find('option').length ?
            $that.find('option') :
            $that;
          $el.each(function() {
            if ($(this).val() === item) {
              fontMethods[$that.attr('data-label-method')] = item;
            }
          });
        });
      }
    });
  updateAnnotationsState();
  return fontMethods;
}
function normalizeFontSettings ( val ) { const fontMethods = { } ; $labelMethod . each ( function ( ) { fontMethods [ $ ( this ) . data ( 'labelMethod' ) ] = null ; } ) ; if ( val ) val . forEach ( function ( item ) { if ( item ) { $fontSettings . find ( '[data-label-method]' ) . each ( function ( ) { const $that = $ ( this ) ; const $el = $that . find ( 'option' ) . length ? $that . find ( 'option' ) : $that ; $el . each ( function ( ) { if ( $ ( this ) . val ( ) === item ) { fontMethods [ $that . attr ( 'data-label-method' ) ] = item ; } } ) ; } ) ; } } ) ; updateAnnotationsState ( ) ; return fontMethods ; }
create font settings method->value object from select values
 @param {Array} val font settings select values
 @return {Object} Object of font methods
create font settings method - > value object from select values @param { Array } val font settings select values @return { Object } Object of font methods