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]

Reply via email to