Programing

다운로드 한 글꼴을 해독하지 못했습니다

crosscheck 2020. 7. 9. 08:09
반응형

다운로드 한 글꼴을 해독하지 못했습니다


이것은 Chrome에서 발생하는 오류이며 불행히도 검색하면 많은 결과를 얻지 못했습니다. 글꼴 자체가 올바르게 나타납니다. 그러나 여전히이 오류 / 경고가 나타납니다. 보다 구체적으로 이것은 전체 경고입니다.

"다운로드 한 글꼴을 해독하지 못했습니다 : http : // localhost : 8000 / app / fonts / Lato / "

내 CSS는 다음과 같습니다.

@font-face {
    font-family:"Lato";
    src: url("../fonts/Lato/");
}

html, body {
    font-family:'Lato';
}

나는 단지 이해하지 못한다. 글꼴이 올바르게 적용되지만 항상 경고가 표시됩니다. 사용하려고 Sans-Serif하면 글꼴이 일반 브라우저 글꼴로 되돌아갑니다. 그래도 확실하지 않으며 검색 후에도 아무것도 찾지 못했습니다. 감사!

편집하다

같은 패밀리의 다양한 글꼴 파일이 있습니다. 나는 그들을 모두로드하려고합니다. 글꼴 파일은 .ttf입니다. 나는 로컬 폴더에서 그들을로드하고, 다양한 글꼴 파일과 같은,있다 Lato-Black.ttf, Lato-Bold.ttf, Lato-Italic.ttf


CSS 규칙에서 파일의 확장자를 추가해야합니다. 가능한 가장 깊은 지원을 제공하는이 예는 다음과 같습니다.

@font-face {
  font-family: 'MyWebFont';
  src: url('webfont.eot'); /* IE9 Compat Modes */
  src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('webfont.woff2') format('woff2'), /* Super Modern Browsers */
       url('webfont.woff') format('woff'), /* Pretty Modern Browsers */
       url('webfont.ttf')  format('truetype'), /* Safari, Android, iOS */
       url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}

편집하다:

"다운로드 한 글꼴을 디코딩하지 못했습니다"는 글꼴이 손상되었거나 불완전하다는 것을 의미합니다 (메트릭, 필요한 테이블, 이름 지정 레코드, 가능한 수백만 가지).

때때로이 문제는 글꼴 자체에 의해 발생합니다. Google 글꼴은 올바른 글꼴을 제공하지만 글꼴이 필요한 경우 Transfonter사용 하여 모든 글꼴 형식을 생성합니다.

때때로 FTP 클라이언트가 파일을 손상 시켰습니다 (이 경우 로컬 PC에 있기 때문에). ASCII가 아닌 바이너리로 파일을 전송하십시오.


format ( 'woff')에서 format ( 'font-woff')으로 변경하면 지금이 문제를 해결하는 데 도움이됩니다.

Germano Plebani 답변에서 약간의 변경 사항을 변경하십시오.

 @font-face {
  font-family: 'MyWebFont';
  src: url('webfont.eot'); /* IE9 Compat Modes */
  src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('webfont.woff2') format('woff2'), /* Super Modern Browsers */
       url('webfont.woff') format('font-woff'), /* Pretty Modern Browsers */
       url('webfont.ttf')  format('truetype'), /* Safari, Android, iOS */
       url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}

브라우저 소스에서 열 수 있는지 확인하고 유형은 무엇입니까


Visual Studio에서 비슷한 url()글꼴 문제 가 발생하여 문제의 글꼴 경로가 잘못 되었습니다.

변경 한 후이 오류가 발생하는 것을 멈췄습니다 (예 :).

