Allmas

  • Increase font size
  • Default font size
  • Decrease font size

Text Layout Framework released on Adobe Labs

E-mail Print PDF

Adobe released the first beta of the new Text Layout Framework (TLF) for Flash Player 10 and AIR 1.5. Built on the new text engine of Flash Player 10, the framework offers advanced typographic and text layout features. It supports bidirectional and vertical text, multi-column layout, text flow around inline images, advanced antialiasing and transformations (alpha, rotation, etc.) for device fonts and much more.

Flex Gumbo, the next release of Flex, already includes the framework and offers text components that use it. Flex 3.2 and ActionScript developers can download the framework and use it to develop their own text components and classes. For Flash CS4 Professional users, Adobe offers an extension to integrate the framework in their projects.

 

Gumbo: Using embedded fonts with the new text primitives

E-mail Print PDF

Gumbo defines 3 new text primitives that take advantage of the new text functionality of the Flash Player 10 Text Engine: TextBox, TextGraphic and TextView. More information about them can be found in the following Gumbo features specification document: Text Primitives (TextBox, TextGraphic, and TextView).

To use embedded fonts with these text primitives, the fonts must be embedded in the Compact Font Format (CFF). This is achieved by setting the new property "cff" for font embedding to "true". Here are two examples on setting this property:

Using CSS

  1. @font-face {
  2.         src: url("MyFontFile.ttf");
  3.         fontFamily: myFontFamily;
  4.         cff: true;
  5. }

Using ActionScript

  1. [Embed(source="MyFontFile.ttf",
  2.         fontFamily="myFontFamily",
  3.         cff="true"]
  4. private const font1:Class;

The text primitives also support the new style property "fontLookup", which sets the source where to lookup for fonts. This property can have two values:

  • device : uses the fonts installed on the system that is running the SWF file
  • embeddedCFF : uses font outlines embedded in the SWF

As you can guess, this property must be set to "embeddedCFF" :

Directly in the MXML tag

  1. <TextGraphic text="My Text" fontFamily="myFontFamily" fontLookup="embeddedCFF" />

Using CSS

  1. <TextGraphic text="My Text" styleName="myTextStyle" />

  1. .myTextStyle {
  2.         fontFamily: myFontFamily;
  3.         fontLookup: "embeddedCFF";
  4. }

 

Flex 3 Regular Expression Explorer

E-mail Print PDF

If you ever worked with regular expressions, you know how difficult and time consuming it is sometimes to create and test them. Ryan Swanson released the Flex 3 Regular Expression Explorer to help you with this task. The explorer allows you to create and test regular expressions instantly and find common ones published by himself or by the community. It also features a simple reference to the ActionScript 3 regualr expressions syntax. Thanks Ryan!

 

Always override the clone() method for your custom events

E-mail Print PDF

When implementing a custom event in a Flash or Flex application, most examples and articles I found on the web don't override the clone() method. This works probably in most simple cases, but as soon as you try to redispatch the event (by calling dispatchEvent(event) in a handler that is handling event), you can get a "Type Coercion Failed" error. It states that it cannot convert flash.events.Event to your custom event's type.

Why is this happening? When you redispatch an event , the EventDispatcher class calls the clone() method and dispatches the cloned copy of the event. If you don't override the method to return an instance of the custom event, the original Event.clone() method will be called and an object of type Event will be returned. Now if you have an event listener expecting an instance of the custom event, the error will occur as the Flash virtual machine doesn't know how to convert from Event to your custom event type.

 

Gumbo: Flex Builder debugger support added

E-mail Print PDF

Felx Builder debugger support has been added to the sources of the Adobe Flex SDK. Just update your working copy or download the latest Nightly Build and you can start debugging your Gumbo applications in Flex Builder! Gone the days of adding the trace command everywhere in your code and analyzing a bloated flashlog.txt file. Don't forget to install the Flash Player 10 plugin or ActiveX control for your browser from the directory in\player\10\<platform>.

Related Article: Gumbo: Development Environment Setup For Flex Builder.

 


Page 2 of 3

RSS Feed

Search

View Haykel Ben Jemia's profile on LinkedIn


Shared Items