- This topic has 22 replies, 2 voices, and was last updated 6 years, 3 months ago by
Tom.
-
AuthorPosts
-
August 25, 2017 at 2:42 am #373262
Luis
I’m using GP premiun with Visual Composer and TinyMCE.
GP’s management of the typography is perfect, but when I enter TinyMCE between the fonts to choose, I do not appear the ones that use GP typography.
Is it possible to copy in TinyMCE this typography (fonts) so that they appear in both places the same?
I assume that as GP loads Google Fonts, this is no longer necessary, and it would be sufficient to appear and can be selected in TinyMCE!
Can you help me?
Thank you very much.August 25, 2017 at 9:16 am #373411Tom
Lead DeveloperLead DeveloperHi there,
Fonts typically aren’t select-able in TinyMCE unless you’re using a plugin.
Also, with the new Gutenberg editor on the horizon, TinyMCE is likely going to be gone.
August 25, 2017 at 10:01 am #373441Luis
If, indeed, I use TinyMCE Advanced
Is it possible to copy in TinyMCE Advanced this typography (fonts) so that they appear in both places the same?
Thank youAugust 25, 2017 at 7:55 pm #373612Tom
Lead DeveloperLead DeveloperI’m not sure – they would have to have some sort of filter which you could add your custom fonts to. Perhaps asking over in their support – if they can provide a filter, I should be able to help with some code.
August 27, 2017 at 11:20 am #374284Luis
It is possible to use this code:
function my_mce_settings_font ( $settings ) {
$font_formats= ‘Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;AkrutiKndPadmini=Akpdmi-n’;$settings[‘font_formats’] = $font_formats;
return $settings;
};
add_filter(‘tiny_mce_before_init’, ‘my_mce_settings_font’);The question is if GP has a function that returns the fonts it uses, and copy them into $font_formats
If this is not possible, do not worry, I can add just the font I’m going to use, and that’s it!
Thank you very much, and sorry for my bad English.
August 28, 2017 at 12:04 am #374486Tom
Lead DeveloperLead DeveloperSo you’re trying to get every font family option that you’ve set in the Customizer?
August 28, 2017 at 5:50 am #374635Luis
Yes it is. I could look at the customirzer every time, and copy them in the filter, but every web would touch me to do the same. If there were any way to get them, it would be more comfortable.
August 28, 2017 at 9:45 am #374786Tom
Lead DeveloperLead DeveloperThis is how you would get those values:
$settings = wp_parse_args( get_option( 'generate_settings', array() ), generate_get_default_fonts() ); $settings[ 'font_top_bar' ]; $settings[ 'font_site_title' ]; $settings[ 'font_site_tagline' ]; $settings[ 'font_navigation' ]; $settings[ 'font_widget_title' ]; $settings[ 'font_buttons' ]; $settings[ 'font_heading_1' ]; $settings[ 'font_heading_2' ]; $settings[ 'font_heading_3' ]; $settings[ 'font_heading_4' ]; $settings[ 'font_heading_5' ]; $settings[ 'font_footer' ];
August 29, 2017 at 1:21 am #375191Luis
Fantastico, try it and I’ll tell you.
The body font I suposse is ‘font_body’ ok?August 29, 2017 at 9:59 am #375461Tom
Lead DeveloperLead DeveloperCorrect π
August 30, 2017 at 2:25 am #375854Luis
Hello Tom,
Something must be wrong, because nothing comes out (the screen goes blank). The code I put is:function my_mce_settings_font ( $settings ) {
$generate_settings = wp_parse_args(
get_option( ‘generate_settings’, array() ),
generate_get_default_fonts()
);$settings[‘font_formats’] = $generate_settings[‘font_body’];
return $settings;
};
add_filter(‘tiny_mce_before_init’, ‘my_mce_settings_font’);Thank you.
August 30, 2017 at 10:52 am #376218Tom
Lead DeveloperLead DeveloperGive this a shot:
function my_mce_settings_font( $settings ) { $generate_settings = wp_parse_args( get_option( 'generate_settings', array() ), generate_get_default_fonts() ); $settings['font_formats'] = $generate_settings['font_body']; return $settings; } add_filter( 'tiny_mce_before_init' , 'my_mce_settings_font' );
August 31, 2017 at 1:17 am #376568Luis
Sorry, I do not understand.
Give him a chance?
But it’s the same code, right?
Thank youAugust 31, 2017 at 8:51 am #376795Tom
Lead DeveloperLead DeveloperI made sure there’s no syntax errors which would turn the screen white.
If you add that into a plugin like Code Snippets, it won’t cause any blank screens π
August 31, 2017 at 12:33 pm #376936Luis
OK. I’ve tried it, and same thing happens.
It does nothing, and leaves the window blank.
Thank you. π -
AuthorPosts
- You must be logged in to reply to this topic.