[AIR] Font of loaded swf is lost

classic Classic list List threaded Threaded
21 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[AIR] Font of loaded swf is lost

Olaf Krueger
Hi,
we're using AIR (captive runtime) here and instead of always deploying the
latest version of our app(s) I'd like to download the latest version as swf
from an internal server 'automatically'.
The idea is to deploy just a shell AIR app one time which will never be
changed.
This app has to load the latest swf(s) on demand from an internal server
which means that the users would have the same experience as with Flash in
the Browser.
No need to manually install anything anymore.

The swf loading at runtime using SWFLoader and URLLoader works like a charm
but the (embedded) fonts of the loaded swf are lost.
I am using the [Embed] tag and thought this makes the fonts part of the swf
[1].

I' am not experienced with this stuff so I guess I am missing something.

Any help is appreciated!

Thanks,
Olaf






[1]
[Embed(source='.../Raleway-Light.ttf',
   fontName='RalewayLightFont',
   fontStyle='normal',
   mimeType='application/x-font',
   embedAsCFF='true'
)]





--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

Olaf Krueger
I also just noticed that the FontAwesome fonts which are part of the SDK also
doesn't work within the swf which was loaded dynamically at runtime.

Thanks,
Olaf



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

Carlos Rovira-2
In reply to this post by Olaf Krueger
Hi Olaf,

that's an interesting topic. I'm interested in what things come from this,
since I was thinking in make something similar for a mobile App. One of the
problems with iOS-Apple Store is we need to wait around 3 working days to
see updated apps in Apple Store. Something like this will overcome that
problem.

2018-04-24 10:32 GMT+02:00 Olaf Krueger <[hidden email]>:

> Hi,
> we're using AIR (captive runtime) here and instead of always deploying the
> latest version of our app(s) I'd like to download the latest version as swf
> from an internal server 'automatically'.
> The idea is to deploy just a shell AIR app one time which will never be
> changed.
> This app has to load the latest swf(s) on demand from an internal server
> which means that the users would have the same experience as with Flash in
> the Browser.
> No need to manually install anything anymore.
>
> The swf loading at runtime using SWFLoader and URLLoader works like a charm
> but the (embedded) fonts of the loaded swf are lost.
> I am using the [Embed] tag and thought this makes the fonts part of the swf
> [1].
>
> I' am not experienced with this stuff so I guess I am missing something.
>
> Any help is appreciated!
>
> Thanks,
> Olaf
>
>
>
>
>
>
> [1]
> [Embed(source='.../Raleway-Light.ttf',
>    fontName='RalewayLightFont',
>    fontStyle='normal',
>    mimeType='application/x-font',
>    embedAsCFF='true'
> )]
>
>
>
>
>
> --
> Sent from: http://apache-flex-users.2333346.n4.nabble.com/
>



--
Carlos Rovira
http://about.me/carlosrovira
Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

Olaf Krueger
In reply to this post by Olaf Krueger
Sorry, I should mention, that I am loading the swf into a ByteArray in order
to avoid sandbox/securitiy issues. This is the source code [1].  I've got
this idea from here [2].

[1]
https://gist.github.com/olafkrueger/017820407c79408226581e79853604ca

[2]
https://stackoverflow.com/questions/2713865/how-to-run-an-external-swf-inside-a-flex-application?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

Olaf Krueger
In reply to this post by Carlos Rovira-2
> we need to wait around 3 working days to  see updated apps in Apple Store

Interesting, I am not sure but I think Google needs max 24 hours?



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

piotrz
When we are submitting Moonshine to App Store we are waiting less than 24
hours.

2018-04-24 11:08 GMT+02:00 Olaf Krueger <[hidden email]>:

> > we need to wait around 3 working days to  see updated apps in Apple Store
>
> Interesting, I am not sure but I think Google needs max 24 hours?
>
>
>
> --
> Sent from: http://apache-flex-users.2333346.n4.nabble.com/
>