@@font-face{
    font-family: "Example Font";
    src: url("/Fonts/ExampleFont.eot?#iefix");

이에:

@@font-face{
    font-family: "Example Font";
    src: url("../fonts/ExampleFont.eot?#iefix");

서버가 올바른 mime / type을 사용하여 글꼴 파일을 전송하고 있는지 확인하십시오 .

최근에 일부 글꼴 마임 유형이 바닐라 파일에 없기 때문에 nginx를 사용하는 것과 동일한 문제 /etc/nginx/mime.types있습니다.

I fixed the issue adding the missing mime types in the location where I needed them like this:

location /app/fonts/ {

  #Fonts dir
  alias /var/www/app/fonts/;

  #Include vanilla types
  include mime.types;

  #Missing mime types
  types  {font/truetype ttf;}
  types  {application/font-woff woff;}
  types  {application/font-woff2 woff2;}
}

You can also check this out for extending the mime.types in nginx: extending default nginx mime.types file


I had to add type="text/css" to my link-tag. I changed it from:

<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700" rel="stylesheet">

to:

<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:300,400,700" rel="stylesheet" type="text/css">

After I changed it the error disappeared.


I just had the same issue and solved it by changing

src: url("Roboto-Medium-webfont.eot?#iefix")

to

src: url("Roboto-Medium-webfont.eot?#iefix") format('embedded-opentype')

Sometimes this problem happens when you upload/download the fonts using the wrong FTP method. Fonts must be FTP-ed using binary method, not ASCII. (Depending on your mood, it may feel counterintuitive, lol). If you ftp the font files using ASCII method, you can get this error message. If you ftp your files with an 'auto' method, and you get this error message, try ftp forcing the binary method.


For me, this error was occuring when I referenced a google font using https. When I switched to http, the error went away. (and yes, I tried it multiple times to confirm that was the cause)

So I changed:

@import url(https://fonts.googleapis.com/css?family=Roboto:300,400,100,500,900);

To:

@import url(http://fonts.googleapis.com/css?family=Roboto:300,400,100,500,900);

I was having the same issue with font awesome v4.4 and I fixed it by removing the woff2 format. I was getting a warning in Chrome only.

@font-face {
  font-family: 'FontAwesome';
  src: url('../fonts/fontawesome-webfont.eot?v=4.4.0');
  src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.4.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.4.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.4.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.4.0#fontawesomeregular') format('svg');
  font-weight: normal;
  font-style: normal;
}

In my case it was caused with an incorrect path file, in .htaccess. please check correctness of your file path.


For me, the mistake was forgetting to put FTP into binary mode before uploading the font files.

Edit

You can test for this by uploading other types of binary data like images. If they also fail to display, then this may be your issue.


I also had same problem but i have solved by adding 'Content-Type' : 'application/x-font-ttf' in response header for all .ttf files


In my case, this was caused by creating a SVN patch file that encompassed the addition of the font files. Like so:

  1. Add font files from local file system to subversioned trunk
  2. Trunk works as expected
  3. Create SVN patch of trunk changes, to include addition of font files
  4. Apply patch to another branch
  5. Font files are added to subversioned branch (and can be committed), but are corrupted, yielding error in OP.

The solution was to upload the font files directly into the branch from my local file system. I assume this happened because SVN patch files must convert everything to ASCII format, and don't necessarily retain binary for font files. But that's only a guess.


In my case when downloading a template the font fileswere just empty files. Probably an issue with the download. Chrome gave this generic error about. I thought at first the solution of changing from woff to font-woff solved it, but it only made Chrome ignore the fonts. My solution was finding the fonts one by one and downloading/replacing them.


In my case -- using React with Gatsby -- the issue was solved with double-checking all of my paths. I was using React/Gatsby with Sass and the Gatsby source files were looking for the fonts in a different place than the compiled files. Once I duplicated the files into each path this problem was gone.


If you are using express you need to allow serving of static content by adding something like: var server = express(); server.use(express.static('./public')); // where public is the app root folder, with the fonts contained therein, at any level, i.e. public/fonts or public/dist/fonts... // If you are using connect, google for a similar configuration.


I use .Net Framework 4.5/IIS 7

To fix it I put file Web.config in folder with font file.

Content of Web.config:

<?xml version="1.0"?>
<configuration>
  <system.web>
    <authorization>
      <allow users="*" />
    </authorization>
  </system.web>
</configuration>

for me it was a problem with lfs files that were not downloaded

git lfs fetch --all

fixed the problem.

see https://github.com/git-lfs/git-lfs/issues/325


If it is on the server (not in localhost), then try to upload the fonts manually, because sometimes the FTP client (for example, FileZilla) corrupts the files and it can cause the problem. For me, I uploaded manually using Cpanel interface.

참고URL : https://stackoverflow.com/questions/30442319/failed-to-decode-downloaded-font

반응형