[Gambas-bugtracker] Bug #2110: QT Italic font gets cut off

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Tue Mar 2 15:02:37 CET 2021


http://gambaswiki.org/bugtracker/edit?object=BUG.2110&from=L21haW4-

Comment #5 by Bruce STEERS:

So , so it's internal to the gui system?
darn it.

My only workaround for my control is to add a space to the longest line on Text_Write for clearance and removing it again on Text_Read to preserve Object.Text.


clunky and crude but it works...

''
Private Function Text_Read() As String
  Return EndSpace($sText, True)
End
''
Private Sub Text_Write(Value As String)
  $sText = EndSpace(Value)
End
''
Public Sub EndSpace(sText As String, Optional bRem As Boolean) As String
  If Not InStr(sText, "\n") Then
     If Not bRem Then
       Return sText & " "
     Else
       Return Left(sText, -1)
     Endif
  Endif
''
  Dim sAr As String[] = Split(sText, "\n")
  Dim longest As Integer[] = [0, 0]
''
  For c As Integer = 0 To sAr.Max
    If sAr[c].Len > longest[0] Then longest = [sAr[c].Len, c]
  Next
 
  If Not bRem Then
  sAr[longest[1]] &= " "
  Else
  sAr[longest[1]] = Left(sAr[longest[1]], -1)
  Endif
  Return sAr.Join("\n")
End




More information about the Bugtracker mailing list