--

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
<https://www.patreon.com/piotrzarzycki>*
Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

Carlos Rovira-2
Hi Piotor,

maybe that's on Mac Apple Store, you think is the same in iOS Apple Store?
Several months has past since we update last App, maybe Apple has improve
the timings since that

thanks



2018-04-24 11:10 GMT+02:00 Piotr Zarzycki <[hidden email]>:

> When we are submitting Moonshine to App Store we are waiting less than 24
> hours.
>
> 2018-04-24 11:08 GMT+02:00 Olaf Krueger <[hidden email]>:
>
> > > we need to wait around 3 working days to  see updated apps in Apple
> Store
> >
> > Interesting, I am not sure but I think Google needs max 24 hours?
> >
> >
> >
> > --
> > Sent from: http://apache-flex-users.2333346.n4.nabble.com/
> >
>
>
>
> --
>
> Piotr Zarzycki
>
> Patreon: *https://www.patreon.com/piotrzarzycki
> <https://www.patreon.com/piotrzarzycki>*
>



--
Carlos Rovira
http://about.me/carlosrovira
Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

piotrz
Carlos,

Not sure. I'm not responsible for submitting. However I doubt that is
something different.

Piotr

2018-04-24 16:05 GMT+02:00 Carlos Rovira <[hidden email]>:

> Hi Piotor,
>
> maybe that's on Mac Apple Store, you think is the same in iOS Apple Store?
> Several months has past since we update last App, maybe Apple has improve
> the timings since that
>
> thanks
>
>
>
> 2018-04-24 11:10 GMT+02:00 Piotr Zarzycki <[hidden email]>:
>
> > When we are submitting Moonshine to App Store we are waiting less than 24
> > hours.
> >
> > 2018-04-24 11:08 GMT+02:00 Olaf Krueger <[hidden email]>:
> >
> > > > we need to wait around 3 working days to  see updated apps in Apple
> > Store
> > >
> > > Interesting, I am not sure but I think Google needs max 24 hours?
> > >
> > >
> > >
> > > --
> > > Sent from: http://apache-flex-users.2333346.n4.nabble.com/
> > >
> >
> >
> >
> > --
> >
> > Piotr Zarzycki
> >
> > Patreon: *https://www.patreon.com/piotrzarzycki
> > <https://www.patreon.com/piotrzarzycki>*
> >
>
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>



--

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
<https://www.patreon.com/piotrzarzycki>*
Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

Alex Harui-2
In reply to this post by Carlos Rovira-2
Apple will let your app load a SWF?  I thought there were restrictions on that.

-Alex

On 4/24/18, 1:36 AM, "[hidden email] on behalf of Carlos Rovira" <[hidden email] on behalf of [hidden email]> wrote:

    Hi Olaf,
   
    that's an interesting topic. I'm interested in what things come from this,
    since I was thinking in make something similar for a mobile App. One of the
    problems with iOS-Apple Store is we need to wait around 3 working days to
    see updated apps in Apple Store. Something like this will overcome that
    problem.
   
    2018-04-24 10:32 GMT+02:00 Olaf Krueger <[hidden email]>:
   
    > Hi,
    > we're using AIR (captive runtime) here and instead of always deploying the
    > latest version of our app(s) I'd like to download the latest version as swf
    > from an internal server 'automatically'.
    > The idea is to deploy just a shell AIR app one time which will never be
    > changed.
    > This app has to load the latest swf(s) on demand from an internal server
    > which means that the users would have the same experience as with Flash in
    > the Browser.
    > No need to manually install anything anymore.
    >
    > The swf loading at runtime using SWFLoader and URLLoader works like a charm
    > but the (embedded) fonts of the loaded swf are lost.
    > I am using the [Embed] tag and thought this makes the fonts part of the swf
    > [1].
    >
    > I' am not experienced with this stuff so I guess I am missing something.
    >
    > Any help is appreciated!
    >
    > Thanks,
    > Olaf
    >
    >
    >
    >
    >
    >
    > [1]
    > [Embed(source='.../Raleway-Light.ttf',
    >    fontName='RalewayLightFont',
    >    fontStyle='normal',
    >    mimeType='application/x-font',
    >    embedAsCFF='true'
    > )]
    >
    >
    >
    >
    >
    > --
    > Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-flex-users.2333346.n4.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7C342f04789169470c2c5708d5a9be69df%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636601557640015364&sdata=%2FSc5wYos6BPs3eP03PByv5E%2BZHyu1KUXqtn8e%2F88VuE%3D&reserved=0
    >
   
   
   
    --
    Carlos Rovira
    https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7C342f04789169470c2c5708d5a9be69df%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636601557640015364&sdata=mt4rbImA0ESznDvo5PvimUuOlzxQ2ai3jA2w%2FHcpBzw%3D&reserved=0
   

Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

