diff --git a/assets/js/src/handlebars_helpers.js b/assets/js/src/handlebars_helpers.js index 76c31eed50..8ecec476eb 100644 --- a/assets/js/src/handlebars_helpers.js +++ b/assets/js/src/handlebars_helpers.js @@ -140,5 +140,12 @@ define('handlebars_helpers', ['handlebars'], function(Handlebars) { return parseInt(string, 10); }); + Handlebars.registerHelper('fontWithFallback', function(font) { + switch(font) { + case 'Lucida': return new Handlebars.SafeString("'Lucida Sans Unicode', 'Lucida Grande', sans-serif"); + default: return font; + } + }); + window.Handlebars = Handlebars; }); diff --git a/views/newsletter/templates/blocks/button/block.hbs b/views/newsletter/templates/blocks/button/block.hbs index 7dd3e26758..36cc1b2218 100644 --- a/views/newsletter/templates/blocks/button/block.hbs +++ b/views/newsletter/templates/blocks/button/block.hbs @@ -1,5 +1,5 @@
- {{ model.text }} + {{ model.text }}
diff --git a/views/newsletter/templates/blocks/footer/block.hbs b/views/newsletter/templates/blocks/footer/block.hbs index 56094a2432..617e26df1f 100644 --- a/views/newsletter/templates/blocks/footer/block.hbs +++ b/views/newsletter/templates/blocks/footer/block.hbs @@ -3,7 +3,7 @@ .mailpoet_editor_view_{{ viewCid }} .mailpoet_content, .mailpoet_editor_view_{{ viewCid }} .mailpoet_content p { color: {{ model.styles.text.fontColor }}; - font-family: {{ model.styles.text.fontFamily }}; + font-family: {{fontWithFallback model.styles.text.fontFamily }}; font-size: {{ model.styles.text.fontSize }}; background-color: {{ model.styles.block.backgroundColor }}; text-align: {{ model.styles.text.textAlign }}; diff --git a/views/newsletter/templates/blocks/header/block.hbs b/views/newsletter/templates/blocks/header/block.hbs index 56094a2432..617e26df1f 100644 --- a/views/newsletter/templates/blocks/header/block.hbs +++ b/views/newsletter/templates/blocks/header/block.hbs @@ -3,7 +3,7 @@ .mailpoet_editor_view_{{ viewCid }} .mailpoet_content, .mailpoet_editor_view_{{ viewCid }} .mailpoet_content p { color: {{ model.styles.text.fontColor }}; - font-family: {{ model.styles.text.fontFamily }}; + font-family: {{fontWithFallback model.styles.text.fontFamily }}; font-size: {{ model.styles.text.fontSize }}; background-color: {{ model.styles.block.backgroundColor }}; text-align: {{ model.styles.text.textAlign }}; diff --git a/views/newsletter/templates/components/styles.hbs b/views/newsletter/templates/components/styles.hbs index 6850a58b10..bad0e0fb04 100644 --- a/views/newsletter/templates/components/styles.hbs +++ b/views/newsletter/templates/components/styles.hbs @@ -3,22 +3,22 @@ .mailpoet_text_block .mailpoet_content p { color: {{ text.fontColor }}; font-size: {{ text.fontSize }}; - font-family: {{ text.fontFamily }}; + font-family: {{fontWithFallback text.fontFamily }}; } .mailpoet_text_block .mailpoet_content h1 { color: {{ h1.fontColor }}; font-size: {{ h1.fontSize }}; - font-family: {{ h1.fontFamily }}; + font-family: {{fontWithFallback h1.fontFamily }}; } .mailpoet_text_block .mailpoet_content h2 { color: {{ h2.fontColor }}; font-size: {{ h2.fontSize }}; - font-family: {{ h2.fontFamily }}; + font-family: {{fontWithFallback h2.fontFamily }}; } .mailpoet_text_block .mailpoet_content h3 { color: {{ h3.fontColor }}; font-size: {{ h3.fontSize }}; - font-family: {{ h3.fontFamily }}; + font-family: {{fontWithFallback h3.fontFamily }}; } .mailpoet_content a { color: {{ link.fontColor }};