Another success – Problem with using embedded font fixed
As reported in this post, I was having problems with using embedded font in the <mx:Linkbar> object. Have a look at the code below to see what I had to change to get it to work (changes are in bold).
Here is the snippet for font embedding from as file -
[Bindable]
[Embed(source='include/fonts/Speedline.ttf',
fontName='GalleryFont',
fontStyle='normal',
fontWeight='normal',
mimeType='application/x-font')]
// You do not use this variable directly. It exists so that
// the compiler will link in the font.
public var embeddedFont:Class;
Here is the snippet of the style sheet -
.headerLinkBar {
fontFamily: GalleryFont;
fontSize: 18;
fontWeight: normal;
fontStyle: normal;
fontThickness: 0;
colour: #808080;
textRollOverColor: #FFFFFF;
rollOverColor: #262626;
selectionColor: #262626;
separatorColor: #FFFFFF;
}
.headerLinkBarButton {
fontFamily: GalleryFont;
fontWeight: normal;
fontStyle: normal;
}
And here is the snippet from the MXML file -
<mx:LinkBar id="headerLinkBarThumbsView"
styleName="headerLinkBar"
linkButtonStyleName="headerLinkBarButton">
<mx:dataProvider>
<mx:Array>
<mx:String>Arrange</mx:String>
<mx:String>Stack</mx:String>
<mx:String>Randomise</mx:String>
<mx:String>Back</mx:String>
</mx:Array>
</mx:dataProvider>
</mx:LinkBar>
It looks like specifying the style in ‘styleName’ attribute of <mx:Linkbar> element is not enough in Flex 3.2 (it used to work in Flex 2). Specifying the style for the link bar button in ‘linkButtonStyleName’ does the trick. Hopefully someone will find this useful.
—
Without wax,
yOOrek

It’s nearly 4am on a Saturday night, and I’ve been going utterly insane with this issue for hours.
THANK YOU THANK YOU!!!! :- ) — very helpful!
I’m glad that my blog was of some help to you. Thanks for kind comment.
ah yes, I spent more than 3 hours on this.
Changing and customising… linkbar was the only element to display other text than the embedded font
regarding the css solution, specifying just
font-weight: normal;
seems to be enough. (for both the linkbar and linkbuttons)
i kept on specifying the normal font weight but the linkbar was displaying in bold, and with standard text.
thanks for the solution. this was a real bugger…
Hi !! Is it possible for you to share the code of Prototype Photo gallery?
That would be very helpful to me..
Thanks in advance..
@Sai Prasad: I’m glad that you see some value in the gallery that I developed. Unfortunately I am somewhat reluctant to share this code as I want to turn this gallery into a product that I might eventually sell. At the moment I’am occupied with something else but plan on returning to developing this further in not so distant future.
–
yOOrek
@Yoorek : I agree that this could turn into a good product. All the best for your product.
Just in case you have changed your mind, please let me know.
Thank you man! I know that’s the old problem, but i’ve spent 6 hours in order to solve it.
This trick does not work for me