Clarion 11.1.13855 EE: broken Message() - Font Size 11 Calcs Wrong Height Clips Text

Hi !

In Clarion 11.1.13845 easy code:

  System{Prop:FontSize} = 11 ! 12
  Message('Text in a|few lines|with which|there was|no problem|before')

gives an incorrect result

1

Previous Clarion releases did not have this problem. Please check !

If you haven’t yet, you should report this to SoftVelocity.

I’ve encountered the same and I’ve just added a problem report to PTSS (#43397).

For me it only happens when I set SYSTEM{Prop:FontSize} to a greater value than 8.

Jens

msg11
msg12
msg13
msg14
msg15
msg16

This is how message boxes using fonts of different sizes are looking on my computer using the RTL built from sources sent to SV. Changes in these sources were merged to the working code base. Probably, this was done with some errors.

1 Like

Thanks ! Perhaps there is a dependence on the font size and type. I use the regular ‘Segoe UI’.

If you have message over 2 lines at the end of message add extra ‘|’

Or 3 Or 4 “|”… depending on the number of lines in the message and size font. Why such a crutch?

Hi ! Unfortunately, the problem also manifests itself with single-line messages in large font. It can be seen that the text is cropped from the bottom and right. :frowning:

  System{Prop:FontSize}    = 16
  Message('Do you really want to delete the counterparty records selected in the list ?')

1

Perhaps you need to enable some system font settings? Thanks !

The MESSAGE function calculates the rectangle to draw text in on the base of text extent returned from the call to API’s DrawText function and the dimensions of the primary monitor. This rectangle is never less than extent returned by Windows. Usually, it is wider and higher for 16 dlu in pixels with dlu get from the specified font.

If you can reproduce the issue, I could prepare a variant of the RTL with logging actual information used by MESSAGE.

Thanks for the reply.
The problem with Message() appeared in release C11.1.13845, before that everything worked correctly.
I am ready to provide any assistance to understand the cause of the problem ! :slight_smile:

I understand it, the problem is related to an error in calculating the text size for the font ‘Segoe UI’ and it can be solved by replacing the system font in Message().

  System{Prop:MessageHook} = Address(Message2)

  System{Prop:FontSize} = 11 ! 12
  Message('Text in a|few lines|with which|there was|no problem|before')
  System{Prop:FontSize} = 16
  Message('Do you really want to delete the counterparty records selected in the list ?')
  ...
Message2  PROCEDURE(String sText, <String Caption>, <String Icon>, <String ButtonStr>, UNSIGNED Default = 0, Bool Style = False) !,unSigned,Proc
sSysFont   CSTRING(129)
uRetValue  UNSIGNED,AUTO

  Code
  sSysFont              = System{Prop:FontName}
  System{Prop:FontName} = 'Arial'
  
  System{Prop:MessageHook} = 0
  uRetValue = Message(sText,Caption,Icon,ButtonStr,Default,Style)  
  System{Prop:MessageHook} = Address(Message2)
  
  System{Prop:FontName} = sSysFont
  Return uRetValue

After that, all the stated tests work correctly.

11

Of course, I would like to see the problem resolved by SV, but it is better to work than to wait uselessly … :wink: