Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Suddenly Font bold
Message
From
04/03/2019 08:25:57
 
 
To
04/03/2019 05:09:14
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 10
Network:
Windows Server 2016
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01666265
Message ID:
01666954
Views:
50
>I've had the possibility to examine a case this morning.
>I've got object reference by sys(1270)
>
>If i look at the FontName it is the Font we initially set (Segoi UI).
>The fontBold ist .f.
>The FontSize is 8
>
>If i change the fontsize to 9 The Control is fine.
>If I change it back do 8 it's again Bold, an (visually) another Font.
>
>If i Change the FontName it's ok, if i Change back ist again Bold.
>
>I'm confused. It looks like at that time the "Segoi UI 8" Font ist damaged.
>If i Restart out Application everything is fine.

I've never seen or heard of that before. Sounds like a real bug in the control.

I've never heard of Segoi UI. Is it Segoe UI?

One thing you may be able to do is if you can obtain the HWND of the child window that control uses, and use BINDEVENT() on the WM_PAINT message and SelectObject() to select into the device context a handle to the font you want to use, one that is created externally. It's unlikely to work, but it may work. This is fairly easy to do in a DLL using C/C++, but more difficult using VFP-only.

As a potential workaround, what happens if you use Arial 8pt instead of Segoe UI? Does it still mess up and require changing the font settings after a while? You might be able to change fonts and bypass the issue. There are other fonts out there compatible with Segoe UI's general appearance and size. You could use one of those if it is a bug related to Segoe UI (or Segoi UI if that's the real font name in use).

You may also be able to use CLEAR RESOURCES and have it remove cached fonts, but if the font is coming from an add-on control it's unlikely to work.

You could also replace the functionality of the control with some custom class development. Depending on what it does this may be easy or hard. I could help you this evening if you wanted to go that route.

>>>>Perhaps another thing to check is what fonts were being specified at design time -- I do vaguely recall in the case where the specified font is not available, Windows may select the "closest match" -- which may or may not all that close in appearance.
>>>
>>>We're using Segoi UI. The Font is there and everything works fine. Then Suddenly the font is bold. If the user restarts our APP its OK.
>>
>>It sounds like a bug.
>>
>>Can you programmatically set the font? If so, setup a timer to check once a second to see if it's bold, and if so then reset it to not bold. Or, change the font to something else and then back again and see if that fixes it. You could also setup a function that's on a hot key and use an ON KEY LABEL to call that code so they can press Ctrl+F5 or something to reset the font if it messes up.
Previous
Reply
Map
View

Click here to load this message in the networking platform