SOLVED: Setting the textFont of a DG - Android

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

SOLVED: Setting the textFont of a DG - Android

Post by quailcreek » Sat Jul 14, 2018 11:53 pm

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
Last edited by quailcreek on Sun Jul 15, 2018 11:47 pm, edited 1 time in total.
Tom
MacBook Pro OS Mojave 10.14

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7227
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Setting the textFont of a DG - Android

Post by jacque » Sun Jul 15, 2018 4:48 pm

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
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: Setting the textFont of a DG - Android

Post by quailcreek » Sun Jul 15, 2018 8:33 pm

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.
Tom
MacBook Pro OS Mojave 10.14

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7227
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Setting the textFont of a DG - Android

Post by jacque » Sun Jul 15, 2018 9:15 pm

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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: Setting the textFont of a DG - Android

Post by quailcreek » Sun Jul 15, 2018 11:36 pm

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.
Tom
MacBook Pro OS Mojave 10.14

Post Reply

Return to “Android Deployment”