Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

kania

Instalar fonte

Recommended Posts

Bom dia galera,

 

Gente eu estou utilizando o o comando @font-face para instalação de fonte no pc do usuário porem utilizando o Google Chrome aparentemente ele sempre reinstala a fonte quando o usuário abre o site.

Alguém, sabe se existe alguma outra forma de verificar se a fonte já se encontra instalada no pc e somente se não estiver instalada então vai instalar?

 

Segue o código de instalação da font

 

@font-face {
   font-family: 'AllerRegular';
   src: local("AllerRegular"), url('aller_rg-webfont.eot');
   src: local("AllerRegular"), url('aller_rg-webfont.eot?#iefix') format('eot'),
        local("AllerRegular"), url('aller_rg-webfont.woff') format('woff'),
        local("AllerRegular"), url('aller_rg-webfont.ttf') format('truetype'),
        local("AllerRegular"), url('aller_rg-webfont.svg#webfontagEg336A') format('svg');
   font-weight: normal;
   font-style: normal;

}

@font-face {
   font-family: 'AllerLightRegular';
   src: local("AllerLightRegular"), url('aller_lt-webfont.eot');
   src: local("AllerLightRegular"), url('aller_lt-webfont.eot?#iefix') format('eot'),
        local("AllerLightRegular"), url('aller_lt-webfont.woff') format('woff'),
        local("AllerLightRegular"), url('aller_lt-webfont.ttf') format('truetype'),
        local("AllerLightRegular"), url('aller_lt-webfont.svg#webfontDz8TSvbR') format('svg');
   font-weight: normal;
   font-style: normal;

}

@font-face {
   font-family: 'AllerBold';
   src: local("AllerBold"), url('aller_bd-webfont.eot');
   src: local("AllerBold"), url('aller_bd-webfont.eot?#iefix') format('eot'),
        local("AllerBold"), url('aller_bd-webfont.woff') format('woff'),
        local("AllerBold"), url('aller_bd-webfont.ttf') format('truetype'),
        local("AllerBold"), url('aller_bd-webfont.svg#webfont4wervE6c') format('svg');
   font-weight: normal;
   font-style: normal;

}

@font-face {
   font-family: 'AllerItalic';
   src: local("AllerItalic"), url('aller_it-webfont.eot');
   src: local("AllerItalic"), url('aller_it-webfont.eot?#iefix') format('eot'),
        local("AllerItalic"), url('aller_it-webfont.woff') format('woff'),
        local("AllerItalic"), url('aller_it-webfont.ttf') format('truetype'),
        local("AllerItalic"), url('aller_it-webfont.svg#webfont0PzTMROt') format('svg');
   font-weight: normal;
   font-style: normal;

}

Compartilhar este post


Link para o post
Compartilhar em outros sites

inverta a ordem

 

de

 

local("AllerItalic"), url('aller_it-webfont.woff') format('woff'),
        local("AllerItalic"), url('aller_it-webfont.ttf') format('truetype'),

 

 

para

 

 local("AllerItalic"), url('aller_it-webfont.ttf') format('truetype'),
local("AllerItalic"), url('aller_it-webfont.woff') format('woff'),

 

 

 

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

Bom dia Evandro, então efetuei a modificação que você sugeriu, porem continua igual.

Veja como ficou com a modificação

 

@font-face {
   font-family: 'AllerRegular';
   src: local("AllerRegular"), url('aller_rg-webfont.eot');
   src: local("AllerRegular"), url('aller_rg-webfont.eot?#iefix') format('eot'),
	 local("AllerRegular"), url('aller_rg-webfont.ttf') format('truetype'),
        local("AllerRegular"), url('aller_rg-webfont.woff') format('woff'),
        local("AllerRegular"), url('aller_rg-webfont.svg#webfontagEg336A') format('svg');
   font-weight: normal;
   font-style: normal;

}

@font-face {
   font-family: 'AllerLightRegular';
   src: local("AllerLightRegular"), url('aller_lt-webfont.eot');
   src: local("AllerLightRegular"), url('aller_lt-webfont.eot?#iefix') format('eot'),
	 local("AllerLightRegular"), url('aller_lt-webfont.ttf') format('truetype'),
        local("AllerLightRegular"), url('aller_lt-webfont.woff') format('woff'),
        local("AllerLightRegular"), url('aller_lt-webfont.svg#webfontDz8TSvbR') format('svg');
   font-weight: normal;
   font-style: normal;

}

@font-face {
   font-family: 'AllerBold';
   src: local("AllerBold"), url('aller_bd-webfont.eot');
   src: local("AllerBold"), url('aller_bd-webfont.eot?#iefix') format('eot'),
	 local("AllerBold"), url('aller_bd-webfont.ttf') format('truetype'),
        local("AllerBold"), url('aller_bd-webfont.woff') format('woff'),
        local("AllerBold"), url('aller_bd-webfont.svg#webfont4wervE6c') format('svg');
   font-weight: normal;
   font-style: normal;

}

@font-face {
   font-family: 'AllerItalic';
   src: local("AllerItalic"), url('aller_it-webfont.eot');
   src: local("AllerItalic"), url('aller_it-webfont.eot?#iefix') format('eot'),
	 local("AllerItalic"), url('aller_it-webfont.ttf') format('truetype'),
        local("AllerItalic"), url('aller_it-webfont.woff') format('woff'),
        local("AllerItalic"), url('aller_it-webfont.svg#webfont0PzTMROt') format('svg');
   font-weight: normal;
   font-style: normal;

}

Compartilhar este post


Link para o post
Compartilhar em outros sites
utilizando o Google Chrome aparentemente ele sempre reinstala a fonte quando o usuário abre o site.

sim.

 

'pra mim', todos os browsers fazem isso.

 

não vejo como 'verificar se o cliente já tem a fonte instalada'.

 

o @font-face vai forçar de qq forma. Vai ser feito o download, mesmo que o cliente já tenha.

Não vejo como 'verificar se já tem'.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Não acho a melhor atitude verificar se o usuário já possui a fonte, visto que ele pode ter renomeado o arquivo e dai a fonte que ele tem com o nome "xxx" pode não ser a mesma que você tem com este mesmo nome "xxx" tanto que, repare como o fontsquirrel faz a inserção do fontface:

 


@font-face { 
font-family: 'WFont'; 
src: url('_fonts/regular-webfont.eot'); 
src: local('☺'), url('_fonts/regular-webfont.svg') format('svg'), url('_fonts/regular-webfont.woff') format('woff'), url('_fonts/regular-webfont.ttf') format('truetype');
}

 

Notem que ele seta: local('☺') para não ter perigo de acontecer este problema. Considere dar mais uma pesquisada a respeito mas concordo com o fontsquirrel.

 

Att

Leandro Rodeghiero

http://www.maisumpixel.com.br

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.