I am trying to set the font size of my label pragmatically and currently have the following, however all of the labels appear to be being drawn with a font size of 8, which is set in the label settings:-
Function FindLabel ( [TextString], [FontSize] )
FindLabel = "<FNT Size = '([FontSize]/354)'>" + [TextString] + "</FNT>"
End Function
Any ideas how to set the font size using an expression.
Thanks
I am assuming you want this in VB Script...... so something like below would work..... my Font Size is based upon the Bridge Width while I am labeling the Bridge Number ....
Function FindLabel ( [BRIDGE_NUM],[Width])
myFontSize = int([Width]/10)
myFormat = "<FNT name='Arial' size = '" & myFontSize & "'>"
FindLabel = myFormat & [BRIDGE_NUM] & "</FNT>"
End Function
Here is my working sample with ArcPro in 2023.
Function FindLabel ( [STREET_NUMBER], [notes] )
If IsNull([notes]) Then
FindLabel = [STREET_NUMBER]
Else
FindLabel = [STREET_NUMBER] + vbcrlf + "<FNT size='2'>" + [notes] + "</FNT>"
End If
End Function