B4J Tutorial [ABMaterial] Change font type

This post is the answer @alwaysbusy gave me to my question about how to implement a label to look like a clock:

Make a new css file and put it in /css/custom) In my case, 'Digital-7.css'
Code: Copy
@font-face {
   font-family:"Digital-7";
   src:url("../../font/digital-7/Digital-7.ttf") format("truetype");
}
In BuildPage(), load this css file:
Code: Copy
page.AddExtraCSSFile("custom/Digital-7.css")
Where you set the text of something, use the {ST} tags:
Code: Copy
Dim lblClock As ABMLabel
lblClock.
lblClock.Initialize(page,"lblClock","{ST:font-family:Digital-7;}"&"20:00{/ST}",ABM.SIZE_H1,False,"")

The font file was saved on "\Objects\www\font\digital7" inside my project.

Hope this help anyone.
 
Got a picture of your groovy fonts in use?
 
Sure, it looks as good as you can do it on a raw HMTL.
 

Attachments

  • digital.png
    digital.png
    1.5 KB · Views: 1,075
Back
Top