CEF4 Delphi > Unable to increase the font size

Post Reply
john.augustine
Posts: 48
Joined: Fri Jul 10, 2020 1:33 pm

CEF4 Delphi > Unable to increase the font size

Post by john.augustine »

Hi,

I am using CEFWindowParent and TChromium (CEF4 > Delphi)
There is no rendering issue except font size (very small) of HTML data. Please refer the attached screen shot.

I have tried below things but no success:

procedure TQuestionnairePreviewForm.dQuestionnaireChromiumBrowserLoadStart(
Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame;
transitionType: Cardinal);

begin
//dQuestionnaireChromiumBrowser.browser.MainFrame.ExecuteJavaScript('document.getElementById(''table'').style.display =''font-size:20px'';', '', 0 );
//dQuestionnaireChromiumBrowser.browser.MainFrame.ExecuteJavaScript('document.getElementById(''table'').style.display =''font-size:20px'';', '', 0 );
//dQuestionnaireChromiumBrowser.browser.MainFrame.ExecuteJavaScript('document.getElementsByTagName("body")[0].style.fontSize = ''20pt''', '', 0);
//dQuestionnaireChromiumBrowser.browser.MainFrame.ExecuteJavaScript('document.body.style.fontSize = ''xx-large''', '', 0);
//dQuestionnaireChromiumBrowser.FontOptions.DefaultFixedFontSize := 30;
//dQuestionnaireChromiumBrowser.browser.MainFrame.ExecuteJavaScript('document.documentElement.body.style = ''font-size:20px''', '', 0);
//dQuestionnaireChromiumBrowser.browser.MainFrame.ExecuteJavaScript('document.documentElement.style.fontSize = ''25px''', '', 0);
//dQuestionnaireChromiumBrowser.browser.MainFrame.ExecuteJavaScript('document.body.style.fontSize = ''xx-large''', '', 0);
end;

Could any one please help me on this? Didn't see any font size issue while using TWebBrowser

My system configuration:
Windows 10 Enterprise (64-bit)
Delphi Version: Delphi 10 Seattle

Thanks & Regards,
John Augustine
You do not have the required permissions to view the files attached to this post.
User avatar
salvadordf
Posts: 2987
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: CEF4 Delphi > Unable to increase the font size

Post by salvadordf »

Please, check that you copied all the files inside the "Release" and "Resources" directories found in the CEF binaries.
Never delete the "en-US.pak" file. It must be present inside the "locales" directory.

If CEF can't find any of the files it needs you can get weird font issues or crashes.

Install Chrome or Chromium in that computer to see if you get similar font issues.

Download and run the official CEF "Sample application" to see if it has font issues in that computer :
http://opensource.spotify.com/cefbuilds ... nt.tar.bz2

Perhaps this is a rare issue with high DPI monitors. Check that you have selected the right manifest configuration in the project options.

If all fails, you can set the "Zoom" value with TChromium.IncZoomStep, TChromium.DecZoomStep, TChromium.ZoomPct, etc.
john.augustine
Posts: 48
Joined: Fri Jul 10, 2020 1:33 pm

Re: CEF4 Delphi > Unable to increase the font size

Post by john.augustine »

Thanks so much for your detailed information's!

Sure, I will check all these things.

Thanks,
John
Post Reply