I have some text loaded but wherever there are quotes, a diamond shows up with a question mark. It's got to be something simple. I tried changing the font but does the same thing. This is just text in a txt file. I made no changes. I assume it can not figure out what the quotes are so it shows up as a diamond. SO how do I fix?
B4X:
Sub Globals
'===========================================================================================
Dim MyFont As Typeface
seteverythingup
end sub
Sub SetEverythingUp
'--------------------------------------------
'Instructions
lblText.Initialize("") ' initialize the Label for the text, without an EventName
scvText.Panel.AddView(lblText, 0, 0, 90%x, 100%y) ' add the Label on the ScrollView internal Panel
lblText.TextColor = Colors.White ' set the Label text color
MyFont = Typeface.LoadFromAssets("times.ttf")
lblText.Typeface = MyFont
LoadText1 'load the text
SetText 'set the text
end sub
Sub LoadText1
'---------------------------------------------
'Instructions
txt = File.GetText(File.DirAssets, "text1.txt") ' load the text file into the string
'---------------------------------------------
End Sub
Sub SetText
'---------------------------------------------
'Instructions
Dim ht As Float
lblText.Text = txt ' set the text string to the Label text property
ht = StrUtil.MeasureMultilineTextHeight(lblText, txt) ' measure Label height
scvText.Panel.Height = ht ' set the ScrollView internal Panel height to the measured height
lblText.Height = ht ' set the Label height to the measured height
scvText.ScrollPosition = 0 ' set the scroll position to the top of the text
DoEvents ' needed to execute the previous line
'---------------------------------------------
End Sub
Attachments
Last edited: