掲示板

Insert fonts family with css

9年前 に Eloy Fernández によって更新されました。

Insert fonts family with css

New Member 投稿: 8 参加年月日: 15/01/06 最新の投稿
Hello everybody.

I am trying to change the font type to a div using this:


@font-face 
{ 
	font-family: "digital-7"; 
	src: url("../fonts/digtal-7.ttf") format("ttf"); 
}
.result
{
	width:162px;
	height:30px;
	margin:3px;
	background-color: #3CB371;
	font-family: "digital-7";
}


The fonts folder is on the same level that the css folder... on the css and the fonts folders are on other folder called docroot. Everything on the result class works except the font-type.
Is it necessary make something on the liferay-portlet.xml (something like header-portlet-css, but for the fonts)?? Or Do I have something wrong on the src:url (I tried too with src: url("./fonts/digtal-7.ttf") format("ttf");)??

THANK YOU VERY MUCH.
thumbnail
9年前 に Juan Gonzalez によって更新されました。

RE: Insert fonts family with css

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Hola Eloy,

I remember some kind of "bug" that didn't transformed the url properly.

Try to remove the quotes inside url( ) and rebuild your plugin and deploy.
9年前 に Eloy Fernández によって更新されました。

RE: Insert fonts family with css

New Member 投稿: 8 参加年月日: 15/01/06 最新の投稿
Buff!! I tried every ways. On the font-face:


src: url("../fonts/digtal-7.ttf") format("ttf"); 
src: url("./fonts/digtal-7.ttf") format("ttf");
src: url(../fonts/digtal-7.ttf) format("ttf");  
src: url(./fonts/digtal-7.ttf) format("ttf"); 


And on the class:


font-family: "digital-7";
font-family: digital-7;


But no one works... any idea??