Results 1 to 6 of 6

Thread: font-family CSS property broken?

  1. #1
    Basic Member
    Join Date
    Oct 2014
    Posts
    35

    font-family CSS property broken?

    I tried to apply the font-family property to a label, but it did not change the font. I tried the examples in the documentation (Arial and Comic Sans MS) and some others like Times but none of them work. Am I doing something wrong or is the property just not working?

  2. #2
    Basic Member Noya's Avatar
    Join Date
    Dec 2011
    Location
    Uruguay
    Posts
    12,904
    The property works but the examples don't.

    This one works:
    Code:
    font-family: Goudy Trajan Medium;

  3. #3
    Basic Member
    Join Date
    Oct 2014
    Posts
    35
    That's weird. I tried using the CSS web safe fonts and some of them (Verdana, Tahoma) work, but some of them don't. Is there a list of fonts which currently work with font-family so far?

  4. #4
    Basic Member
    Join Date
    Jul 2015
    Posts
    1
    Quote Originally Posted by ersafd View Post
    That's weird. I tried using the CSS web safe fonts and some of them (Verdana, Tahoma) work, but some of them don't. Is there a list of fonts which currently work with font-family so far?
    Not all web safe fonts are available on every operating system so they probably went with a few that are available/kern similarly across common OSes. Tahoma, Courier New and Verdana fit in that category quite well and all work.

    Goudy Trajan works because it was part of the base game I think, probably the only serif I see available besides Courier.

    Another font that was part of the base game was called "Radiance" (I can't find a whole lot of info on this font) and can be selected on Panorama right now. This font is the same font that you see on the overthrow load screen title. The dota 2 reborn version is a frankenstein'd sanserif, the 'W' character is distinctively from the font family Raleway, everything else is from the previous family called Radiance. Not really sure why they just didn't bring the whole raleway family instead.

  5. #5
    Valve Developer
    Join Date
    Jun 2014
    Posts
    36
    jaku78 is correct: we currently only support a subset of fonts that are supported on a variety of platforms. The list of fonts that we currently support are:
    * Arial
    * Tahoma
    * Marlett
    * DejaVu Sans
    * Courier
    * Courier New
    * Lucida Console
    * Verdana
    * Liberation
    * Radiance - our default UI font
    * Goudy Trajan Medium - our default title font
    * Gulim
    * MingLiU
    * FZLanTingHei-R-GBK - for Chinese glyphs in the default UI font
    * FZKai-Z03 - for Chinese glyphs in the default title font
    * TH Sarabun New - for Thai glyphs

    In general, I recommend not specifying font-family directly and instead using the existing defaults. This will ensure that not only does your UI match the DOTA UI, but it will also localize properly into many different languages. Here are the CSS classes that we currently use in the dashboard for fonts:

    Code:
    /* Default fonts */
    Label, TextEntry
    {
    	font-family: Radiance,FZLanTingHei-R-GBK,TH Sarabun New,Gulim,MingLiU;
    }
    
    /* Default font, but with monospaced numbers for use in things like the scoreboard */
    Label.MonoNumbersFont, TextEntry.MonoNumbersFont
    {
    	font-family: RadianceM,Radiance,FZLanTingHei-R-GBK,TH Sarabun New,Gulim,MingLiU;
    }
    
    /* Title Fonts */
    Label.TitleFont, TextEntry.TitleFont
    {
    	font-family: Goudy Trajan Medium,FZKai-Z03,TH Sarabun New;
    }

  6. #6
    Basic Member
    Join Date
    Oct 2014
    Posts
    35
    Thanks for the reply! It was very informative. I will update the wiki with this information so that other people who have the same question might see it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •