Page 1 of 1

SetGadgetFont leads to narrow line spacing in ListViewGadget

Posted: Mon Mar 04, 2024 10:45 am
by Lebostein
Is this only depending on the font? But this line spacing I see seems to small (the line height ends exactly with the tail of the "y"). However, the line spacing is much larger in the default state...

Code: Select all

if OpenWindow(0, 0, 0, 270*2, 140, "ListViewGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ListViewGadget(0, 10, 10, 250, 120)
  For a = 1 To 12
    AddGadgetItem (0, -1, "Item yyy " + Str(a) + " of the Listview")   ; definieren des Listview-Inhalts
  Next
  SetGadgetState(0, 0)
  ListViewGadget(1, 10+270, 10, 250, 120)
  LoadFont(0, "Helvetica", 13)
  SetGadgetFont(1, FontID(0))
  For a = 1 To 12
    AddGadgetItem (1, -1, "Item yyy " + Str(a) + " of the Listview")   ; definieren des Listview-Inhalts
  Next
  SetGadgetState(1, 0)
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Image

Re: SetGadgetFont leads to narrow line spacing in ListViewGadget

Posted: Mon Mar 04, 2024 9:26 pm
by mrbungle
Not sure if this is a bug or intended behavior but I noticed this behavior and set the rowheight to ensure consistency