First, this solution assumes you're using the Google Web Font plugin for CKEditor: http://ckeditor.com/addon/ckeditor-gwf-plugin
You can subscribe to CKEditor changes and then parse the resulting html for google font families. Here's an example using the base example from the plugin page:
var editor = CKEDITOR.replace( 'editor1',{
toolbar: [
['Font', 'FontSize']
],
startupFocus: true,
fillEmptyBlocks: false,
autoParagraph: false,
resize_enabled: false
});
editor.on('change', function(event){
console.log(event.editor.getData());
});
For a sample input where I selected two web fonts for different pieces of text it outputs the following as an html string:
<span style="font-family:actor;">Hello world</span> <span style="font-family:allerta stencil;">It's nice to meet you. </span>
<link href="https://fonts.googleapis.com/css?family=Actor" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Allerta Stencil" rel="stylesheet" type="text/css" />
It's worth noting that it appears the data already includes the requisite links to the in use font families However, that html string could easily be parsed to get, ['Actor', 'Allerta Stencil'], to persist and load dynamically on frontpage load by Web Font Loader. Here's a fiddle that returns an array of font-family names from the output string: https://jsfiddle.net/v4tnynu2/
Check out Web Font Loader by Google and Typekit: https://developers.google.com/fonts/docs/webfont_loader
It allows you to dynamically load web fonts after page load:
WebFont.load({
google: {
families: ['Actor', 'Allerta Stencil']
}
});