#1
  1. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Dec 2004
    Posts
    3,016
    Rep Power
    376

    Adding fonts domain/subdomain issues?


    i want to have all the fonts that i use in one place. so far it hasnt worked out so great.

    I have: mydomain.com/fonts/arial/font.woff font.blah blah..

    then in my subdomain.mydomain.com/index.html

    I try to do:

    Code:
    @font-face {
    	font-family: 'HotelsSansWeb';
    	src: url('domain/hotel_sans_web/regular/font.eot');
    	src: url('domain/hotel_sans_web/regular/font.eot?#iefix') format('embedded-opentype'),
    		 url('domain/hotel_sans_web/regular/font.woff') format('woff'),
    		 
    		 url('domain/hotel_sans_web/regular/font.svg#HotelsSansWeb') format('svg');
    	font-weight: normal;
    	font-style: normal;
    }
    firefox firebug's net tab reports as it being "fetched". If I move it locally to the subdomain i.e. subdomain.com/fonts/ it starts working.

    it makes me think it might be to do with the "internet policy of not allowing cross-domain files" but why does it apply to domain/sub-domain
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,129
    Rep Power
    4304
    Good question.

    You'll need to set a cross-origin resource sharing (CORS) HTTP header for font files on the hosting domain.

    HTTP access control (CORS)
    Troubleshooting Font-Face Problems
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Dec 2004
    Posts
    3,016
    Rep Power
    376
    thanks. That did it.

IMN logo majestic logo threadwatch logo seochat tools logo