views:

672

answers:

4

For the attached code, I get the following compile time error : exception during transcoding: Font for alias 'myFontFamily' with bold weight and italic style was not found by family name 'Kundli Hindi Normal'

I have installed other Hindi fonts, and I get the same error for them as well.

Though I don't get any error for standard fonts such as Arial, Helvetica and even "Microsoft Himalaya"

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
        <mx:Button x="96" y="102" label="Button"/>
        <mx:Style>
     @font-face {
    src:local("Kundli Hindi Normal");
    fontFamily: myFontFamily;
    advancedAntiAliasing: false;
    font-weight:bold;
    font-style:italic;
}

     Button {
        fontFamily: myFontFamily; 
        fontSize: 18pt;
     }
     HBox {
        fontFamily: Times; 
        fontSize: 18pt;
     }

  </mx:Style>


</mx:Application>
+1  A: 

It is likely that the font file itself has "invalid" names for the bold and italic versions of the font. I can't remember the exact details, but we had a similar issue where a font had a custom name for it's bold version causing this error. We had to modify the font in order to get the application to compile. Any decent font managing program should be able to give you the details of the font to help you spot the error.

macke
Indeed. Viewing through a font manager program, the name given was NormalA.
dta
+1  A: 

I just downloaded the Kundli Hindi font and all I got was a 'normal' font face - no bold or italic. Obviously, we may have gotten the font from different places, and you may have additional font faces, but you have to have separate bold and italic font faces in order to embed a font with bold and italic properties.

Also, the font I downloaded is named 'Kundli Hindi NormalA'.... don't know why it was named 'NormalA', rather than just 'Normal', or 'Regular'. You might double-check to make sure yours is in fact named 'Kundli Hindi Normal', if you haven't already. That doesn't seem to be the problem, but it never hurts to re-check that kind of stuff. At least for me :).

If you can't get ahold of a bold font face for this font - from my own searching on Google, it looks like it's not available - you can use ActionScript's advanced font features to create bold and semi-bold versions of a font. I don't have any helpful advice for faking italicization, though.

The following is an example of using an embedded font (Myriad Pro), and modifying its weight via the subpixel style:

.roomViewTitleRoomType
{
    color: "0x8AA1A8"; 
    font-size: 20;
    fontFamily: "Myriad Pro";
    fontAntiAliasType: "advanced";
    fontThickness: 200;
    fontGridFitType: "subpixel";
}

You might want to declare a font face with the advanced font manipulation (fontAntiAliasType, fontThickness, fontGridFitType) in it, like the following, but the additional info will just be ignored.

@font-face
{
    src: url("/assets/fonts/kundli.ttf");
    fontFamily: "Kundli Hindi Heavy";
    fontWeight: "normal";
    fontAntiAliasType: "advanced";
    fontThickness: 800;
    fontGridFitType: "subpixel";
}

Hope that's helpful.

Ross Henderson
When I list the fonts in the Windows Fonts folder, it's named : "Kundli Hindi Normal". When I view this font through a font management program, the subfamilies shown for this font are : "NormalA".Your solution works perfectly nonetheless.Thanks !
dta
A: 

I applied this kundli font on my RichTextEditor and i am able to write a text in Hindi but when i save this data into databasse it goes to save in english only. Also if i want to see the richtextEditor text by using the Alert then the text appear in english only. Anyone have any idea why it is happening?

Maji
in the database it will be stored like that only.point is if you fetch the data from database,and display it in your application, it should show up in Hindi.For Alert, check out some online documentation on how to change its font.
dta
A: 

I want to write a text in rich text editor by using a system Hindi font. I have installed Hindi language on my system by using a Windows system CD and if i choose Hindi language from the language bar and i try to write a text in RichTextEditor the text will appear in "????" only. Anyone can help me how i can use my system font in flex application. I dont have any problem with other languages. Application is working fine with other languages.In my application i am using a Arial Unicode MS font and as i know it supports all the language as well a Hindi also. Please help me out.

Maji