I think the problem is that the TWebBrowser
component is running Internet Explorer in compatibility mode. Indeed, if you open the docwiki page in Internet Explorer 8 and later, the fonts are small and pleasant, in contrast to how they look in the TWebBrowser
. But if you click the "Compatibility View" button in the Internet Explorer window, you will get the same large text as you do get in the TWebBrowser
component. (It is well-known that IE6 use too large text.)
According to this MSDN blog entry and the MSDN docs, to control the compatibility mode of the TWebBrowser
control, use the registry:
procedure TForm3.FormCreate(Sender: TObject);
begin
with TRegistry.Create do
try
RootKey := HKEY_CURRENT_USER;
if OpenKey('Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION', true) then
WriteInteger(ExtractFileName(Application.ExeName), 8888);
finally
Free;
end;
WebBrowser1.Navigate('http://docwiki.embarcadero.com/RADStudio/en/Main_Page');
end;
The values are 8000, 7000, and 8888 for "IE8 Standards Mode", "IE7 Standards Mode", and "IE8 Standards Mode (Forced)", respectively. Hence, the above code will force IE8 standards mode.
Surprisingly, however, setting the mode to standard will only make the font even larger.