[Laszlo-dev] Snippets make 2 requests when font tag is present
Henry Minsky
hminsky at laszlosystems.com
Fri Apr 17 19:21:35 PDT 2009
I'm doing some testing, and it looks like this hack of using the
ImportAssets2 inside of a snippet for font loading may no longer be
necessary, at least for Flash player 10 ( I am running the debug flash 10
player), and hopefully same goes for Flash player 9 .
On Fri, Apr 17, 2009 at 6:21 PM, Henry Minsky <hminsky at laszlosystems.com>wrote:
> There is indeed a weird hack that snippets use when importing a font in
> swf8.
> The snippets library file executes a ImportAssets2 instruction when it
> loads, with a URL pointing to itself, which causes the fonts to show up in
> the top level environment.
>
> I don't know why it works, but its the only way we found to load fonts from
> a library, at one point.
>
> The end of a snippet contains this code when it is generated
>
> if (mLibFontsDefined) {
> ImportAssets2 ia = new ImportAssets2();
> //System.err.println("setting ImportAssets url="+this.liburl);
> //get property of base url for fonts to import
> String importFontUrlPath = LPS.getProperty("import.font.
> base.url");
> if (importFontUrlPath != null) {
> if (importFontUrlPath.endsWith("/") == false) {
> importFontUrlPath += "/";
> }
> if (liburl.startsWith("/")) {
> liburl = liburl.substring(1);
> }
> liburl = importFontUrlPath + liburl;
> }
> ia.setUrl(liburl);
>
>
> It may no longer be necessary in the current generation of Flash player.
> But that is what happens,
> the compiler adds a "import" SWF byte code instruction to the file to cause
> it to import its own
> definitions when it is loaded. The request ought to be cached in the
> browser the second time though, but
> it looks like it is requesting a different URL than the one that the
> snippet loaded from?
>
>
>
>
>
> On Fri, Apr 17, 2009 at 4:36 PM, P T Withington <ptw at pobox.com> wrote:
>
>> On 2009-04-17, at 16:13EDT, Antun Karlovac wrote:
>>
>> But the weird thing is that the SWF makes two separate HTTP requests for
>>> the compiled import. Is it at all possible that Webtop somehow overrides
>>> OpenLaszlo import behavior?
>>>
>>
>>
>> I think you would have better luck asking that question of the Webtop
>> engineers.
>>
>
>
>
> --
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com
>
>
>
--
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20090417/11d8af6f/attachment.html
More information about the Laszlo-dev
mailing list