Archive for the 'Fonts' Category

01
Apr

Embedding fonts in a Flex application using Embed metadata (redux)

In a previous example, “Embedding fonts in a Flex application using Embed metadata”, we saw how you could embed fonts using the [Embed] metadata with the source attribute.

The following example shows how you can embed system fonts in a Flex application using the [Embed] metadata with the systemFont attribute.

Full code after the jump.

Continue reading ‘Embedding fonts in a Flex application using Embed metadata (redux)’

07
Feb

Embedding fonts in a Flex application using Embed metadata

The following example shows how you can embed a font using ActionScript and the [Embed] metadata.

Full code after the jump.

Continue reading ‘Embedding fonts in a Flex application using Embed metadata’

31
Jan

Determining whether a font has specific glyphs in Flex

The following example shows how you can check whether an embedded font has a specific glyph by passing a string to the hasGlyph() method which returns a Boolean value indicating whether the font has the specified character(s).

Full code after the jump.

Continue reading ‘Determining whether a font has specific glyphs in Flex’

24
Jan

Specifying custom named unicode ranges in Flex

We’ve looked at general font embedding and unicode ranges before in previous examples (see “Embedding and animating fonts in a Flex application” and “Specifying certain unicode-ranges for embedded fonts”), but this example will show you how you can embed a named range of unicode characters into an application by editing your flex-config.xml file and specifying unicode ranges.

Full code after the jump.

Continue reading ‘Specifying custom named unicode ranges in Flex’

25
Oct

Embedding fonts from a Flash SWF file into a Flex application

The following examples show how you can embed a font from a Flash SWF into a Flex application using @font-face in a <mx:Style /> block, or using the [Embed] metadata.

Full code after the jump.

Continue reading ‘Embedding fonts from a Flash SWF file into a Flex application’

24
Oct

Setting a font’s anti-alias type, sharpness, thickness and grid fit type in Flex

The following example shows you how to change an embedded font’s appearance by setting the fontAntiAliasType style, fontSharpness style, fontThickness style, and fontGridFitType style.

Full code after the jump.

Continue reading ‘Setting a font’s anti-alias type, sharpness, thickness and grid fit type in Flex’

09
Oct

Embedding fonts by name instead of location

The following example shows how you can embed a font in Flex by specifying the font name instead of a location by using the local() function instead of the src() function when embedding a font.

Full code after the jump.

Continue reading ‘Embedding fonts by name instead of location’

10
Sep

Finding out which fonts are installed on a user’s system

The following example shows how you can use the static Font.enumerateFonts() method in Flex to determine which fonts are installed on a user’s system. The enumerateFonts() method returns an array of Font objects (see the flash.text.Font for more information)

Full code after the jump.

Continue reading ‘Finding out which fonts are installed on a user’s system’

28
Aug

Styling a Flex Button control using embedded fonts

The following example shows how you can customize the appearance of a Flex Button control by using an embedded font and removing the Button’s default skin.

Full code after the jump.

Continue reading ‘Styling a Flex Button control using embedded fonts’

11
Aug

Styling the Flex Alert control

This is a more complex version of my previous example. This time in addition to making the Alert control’s text non-selectable, we use an embedded font for the Alert title, message, buttons, as well as edit the drop shadow, remove the rounded corners, and remove the button skins.

Full code after the jump.

Continue reading ‘Styling the Flex Alert control’

07
Aug

Specifying certain unicode-ranges for embedded fonts

In a previous post (”Embedding and animating fonts in a Flex application“), we looked at embedding a font in a Flex application so we could animate, rotate, and set the alpha for a Text control. Well, as we learnt, sometimes embedding a whole font face can dramatically increase the size of the final SWF output. In this post we’ll look at only specifying a certain range of characters for an embedded font, which will help reduce file sizes.

Full code after the jump.

Continue reading ‘Specifying certain unicode-ranges for embedded fonts’

06
Aug

Embedding and animating fonts in a Flex application

I meant to post this earlier, and I already touched on font embedding in an earlier post (Building a basic controller for the VideoDisplay control), but here’s a quick little way to embed a font in a Flex application.

In this example we embed a font (the awesome “Base 02″ PC TrueType font (TTF) from http://www.stereo-type.net/), animate it using the Zoom effect and the Elastic.easeOut easing method. We also set the rotation and alpha properties (which you can’t do with non-embedded fonts), and we set the fontAntiAliasType to “advanced” to give the font a cleaner look. Finally we use the effectEnd event to loop the animation.

Full code after the jump.

Continue reading ‘Embedding and animating fonts in a Flex application’