B4J Question ABMaterial Msgbox Title and content Font

walterf25

Expert
Licensed User
Longtime User
Hi everyone, some time ago I posted a similar question here, however I never got an answer.

Now I am trying to change the font in a Message Box but can not find a solution. Normally I use the following tag to assign a font to a label
B4X:
lblwelcome.Initialize(page, "lblwelcome", "{ST:font-family:Cera-Pro-Medium;}{C:#000000}{B}CLIENT LOGIN{/ST}{/C}{/B}" & CRLF & CRLF & "{ST:font-family:Cera-Pro-Medium;}{C:#000000}Please enter login information!{/ST}{/C}", ABM.SIZE_H6, False, "loginscreen")
Notice the "{ST:font-family:Cera-Pro-Medium;}" tag is what assigns the font to the label, but for some reason this doesn't work in a Messagebox, I have the following code:

B4X:
        If data.ContainsKey("error") Then
            Dim merr As Map = data.Get("error")
            If merr.Get("message") == ABMShared.EMAIL_EXISTS Then
                page.Msgbox2("email_exists", "{B}An account associated with this email address already exists{/B}", "ACCOUNT", "OK", "", True, ABM.MSGBOX_TYPE_WARNING, False, ABM.MSGBOX_POS_CENTER_CENTER, "msgdialog")
            else if merr.Get("message") == ABMShared.INVALID_EMAIL Then
                page.Msgbox2("invalidemail", "{B}Please enter a valid email address{/B}", "ACCOUNT", "OK", "", True, ABM.MSGBOX_TYPE_WARNING, False, ABM.MSGBOX_POS_CENTER_CENTER, "msgdialog")
            End If
        End If

I load my custom font css files like this in BuildPage Sub
B4X:
    page.AddExtraCSSFile("custom/cerapro.css")
    page.AddExtraCSSFile("custom/cerapro-medium.css")
    page.AddExtraCSSFile("custom/cerapro-light.css")
    page.AddExtraCSSFile("custom/cerapro-bold.css")

If I introduce the above tag, then the Messagebox doesn't appear anymore, has anyone who has more experience with ABMaterial know how to change the font of the content in a MessageBox?

Thanks in advance all.
Walter
 

alwaysbusy

Expert
Licensed User
Longtime User
I'm not at my PC right now, but it looks like you have your closing tags in the wrong order as they work in nested pairs:

{ST:font-family:Cera-Pro-Medium;}{C:#000000}{B}CLIENT LOGIN{/B}{/C}{/ST}

I'm not even sure this works. You could try to put your bold and color in the ST tag too if this doesn't, something like:

{ST:font-family: Cera-Pro-Medium;color: #000000;font-weight: 700;}CLIENT LOGIN{/ST}

Alwaysbusy
 
Upvote 0
Top