Well, here's some good news about font loading and some not particularly
good news about image asset loading.

I modified the LPS import compiler to add fonts into the loadable library,
and added
an ImportAssets tag to it, and the main app can now load fonts dynamically,
just as in Sebastian's example. I guess ImportAssets, in addition to
importing individual definitions, also just imports all the fonts from a swf
file.


However, I also modified the compiler to add all library image resources to
the loadable library swf, and put all of their exported names into the
ImportAssets tag, and they were not visible
at the top level like the definitions that are compiled into the main app, I
couldn't attach them to views or display them. So there seems to still be an
issue here, I am going to try experimenting with swfmill some more and see
if I can get some loadable resources from one of it's files.





On 1/29/07, Henry Minsky <[EMAIL PROTECTED]> wrote:

Hmm, the library file produced by swfmill seems to just have put a
"importAssets" swf instruction at the end of it, which references the
library file itself (by it's URL).

I don't think I ever tried that when I was experimenting with the
importAssets tag in the LPS; I tried putting it in the main app, which did
sort of work but forced the library to get loaded at the same time as the
main app was being loaded.

I never thought to put the importAssets tag in the library, because I
guess I figured it would load the assets into the child movieclip, and they
still wouldn't be usable from the root movieclip. I'll play with this and
see if I can get dynamically loaded resources to be attachable to views in
the main app.

On 1/29/07, Henry Minsky <[EMAIL PROTECTED]> wrote:
>
> OK I will take a look at integrating this, and try to figure out what
> swf byte code is being used in the library.
>
>
> On 1/28/07, Sebastian Wagner < [EMAIL PROTECTED]> wrote:
> >
> > hi,
> >
> > I have added some methods to LzFontManager but I would suggest to
> > include such librarys in a more general way sothat other sharedLibrary's
> > with images can be included and attached to loaded Library too.
> >
> > see attached i have tested it with legals:
> > Files changed:
> > $LPS_HOME/WEB-INF/lps/lfc/kernel/swf/Library.lzs
> > $LPS_HOME/WEB-INF/lps/lfc/kernel/swf/LzFontManager.as
> > $LPS_HOME/WEB-INF/lps/lfc/kernel/swf/LzDynamicLibraryLoader.as
> >
> > Test-Files:
> > $LPS_HOME/test/dynamiclibrary/*
> > $LPS_HOME/test/dynamiclibrary/fonts/*
> >
> > in the test-file 
(http://localhost:8080/legals/test/dynamiclibrary/loadfontslibrary.lzx )
> > it includes one font by native font control and the second one has to be
> > loaded at runtime before creation of an textbox otherwise Debugger throws a
> > *WARNING: Undefined font 'KentuckyFriedChickenFont'*
> >
> > note:
> > 1.) The FontLibrary-swfs have as import url 
"http://localhost:8080/legals/test/dynamiclibrary/fonts/KentuckyFriedChickenFont.swf
> > " so they have to be placed really there, and it will only work from
> > localhost
> > 2.) the swf's are created using swfmill. Next thing to make it really
> > working without third-party-tools is to make lzx-library-files which are
> > compiled as *sharedLibrary*. I have no clue how the bytecode of an swf must
> > be changed to make it a sharedLibrary. Having a look a swfmill might help it
> > is not that much src-code.
> >
> >
> > sebastian
> >
> > 2007/1/25, Max Carlson <[EMAIL PROTECTED]>:
> > >
> > > Hi Sebastian,
> > >
> > > You should be able to add the font at runtime with
> > > LzFontManager.addFont(...).  Have you looked at the LFC source?  The
> > > relevant file is here:
> > >
> > >
> > > 
http://svn.openlaszlo.org/openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzFontManager.as
> > >
> > > Here's the method signature:
> > >   /*
> > >    * Creates an <b><i>LzFont</i></b> with the given parameters and
> > > adds
> > > it to
> > >    * the <i>font</i> list.
> > >    *
> > >    * @param fontname: The name of the font. This is the string that
> > > will
> > > be used
> > >    * when requesting a font via <b>getFont</b>
> > >    * @param Object n: The plain style of the font.
> > >    * @param Object b: The bold style of the font.
> > >    * @param Object i: The italic style of the font.
> > >    * @param Object bi: The bold italic style of the font.
> > >    * @access private
> > >    */
> > > LzFontManager.addFont = function (  fontname , n , b , i , bi ) {
> > > ... }
> > >
> > > I'd love to see runtime font loading built into the platform.  It
> > > should
> > > be possible to patch LzFontManager to add a method that accepts an
> > > url
> > > and does the the _root movieclip funny business, and calls
> > > addFont.  If
> > > you can get a patch working we can submit it for legals!
> > >
> > > Great work so far - let me know if there's anything I can help with.
> > > Keep hacking!
> > >
> > > --
> > > Regards,
> > > Max Carlson
> > > OpenLaszlo.org
> > >
> > > Sebastian Wagner wrote:
> > > > hi,
> > > >
> > > > I have found a way to load a Fonts dynamic and attach them to a
> > > > OL-TextField
> > > > in Flash runtime.
> > > >
> > > >
> > > 
http://wagner-sebastian.com/wordpress/2007/01/24/openlaszlo-dynamic-font-libraries/
> > > >
> > > >
> > > > But some of the attributes of the TextField do not work any more.
> > > >
> > > > Is it possible to add a Font to the LzFontManager during runtime?
> > > > Sothat attributes like resize,multiline do work correctly.
> > > >
> > > > thx & regards
> > > > sebastian
> > > >
> > >
> >
> >
> >
> > --
> > Sebastian Wagner
> > http://www.webbase-design.de
> > http://www.laszlo-forum.de
> > Bleichstraße 92
> > 75173 Pforzheim
> > Tel.: 0177-7341829
> > Home: 07231-417456
> > [EMAIL PROTECTED]
> >
> >
>
>
> --
> Henry Minsky
> Software Architect
> [EMAIL PROTECTED]
>
>


--
Henry Minsky
Software Architect
[EMAIL PROTECTED]




--
Henry Minsky
Software Architect
[EMAIL PROTECTED]

Reply via email to