Skip to main content
1 of 2
a1234
  • 911
  • 9
  • 28

Python FindLabel Function for Label Expression with Formatting Font?

I originally had this FindLabel function (which works)...

    def FindLabel ( [NAME], [Count_]  ):
      if [Count_] != None:
        return [NAME] +'\n' + "Well Log Count: " + [Count_]

I wanted to format the font of the second line only, after '\n', using formatting tags. This is what I tried, and it did not work...

     def FindLabel ( [NAME], [Count_] ):
       if [Count_] != None:
        return"[NAME] +'\n' +  "<FNT name='Arial' size='13'>" & "Well Log Count: " + [Count_] & "</FNT>

I also tried to set a variable, and this did not work either...

     def FindLabel ( [NAME], [Count_] ):
       myCount = "<FNT name='Arial' size='13'>" &  "Well Log Count: " + [Count_] & "</FNT>
       if [Count_] != None:
        return"[NAME] +'\n' +  myCount

Any thoughts?

a1234
  • 911
  • 9
  • 28