2014-10-22 2 views
1

내 나침반 디렉토리가이 같은 모양 글꼴 파일을 찾을 수 없습니다 : 글꼴 얼굴나침반 @ 글꼴 얼굴이

root_of_directory 
    sass 
    screen.scss 
    stylesheets 
    fonts 
     goudysto.ttf 
    screen.css 

다음 믹스 인은 다음과 같습니다

@include font-face("goudysto", font-files("goudysto.ttf", "truetype")); 

출력

GET file:///fonts/goudysto.ttf net::ERR_FILE_NOT_FOUND 

이 출력 된 CSS를

입니다 : 콘솔이 말한다
@font-face { 
    font-family: "goudysto"; 
    src: url('/fonts/goudysto.ttf') format('truetype'); 
    } 

왜 이런 일이 일어 났는지 말해 줄 수 있습니까?

* UPDATE - config.rb *

require 'compass/import-once/activate' 
# Require any additional compass plugins here. 

# Set this to the root of your project when deployed: 
http_path = "/" 
css_dir = "stylesheets" 
sass_dir = "sass" 
images_dir = "images" 
javascripts_dir = "javascripts" 
fonts_dir = "stylesheets/fonts" 

# You can select your preferred output style here (can be overridden via the command line): 
# output_style = :expanded or :nested or :compact or :compressed 

# To enable relative paths to assets via compass helper functions. Uncomment: 
# relative_assets = true 

# To disable debugging comments that display the original location of your selectors. Uncomment: 
# line_comments = false 


# If you prefer the indented syntax, you might want to regenerate this 
# project again passing --syntax sass, or you can uncomment this: 
# preferred_syntax = :sass 
# and then run: 
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass 
+0

URL에 '/'가 붙어 있기 때문에 글꼴 파일이 루트에서 찾고있는 것처럼 보이지 않습니다 (프로젝트가 프로젝트 폴더에있는 경우, 그 다음에 루트가 프로젝트보다 깊음). 시작 '/'을 제거해 보셨습니까? – somethinghere

+0

시작/자동 추가 중입니다. 나는 그것을 제거하는 방법을 모른다. – chap

+0

실제 CSS 파일에서 먼저 제거하여 문제가 해결되는지 확인한 다음 오류의 방향을 알 수 있습니다. – somethinghere

답변

0

는 다음과 같이 config.rb에 fonts_dir을 설정

fonts_dir = "stylesheets/fonts" 

편집 : 코멘트에 언급 한 바와 같이 또한, 확인하는 주석을 # relative_assets = true 및 config.rb에 상대 경로를 사용하십시오 ...

+0

내가 루트 디렉토리로 옮길 때 다음과 같이 나온다. GET 파일 : ///fonts/goudysto.ttf? 1413956247 net :: ERR_FILE_NOT_FOUND index.html : 1 숫자를 추가하는 것으로 보입니다. – chap

+0

대신 fonts_dir 설정을 시도해 보셨습니까? – elbblick

+0

그래, 나는 그것을 시도했다. 지금까지 행운이 없습니다. – chap

관련 문제