-1

Hey how do i add google fonts to my tinymce ? I want to add some google fonts into that dropdown that says "Fonte"(check image)

Already tried to do the same of the other question:

I added this on my content.min.css (just above the body):

@font-face{
    font-family:'aka_Dora';
    src:url('fonts/akaDora.eot') format('eot'),
        url('fonts/akaDora.woff') format('woff'),
        url('fonts/akaDora.ttf') format('truetype'),
        url('fonts/akaDora.svg#akaDora') format('svg');
    font-weight:normal;
    font-style:normal;
}

And on tinymce.init()

font_formats: 'aka_Dora=aka_Dora;' + 'Andale Mono=andale mono,times;'...

This is what happens, it appears the font but with no styling and when i type it's like im typing without any style...

enter image description here

This is the font http://www.1001fonts.com/akadora-font.html

enter image description here

I know there is like 2 or 3 posts of it but i couldn't understand :(

Could you explain with detail ? Because i don't understand that much from css/js :(

This is how my tinymce looks: mytinymce

Here is my tinymce.init:

<asp:Content ID="head" ContentPlaceHolderID="head" runat="Server">
    <script src="/App_Script/tinymce/js/tinymce/tinymce.min.js"></script>
    <script>
        tinymce.init({
            selector: 'textarea',
            height: 520,
            theme: 'modern',
            language_url: "/App_Script/tinymcelangs/pt_PT.js",
            resize: false,
            force_br_newlines: true,
            force_p_newlines : false,
            forced_root_block : '',
            plugins: [
              'advlist autolink lists link image charmap print preview hr anchor pagebreak',
              'searchreplace wordcount visualblocks visualchars code fullscreen',
              'insertdatetime media nonbreaking save table contextmenu directionality',
              'emoticons template paste textcolor colorpicker textpattern imagetools'
            ],
            plugin_preview_width: 750,
            plugin_preview_height: 600,
            menubar: false,
            toolbar1: 'insertfile undo redo | fontselect | fontsizeselect | superscript subscript | bullist numlist outdent indent | link image table',
            toolbar2: 'preview | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | forecolor backcolor emoticons',
            image_advtab: true,
            templates: [
              { title: 'Test template 1', content: 'Test 1' },
              { title: 'Test template 2', content: 'Test 2' }
            ],
            font_formats: 'Andale Mono=andale mono,times;' + 'Arial=arial,helvetica,sans-serif;' + 'Arial Black=arial black,avant garde;' + 'Book Antiqua=book antiqua,palatino;' + 'Comic Sans MS=comic sans ms,sans-serif;' + 'Courier New=courier new,courier;' + 'Georgia=georgia,palatino;' + 'Helvetica=helvetica;' + 'Impact=impact,chicago;' + 'Symbol=symbol;' + 'Tahoma=tahoma,arial,helvetica,sans-serif;' + 'Terminal=terminal,monaco;' + 'Times New Roman=times new roman,times;' + 'Trebuchet MS=trebuchet ms,geneva;' + 'Verdana=verdana,geneva;' + 'Webdings=webdings;' + 'Wingdings=wingdings,zapf dingbats',
            fontsize_formats: "8pt 9pt 10pt 11pt 12pt 14pt 16pt 18pt 20pt 22pt 24pt 26pt 28pt 36pt 48pt 72pt"

        });
    </script>
</asp:Content>
<asp:Content ID="body" ContentPlaceHolderID="body" runat="Server">
    <textarea id="txtMessageBody" runat="server"></textarea>
</asp:Content>
Pedro
  • 63
  • 10

1 Answers1

0

Already fixed this...

Just needed to add on <head> a link from the fonts

<link href="https://fonts.googleapis.com/css?family=Aclonica|Ranga" rel="stylesheet"/>

And i don't really need to download the fonts for it to work :)

Pedro
  • 63
  • 10