Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Windows font size, any workaround yet ?

Post Reply
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Windows font size, any workaround yet ?

Post by thefunkyjoint »

There is this issue , that when the user scales the font size > 100%, pages will show weird on CEF4Delphi.

I'm already using GlobalCEFApp.ForcedDeviceScaleFactor := 1, but it seems to make no difference.

This is a critical problem, because with the screen resolution nowadays being to high, usually all users set the font size greater than 100%.

I know this is probably a CEF issue... but is there any workaround ?
Last edited by thefunkyjoint on Thu Dec 12, 2024 5:11 pm, edited 1 time in total.
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Windows font size, any workaround yet ?

Post by thefunkyjoint »

I just found out that, if i resize the app window and maximize it again, the page shows correctly ! :D

What can i do to this happen without needing to resize the window manually ?
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Windows font size, any workaround yet ?

Post by salvadordf »

Call CEFWindowParent1.UpdateSize;
https://github.com/salvadordf/CEF4Delphi/blob/0c66acbb85050bf9796b3551d8d6dc67439c731c/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas#L1551
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Windows font size, any workaround yet ?

Post by thefunkyjoint »

Fixed, thank you ! :D
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Windows font size, any workaround yet ?

Post by thefunkyjoint »

Hello,

I'm having this issue again.

Currently i'm using 200% as Windows Text Scale, so i can use my screen on maximum resolution.

What happens is, when i first load a page, this is how it looks

https://ibb.co/7j1KD3b

Then if i minimize the app window and restore it, now the page shows correctly :

https://ibb.co/92pVkbq

Calling CEFWindowParent1.UpdateSize won't fix , the only workaround i know so far, is to mess with the app windows size.

Any suggestion that could fix this issue without having to manually changing app windows' size ? :roll:
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Windows font size, any workaround yet ?

Post by thefunkyjoint »

I found a workaround :

CEFWindowParent1.Width := 100;
CEFWindowParent1.Width := screen.Width;

By doing this , i achieve the same desired result as changing the app window size manually :shock:
Post Reply