Alex Harui-2
In reply to this post by Olaf Krueger
Is this a desktop app or mobile app?

Is the shell written in Flex?  Is the loaded SWF?

For desktop, there should be code in the framework that should get this right most of the time.  The rule is that the SWF that contains the embedded font must be used to generate the TextField or TextLine that displays the font.  As soon as you have more than one SWF running, you can run into problems because the way ApplicationDomains work cause your code to want to always instantiate TextFields and TextLines in the first SWF loaded.

For Mobile, I'm less clear on the rules since the SWFs are no longer SWFs in IOS, IIRC

HTH,
-Alex

On 4/24/18, 1:35 AM, "Olaf Krueger" <[hidden email]> wrote:

    I also just noticed that the FontAwesome fonts which are part of the SDK also
    doesn't work within the swf which was loaded dynamically at runtime.
   
    Thanks,
    Olaf
   
   
   
    --
    Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-flex-users.2333346.n4.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7C08c9f1cbbe71455126c308d5a9be5ccc%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636601557530327738&sdata=txvY391u1BtFIFFXpo9ETNKP8RS8ML3N2UMDD4P6zbM%3D&reserved=0
   

Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

0xC3
In reply to this post by Olaf Krueger
Olaf, I am doing a boot loader style as well, for different reasons. The
child app may not be looking at itself for all the resources. There are more
then 1 style of loading the child app into the boot loader
https://help.adobe.com/en_US/as3/dev/WSd75bf4610ec9e22f43855da312214da1d8f-8000.html


I have not noticed any font issues, however flatspark is the only embedded
fonts I am using and I use them embedded in the boot loader app. I would
suspect you need to register the embedded font to the ApplicationDomain on
application load. My boot loader app is more complex and it uses flatspark
itself so its already there for me and maybe why I don't have to do anything
specific. I do run a routine on start to verify all the resources and styles
I need are there and manually add them when necessary.




--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

0xC3
In reply to this post by Alex Harui-2
I have only used this in production for desktop and have good success. Mobile
is not a big concern for me but I have tested on Android by side loading and
it works there as well. I have never tried iOS but from what I have read you
can remote download swf's for assets but it cannot contain or execute code.  



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

Olaf Krueger
In reply to this post by Alex Harui-2
>Is this a desktop app or mobile app?
>Is the shell written in Flex?  Is the loaded SWF?

It's a desktop app (captive runtime), anything written in Flex/AS3.


>As soon as you have more than one SWF running, you can run into problems...

Because our app is divided into several sub-apps I had the idea to not only
load one main SWF (that holds anything) but rather split each particular app
into a SWF and just load the needed apps (SWFs) on demand... but if I ran
into more problems I maybe should discard this idea..

Thanks!
Olaf





--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

Olaf Krueger
In reply to this post by 0xC3
Hi 0xC3,

thanks for your helpful hints and the link!

