Basicly what it says in the title. How do I add custom fonts within mosaico templates, i.e. how do I make them selectable in the template design process?
There is the answer to my question on github and it goes like this:
In the header of the template (the mso comments are there because Outlook is able to read webfonts declaration but then "breaks" any declared font):
<!--[if !mso]><!-- --> <link href="https://fonts.googleapis.com/css?family=Your+Web+Font" rel="stylesheet" type="text/css" /> <!--<![endif]-->
In the @supports -ko-blockdefs section of your template you add your font to the select box:
face { label: Font; widget: select; options: Your Web Font, Fallback, serif=Your Web Font|Arial, Helvetica, sans-serif=Arial|Arial
Black, Arial Black, Gadget, sans-serif=Arial Black|Comic Sans MS, Comic Sans MS5, cursive=Comic Sans|Courier New, Courier New, monospace=Courier|Georgia, serif=Georgia|Impact, sans-serif=Impact|Lucida Console, Monaco, monospace=Lucida Console|Lucida Sans Unicode, Lucida Grande, sans-serif=Lucida Sans Unicode|Times New Roman, Times, serif=Times New Roman|Verdana, Geneva, sans-serif=Verdana}
However this doesn't work for me. When I add this to versafix-1 (mosaico/templates/versafix-1/template-versafix-1.html) I still don't have the font I specified.
Here's the begining of versafix-1 template I eddited
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="initial-scale=1.0" />
<meta name="format-detection" content="telephone=no" />
<title style="-ko-bind-text: @titleText">TITLE</title>
<!--[if !mso]><!-- -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css" />
<!--<![endif]-->
<style type="text/css">
@supports -ko-blockdefs {
id { widget: id }
size { label: Size; widget: select; options: 8|9|10|11|12|13|14|15|16|18|20|22|25|28|31; }
visible { label: Visible?; widget: boolean }
color { label: Color; widget: color }
radius {
label: Corner Radius;
widget: integer;
max: 20;
help: Attention - this property is not supported on all email clients (i.e. Outlook)
face { label: Font; widget: select; options: Open Sans, Arial, serif=Open Sans|Arial, Helvetica, sans-serif=Arial|Arial Black, Arial Black, Gadget, sans-serif=Ari$
}