iOS Question [SOLVED] CustomFont

MarcoRome

Expert
Licensed User
Longtime User
Hi i have this code:
B4X:
    #AppFont: gilroy-extrabold.ttf
    #AppFont: gilroy-light.ttf

B4X:
Label1.Font = Font.CreateNew2("GilroyExtraBold", 30)
Label2.Font = Font.CreateNew2("GilroyLight", 20)

i have this error:

Application_Start
Error occurred on line: 40 (Main)
Object was not initialized (UIFont)
Stack Trace: (
CoreFoundation B2D21CFD-378C-36D5-BAF7-3F70599CFEFC + 626784
libobjc.A.dylib objc_exception_throw + 60
CoreFoundation B2D21CFD-378C-36D5-BAF7-3F70599CFEFC + 983424
B4i Example -[B4IObjectWrapper object] + 116
B4i Example -[B4ILabelWrapper setFont:] + 72
B4i Example -[b4i_main _application_start:] + 1244
CoreFoundation B2D21CFD-378C-36D5-BAF7-3F70599CFEFC + 140020
CoreFoundation B2D21CFD-378C-36D5-BAF7-3F70599CFEFC + 260804
B4i Example +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1300
B4i Example -[B4IShell runMethod:] + 448
B4i Example -[B4IShell raiseEventImpl:method:args::] + 2172
B4i Example -[B4IShellBI raiseEvent:event:params:] + 1580
B4i Example __33-[B4I raiseUIEvent:event:params:]_block_invoke + 52
libdispatch.dylib A5CBAAB3-E389-3548-BAAC-FAB18411B94A + 10516
libdispatch.dylib A5CBAAB3-E389-3548-BAAC-FAB18411B94A + 18016
libdispatch.dylib _dispatch_main_queue_callback_4CF + 944
CoreFoundation B2D21CFD-378C-36D5-BAF7-3F70599CFEFC + 335060
CoreFoundation B2D21CFD-378C-36D5-BAF7-3F70599CFEFC + 48812
CoreFoundation CFRunLoopRunSpecific + 600
GraphicsServices GSEventRunModal + 164
UIKitCore 8388EB03-002B-3B35-A78A-6A022894292E + 5346984
UIKitCore UIApplicationMain + 2092
B4i Example main + 120
dyld start + 520
)
Application_Active


1639322533049.png


1639322698750.png




Any suggestion ?
 

Attachments

  • CustomFonts.zip
    127.6 KB · Views: 61
Top