iOS Question Object was not initialized (UIFont)

ilan

Expert
Licensed User
Longtime User
hi

i am trying to use a custom font but i am getting an error msg

Application_Start
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
Error occurred on line: 60 (B4XMainPage)
Object was not initialized (UIFont)
Stack Trace: (
CoreFoundation 76A3B198-3C09-323E-8359-0D4978E156F5 + 540460
libobjc.A.dylib objc_exception_throw + 60
CoreFoundation 76A3B198-3C09-323E-8359-0D4978E156F5 + 1582812
Kidron -[B4IObjectWrapper object] + 116
Kidron -[ResumableSub_b4xmainpage_B4XPage_Created resume::] + 1860
CoreFoundation 76A3B198-3C09-323E-8359-0D4978E156F5 + 133140
CoreFoundation 76A3B198-3C09-323E-8359-0D4978E156F5 + 129120
Kidron +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1348
Kidron -[B4IShell runMethod:] + 320
Kidron -[B4IShell raiseEventImpl:method:args::] + 928
Kidron -[B4IShellBI raiseEvent:event:params:] + 1008
Kidron -[B4IDelegatableResumableSub resume::] + 336
Kidron -[B4I checkAndRunWaitForEvent:event:params:] + 468
Kidron -[B4IShellBI raiseEvent:event:params:] + 904
Kidron __33-[B4I raiseUIEvent:event:params:]_block_invoke + 52
libdispatch.dylib 5F66CDB6-08A9-3615-8C6A-4E3B47005495 + 8508
libdispatch.dylib 5F66CDB6-08A9-3615-8C6A-4E3B47005495 + 15828
libdispatch.dylib 5F66CDB6-08A9-3615-8C6A-4E3B47005495 + 75172
libdispatch.dylib _dispatch_main_queue_callback_4CF + 44
CoreFoundation 76A3B198-3C09-323E-8359-0D4978E156F5 + 354064
CoreFoundation 76A3B198-3C09-323E-8359-0D4978E156F5 + 342292
CoreFoundation CFRunLoopRunSpecific + 608
GraphicsServices GSEventRunModal + 164
UIKitCore 9DA0D273-5506-3712-B73D-E0149D74C13C + 4238056
UIKitCore UIApplicationMain + 340
Kidron main + 100
dyld 52039C94-4DA1-3638-BD52-020A0B5FA399 + 250196
)

in the main module i have added the font file name like this:

B4X:
#AppFont: stam.ttf

this is the Special folder screenshot:

1723640097921.png



in B4xMainPage i set the font like this:

B4X:
mainsettings.Font = Font.CreateNew2("GuttmanStam",22)

font name:

1723640154333.png


why is it not working?

any ideas?

thanx
 

mcqueccu

Well-Known Member
Licensed User
Longtime User
I have used this code in post #6 to find the correct name of fonts and its works pretty well. I use windows.

It logs all the fonts names for you in Alphabetical Order. Since you know your font is Guttman Stam, you just head straight to G column, and when you find GuttmanRashiNormal, you will know its the correct name

 
Upvote 0
Top