0

Hi I would like to use for each language proper font family. I mean that not all fonts support characters from given language (Japanese, Russina, etc) in C#.

So is it possible to automatically take the correct font family when we know the language in which we would like to display something?

ravenik
  • 852
  • 3
  • 9
  • 26
  • 1
    Duplicate: http://stackoverflow.com/questions/103725/is-there-a-way-to-programatically-determine-if-a-font-file-has-a-specific-unicod – Mr Lister Feb 15 '12 at 14:21

1 Answers1

0

yes you can easily accomplish this:

I prefer using Page_Init rather then page load to make sure it loads first.

protected void Page_Init(object sender, EventArgs e)
{
        string languageToUse = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName;

    if (languageToUse == "en")
                Page.Header.Controls.Add(new LiteralControl("<link href='/css/en.css' rel="stylesheet" type="text/css" />"));
        else if (languageToUse == "de")
                Page.Header.Controls.Add(new LiteralControl("<link href='/css/de.css' rel="stylesheet" type="text/css" />"));
    }

inside the css you write the font family you want to use

enricoariel
  • 483
  • 2
  • 10
  • But it's not a solution, in this case i need to declare which fonts it should use in which cases. So if for some language I don't declare any fonts it will display characters not correctly. I would like to system take care about changing fonts.. – ravenik Feb 16 '12 at 08:52