SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Jun 2006
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Typeface.js - headers dont work

    HI Folks,

    Cant get it to work on h1, h2, h3 tags etc.

    I have absolute links to my js files:

    <script type="text/javascript" src="http://www.mharrisweb.co.uk/wp-content/themes/mharrisweb/js/typeface-0.15.js"></script>
    <script type="text/javascript" src="http://www.mharrisweb.co.uk/wp-content/themes/mharrisweb/js/helvetiker_regular.typeface.js"></script>

    And my html is:

    <h1 class="typeface-js" style="font-family: Helvetiker;">My Own Agenda</h1>

    Here is a sample page:

    Untitled Document

    Text in the div renders fine, but header tags dont work, any help much appreciated.

    Thankyou

  2. #2
    SitePoint Evangelist
    Join Date
    Jun 2007
    Location
    North Yorkshire, UK
    Posts
    483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm wondering if it something simple like the semi-colon at the end of the style not being handled probably.

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2007
    Location
    North Yorkshire, UK
    Posts
    483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No that wasn't it.

    You have some code


    Code JavaScript:
    if (
                this.faces[style.fontFamily]  
                && this.faces[style.fontFamily][style.fontWeight]
            ) {
                face = this.faces[style.fontFamily][style.fontWeight][style.fontStyle];
            }

    style.fontWeight is bold for the h1 elements because of the browser's own stylesheet. There is not entry inf faces[Helvetiker] for bold, just normal.

    Had a style for h1 so that it is font-weight: normal; and it should work.

  4. #4
    SitePoint Addict
    Join Date
    Jun 2006
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks rot he reply

    I reconverted the font script and it worked.


Bookmarks

Posting Permissions

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