Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
Posts: 93
Registered: ‎02-05-2011
My Device: Not Specified

Re: Embedded font does not work on BB10

I tried to export SWF with my fonts from FlashDevelop, but embed in Flex still does not work...

Note, that Font.enumerateFonts() shows me all my fonts embedded via direct [Embed...] and from SWF, but Ladbel+TextFormat does not show either.

 

The same with fonswf - no success. Thanks to for suggestion in any case.

 

Code:

// direct Embed - does not work
[Embed(source="/assets/segoescb.ttf", fontFamily="HandFont", mimeType="application/x-font", embedAsCFF='false')]
public static const MyFont:Class;

// embed from SWF - does not work
[Embed(source="/assets/MCFonts.swf", fontName="HandWriting" )]
private var myFont1:Class;

textFormat = new TextFormat();
textFormat.size = 250;
textFormat.color = 0xFFFFF8;
textFormat.align = TextFormatAlign.CENTER;
textFormat.font = "HandWriting";

text = new Label();
text.text = "text";
text.format = textFormat;

 

Now, with Ken's code by using TextField instead of Label it is working... Ken, thanks for a hint.

 

I'm almost sure the problem is solved by .embedFonts = true for TextField, and as I noted above, ther is no such property for Label.

 

Julian, thanks for info and suggestion, I'lldefinitely post a bug to a tracker.

 

Developer
Posts: 93
Registered: ‎02-05-2011
My Device: Not Specified

Re: Embedded font does not work on BB10

Ken,

 

Have you managed to use TextField with Containers and Layouts for BB10?

It doesn't seem to support Layouts/GridData placements.

 

Thanks

Ivan

Developer
Posts: 93
Registered: ‎02-05-2011
My Device: Not Specified

Re: Embedded font does not work on BB10

New Contributor
Posts: 8
Registered: ‎12-18-2012
My Device: Playbook
My Carrier: None

Re: Embedded font does not work on BB10


Deevych wrote:

Ken,

 

Have you managed to use TextField with Containers and Layouts for BB10?

It doesn't seem to support Layouts/GridData placements.

 

Thanks

Ivan


Sorry. I have not used them that way so I can't comment on what may be going wrong. Maybe check the size of the TextField to make sure it's not getting set to zero somewhere? The autosize property of the TextField my also be worth experimenting with if that's the problem.

 

Ken Tylman
Grim Guy Gameworks
Developer
Posts: 194
Registered: ‎11-12-2010
My Device: Not Specified

Re: Embedded font does not work on BB10


Deevych wrote:

Ken,

 

Have you managed to use TextField with Containers and Layouts for BB10?

It doesn't seem to support Layouts/GridData placements.



The only thing you can do, is to put the TextField into a Container, size that container to accommodate the TextField and then use that container as any other UIComponent in your overall container. But using qnx Labels would seem much easier if you're using layouts.

 


My app : Get set - Get up!   Get ready for the snooze revolution.

Developer
Posts: 93
Registered: ‎02-05-2011
My Device: Not Specified

Re: Embedded font does not work on BB10

To be honest, I spent a couple days trying to update the app layout according to guidelines, but not working fonts and lack of info/samples for the Container/Layout/LayoutData usage just broke me... I gave up and ended up using TextField + .x/.y for positioning on resize event and you know, it works pretty nice! And it took 4 to 6 hours to completely redesign the UI and get rid of Containers.

 

Once the problem with fonts will be solved and there will be a clean documentation on the Containers and stuff - most likely I'll update the app.