gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-dev] ColorTransform and EditText (YouTube buzz videos)


From: Benjamin Wolsey
Subject: Re: [Gnash-dev] ColorTransform and EditText (YouTube buzz videos)
Date: Sun, 08 Feb 2009 22:20:27 +0100

Am Sonntag, den 08.02.2009, 21:46 +0100 schrieb Michael Fötsch:
> Benjamin Wolsey wrote:
> > Does this definitely only apply to device fonts?
> 
> I have a basic question there: What are "device" and "embedded" fonts?
> 
An embedded font is, as the name suggests, embedded in the SWF as a
series of shapes, one for each glyph. A device font (or system font)
uses a font found on the host system.

> The TextField in the YouTube movie uses <DefineEditText fontRef="9">, 
> and there's a <DefineFont2 objectID="9"> in the same file. Is this an 
> embedded font? (The font has only 12 glyphs, and when I change them, 
> there's no visible effect.)

It sounds like it is embedded in the YouTube movie. In the testcase you
attached there were no glyph records (if I remember correctly), so it
would use a device font even if the SWF specified an embedded font.

> When I change the ColorTransform in the parent so that alpha=0, the 
> TextField is still solid. (I'm not very familiar with Flash yet, so I'm 
> assuming that a PlaceObject2 is the only way to have a parent for the 
> TextField, and that the ColorTransform is the only way to modify the 
> parent's alpha value. Is this correct?)
> 
It's possible to create TextFields dynamically in ActionScript, which
makes testcases quicker. Unfortunately it doesn't make testing embedded
fonts much easier (there are examples of how to do it in the
misc-ming.all C testcases). Also, there's no guarantee that dynamic
(ActionScript-created) MovieClips and TextFields behave the same as
static ones.

This will create a MovieClip with a TextField, using a device font, and
set its colour. From SWF version 8, the flash.geom.ColorTransform class
along with the MovieClip.transform object provide another way of
manipulating the colour.


  mc = _root.createEmptyMovieClip("mc", getNextHighestDepth());
  t = mc.createTextField("tf", 1, 100, 100, 300, 100); // t == mc.tf
  t.text = "Hello, World!";

  o = {};
  o.ra = 100;
  o.rb = 255;
  o.ga = 100;
  o.gb = 255;
  o.ba = 100;
  o.bb = 255;
  o.aa = 100;
  o.ab = 255;

  col = new Color(mc);
  col.setTransform(o);

This shows the same bug in Gnash, by the way.

The question is how to make it into a self-contained, automated test so
we know we are getting the text colour right. BitmapData.draw would be
very useful (drawing a MovieClip into a buffer that's accessible to
ActionScript), but it's not implemented. Something might be possible
with MovieClip.transform as strk suggested, but I suspect it won't
provide any information that the Color class doesn't.

bwy

--
Yes, YouTube does work in Gnash
http://www.gnu.org/software/gnash/

Benjamin Wolsey, Software Developer - http://benjaminwolsey.de

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


reply via email to

[Prev in Thread] Current Thread [Next in Thread]