>Olaf, I am doing a boot loader style as well, for different reasons.

Did you notice any drawbacks or performance issues by using this approach?

Thanks,
Olaf



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

Olaf Krueger
In reply to this post by Olaf Krueger
I just noticed that if I just add one ttf font file to the shell/booloader
app and I also define it within the styles section, it works!
Even if I just define one font-face in the shell app, all other fonts (e.g.
Flatspark) of the loaded SWF are working now. Magic...

Thanks to all for your help!

Olaf

[1]
@font-face {
        src: url("fonts/raleway/Raleway-Light.ttf");
        fontFamily: "RalewayLight";
}



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

Alex Harui-2
The embedding of one font might bring in the EmbeddedFontRegistry classes into the main ApplicationDomain so they are shared among all sub-SWFs.  You could probably have success just force-linking EmbeddedFontRegistry and not have to embed the font.

https://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-799a.html

Note also that using sub-applications is heavier than using modules, so if you are going to refactor you might be better off using modules.  Once you get set up with EmbeddedFontRegistry in the main ApplicationDomain, things should work without extra work on your part.

HTH,
-Alex

On 4/24/18, 12:19 PM, "Olaf Krueger" <[hidden email]> wrote:

    I just noticed that if I just add one ttf font file to the shell/booloader
    app and I also define it within the styles section, it works!
    Even if I just define one font-face in the shell app, all other fonts (e.g.
    Flatspark) of the loaded SWF are working now. Magic...
   
    Thanks to all for your help!
   
    Olaf
   
    [1]
    @font-face {
    src: url("fonts/raleway/Raleway-Light.ttf");
    fontFamily: "RalewayLight";
    }
   
   
   
    --
    Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-flex-users.2333346.n4.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7C0af741712b8346ddcdc008d5aa183fa9%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636601943563109093&sdata=IY0qKsf0sJRadtL9Otp50KXPRkwhNaaQOTO6QJwkdzs%3D&reserved=0
   

Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

0xC3
In reply to this post by Olaf Krueger
I didn't see any performance issues, once its loaded it seems to work the
same as everything else. The style I did was more like loading a remote
module (child domain) then hosting a sandboxed app instance. Like Alex said
it is heavier then modules (not really sure how much, as we didn't test
modules much), but modules are not supported in mobile. Even though we are
not using mobile right now we wanted to leave the door open for Chromebooks
later and this method allowed that.



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

Olaf Krueger
In reply to this post by Alex Harui-2
>Note also that using sub-applications is heavier than using modules, so if
you are going to refactor you >might be better off using modules.

I remember some issues years ago (but don't remember which kind of issues)
by using modules so I tried using sub-applications at first now.
But it seems to me that I should take a deeper look at modules again!

Thanks for the hints, Alex!
Olaf




--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

Olaf Krueger
In reply to this post by 0xC3
>The style I did was more like loading a remote
>module (child domain) then hosting a sandboxed app instance.

I guess I don't understand it completely:
Do you also have a main app SWF which just loads an child/sub remote app SWF
into the local main app?
Or do you use another approach?

Thanks,
Olaf




--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: [AIR] Font of loaded swf is lost

0xC3
There are 3 types of loading for ApplicationDomain depending on the need of
interaction and use. This page explains it better.
https://help.adobe.com/en_US/as3/dev/WSd75bf4610ec9e22f43855da312214da1d8f-8000.html

Our use case is reverse of yours. The child swf's are located on site and we
do not have control over their age (some customers will not allow updates
after testing is complete), but the boot loader we can control to make sure
its up to date. So when a technician goes to a site and connects we want to
be able load older or newer versions from the same boot loader. We are doing
usage C because I want the loaded swf to communicate with some classes from
our boot loader, I do have to watch backward compatibility in the boot
loader but for us its an ok trade off because the main goal is to load older
and newer swf's from a single boot loader.

Sounds like you would want usage A.  



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
12