Page 1 of 1

CEF4 Delphi > Unable to increase the font size

Posted: Fri Aug 21, 2020 12:57 pm
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

Re: CEF4 Delphi > Unable to increase the font size

Posted: Sat Aug 22, 2020 7:50 am
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.

Re: CEF4 Delphi > Unable to increase the font size

Posted: Sat Aug 22, 2020 2:25 pm
by john.augustine
Thanks so much for your detailed information's!

Sure, I will check all these things.

Thanks,
John