Page 1 of 1

SOLVED: Setting the textFont of a DG - Android

Posted: Sat Jul 14, 2018 11:53 pm
by quailcreek
Hi,
I have a DG table and I'm trying to set the textFont to FreeSansBoldQblique based upon the value of a column (Row_Style) in the grid. I have set the Rowtemplate to a custom button. The font is installed. In a preOpenStack script I set the textFont on several fields in the stack and that works on both iOS and Android. The DG script works fine on iOS but on Android only the textColor is set. What am I missing?

Code: Select all

on FillInData pData
  local theRowStyle
  
  set the text of the long ID of me to pData
  put GetDataOfLine(the dgLine of me, "Row_Style") into theRowStyle
  
  switch theRowStyle
    case "1"
      if the uDevice of this stack is "iPhone" then
        set the textStyle of me to "italic,bold"
      else
        set the textFont of me to "FreeSansBoldQblique"
      end if
      set the textColor of me to 200,0,0
      break
      
    case "2"
      set the textStyle of me to "italic,bold"
      break
      
    case "3"
      if the uDevice of this stack is "iPhone" then
        set the textStyle of me to "italic,bold"
      else
        set the textFont of me to "FreeSansBoldQblique"
      end if
      set the textColor of me to 0,0,255
      break
      
    default
      set the textStyle of me to "plain"
      set the textColor of me to "black"
      break
  end switch
end FillInData

Re: Setting the textFont of a DG - Android

Posted: Sun Jul 15, 2018 4:48 pm
by jacque
My first thought is that the font isn't available for some reason. Put a temporary line into the handler and see if the font is listed:

Code: Select all

answer the fontnames

Re: Setting the textFont of a DG - Android

Posted: Sun Jul 15, 2018 8:33 pm
by quailcreek
Hi J,
Once again you came to the rescue. The font was installed however the font name isn't the same as the file name. So freeSansBoldOblique becomes freeSans Bold Oblique. I won't mention my typo.

Re: Setting the textFont of a DG - Android

Posted: Sun Jul 15, 2018 9:15 pm
by jacque
I won't mention my typo
I don't mention mine either. :) On the other hand, I had an embarrassing episode recently with a broken appliance. I was about to call a repairman when I noticed, just in time, it wasn't plugged in.

We all have our days.

Re: Setting the textFont of a DG - Android

Posted: Sun Jul 15, 2018 11:36 pm
by quailcreek
I used to work CAD support at a large aircraft manufacture in the Seattle area. When a designer would call in with a problem with their computer, the first thing I would ask them "is it plugged in"? Generally they didn't get my humor. Thanks for the help, J.