Popa Mihai

PopaMihai.com – Flex, Flash, AIR and ActionScript articles and tutorials

Archive for the ‘fonts’ tag

Fixing Anti-Alias and Sharpness Problems With Embedded Fonts

leave a comment

Most of the times when you embed a font in Flex the font won’t look exactly how you want it. Flex offers 4 FlashType style properties that can be used to improve the appearance of the embedded fonts in your applications. There properties are fontAntiAliasType, fontGridFitType, fontSharpness, and fontThickness.

  • fontAntiAliasType sets the antiAliasType property and can have two values: nomal or advanced
  • fontGridFitType sets the gridFitType property and can have three values: none, pixel, and subpixel
  • fontSharpness sets the sharpness property and can take values between -400 and 400
  • fontThickness sets the thickness property and can take values between -200 and 200

Read the rest of this entry »

Written by Popa Mihai

August 12th, 2009 at 3:01 pm

Posted in Flex

Tagged with ,

Reduce the Size of SWF by Using Character Ranges for Embedded Fonts

leave a comment

When you embed fonts in you Flex applications most of the time the size of the application will increase with up to 400K.

In most cases you can reduce the size of the resulting SWF by embedding only the characters that will actually be used in the application. There is no point in embedding numbers and punctuation if you only use a-z and A-Z letters in your application. This is particularly useful when the embedded font is only used in the title of the application or on some fancy buttons which don’t use numbers or punctuation.

To do this you must specify the character ranges when embedding the font with CSS by using the unicodeRange property.
Read the rest of this entry »

Written by Popa Mihai

August 11th, 2009 at 3:31 pm

Posted in Flex

Tagged with , ,

How to Embed Fonts in a Flex Application – method 2

leave a comment

This example shows another method you could use to embed fonts in Flex.

Usually when you embed fonts in Flex you use CSS. Here is how to embed fonts in a Flex Application with CSS.

In this example I will use the [Embed] tag to embed the fonts in Flex. Here is how this is done:
Read the rest of this entry »

Written by Popa Mihai

August 11th, 2009 at 12:07 pm

Posted in Flex

Tagged with ,

How to Embed Fonts in a Flex Application – method 1

one comment

In this example I will embed two fonts in Flex: one that is installed on the local computer and one from a specified URL.

In this example I used CSS to embed fonts in Flex. When you embed the font in Flex you must specify the source and the fontFamily. Here is the syntax used to embed a font in Flex using CSS, when the font is already installed on the computer:

		@font-face {
			src: local("Courier New");
			fontFamily: CourierEmbedded;
		}

Read the rest of this entry »

Written by Popa Mihai

August 11th, 2009 at 11:59 am

Posted in Flex

Tagged with ,