htmlcssfontswebfonts

What is the correct way to remove a font from multiple HTML files without manual update?


Currently, I am using a font for emails ...let's call is - "FontX"

In all the email template (html), the "Font X" is being used everywhere. Now that I am looking to cancel the license of the font, I need to make sure font is not being used or referenced anywhere in the email templates.

Issue: Going through thousands of email templates / HTML is not feasible and requires a lot of manual work

Possible solution: Need some feedback on this, if this is a right approach?

In the email templates / HTML, "FontX" is being used everywhere like inline etc.

style="font-family:'FontX', Arial, Times New Roman, sans-serif;

Along with that, CSS file is being referenced in HTML as well.

<link rel="stylesheet" type="text/css" href="fontx.css" />

My question, what if I remove font-face reference in the referenced CSS file? It will break the source and even though font name is being used in HTML, "Font X" usage will be over, correct?

Currently, the references CSS file includes something like this:

@font-face {
    font-family: 'FontX';
    src: url('FontX.eot');
    src: url('FontX.ttf') format('truetype'),         
         url('FontX') format('svg');
    font-weight: normal;
    font-style: normal;
    mso-font-alt: 'Times New Roman';
}

What will happen if I remove src lines?

What font will be used as a fall back? What is the use of mso-font-alt? Is this considered a fall back font?


Solution

  • There are two ways to remove the font from the email template. One is better than the other. Unfortunately you can't just get rid of the src lines, as we need a place to find the font. It's just like an img without an actual image to find. And it wont go back to the mso-font-alt. I will explain

    The changing-the-src-way (the best method)

    If I understood correctly, you don't want to use the font anymore in anything you do. So what you could do is change the lines with the src in them. You could, if you want, change them to a new font, however don't get rid of them.

    mso stands for Microsoft Office (this is because in Outlook, HTML emails are read with Microsoft Word!). So this is probably an alternative for Microsoft Word.

    The getting-rid-of-the-whole-thing way

    This is not the best method, but you could just get rid of the whole @font-face bit. This would make it go back to the fallback font, which you specified in the style attribute in all your emails.