Ajouter font dans TinyMCE 6...

Eléphanteau du PHP | 17 Messages

25 avr. 2024, 14:59

Bonjour à tous je tente d'ajouter la font "Jost" présente sur Google Fonts dans mon TinyMCE 6 mais impossible, j'ai fait exactement comme dans la DOC mais je ne vois pas du tout ma font Jost... Auriez-vous une idée svp ?

Image
        tinymce.init({
            selector: '.tinymce',
            width: '100%',
            plugins: 'anchor autolink charmap codesample emoticons image link lists media searchreplace table visualblocks wordcount checklist mediaembed casechange export formatpainter pageembed linkchecker a11ychecker tinymcespellchecker permanentpen powerpaste advtable advcode editimage tinycomments tableofcontents footnotes mergetags autocorrect typography inlinecss',
            toolbar: 'undo redo | blocks fontfamily fontsize | bold italic underline strikethrough | link image media table mergetags | addcomment showcomments | spellcheckdialog a11ycheck typography | align lineheight | checklist numlist bullist indent outdent | emoticons charmap | removeformat | downloadPdf | fontselect',
            font_formats: 'Jost=sans-serif;',
            content_style: "@import url('https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,100..900;1,100..900&display=swap');",
            tinycomments_mode: 'embedded',
            convert_urls: false,


Image

Avatar du membre
Administrateur PHPfrance
Administrateur PHPfrance | 9782 Messages

25 avr. 2024, 15:12

La doc est là :
https://www.tiny.cloud/blog/tinymce-custom-font-family/

Et tu as un Codepen que tu peux modifier pour tester avec Jost.
A mon avis ton font_formats n'est pas bon
Quand tout le reste a échoué, lisez le mode d'emploi...