font的使用

本文介绍了一种从Photoshop (PSD) 文件创建自定义Web字体的方法,包括使用Adobe Illustrator (AI) 和FontCreator软件进行字体编辑及通过在线工具完成最终的字体格式转换。

font字体操作:


一、psd中[导出内容]格式选ai;


二、用ai打开刚才导出的文件,然后复制下;


三、打开fontCreator,然后新建一个字形并打开,将ai复制的内容粘贴进来,并导出;


四、字体转换。打开(http://www.fontsquirrel.com/tools/webfont-generator),上传刚才导出的文件,选择basic,然后下载下来。




代码编写(sass编写的):
// icon-font.sass文件
$icon-font-path: "../fonts" !default;
$icon-font-family: "Ionicons" !default;
$icon-version: "1.4.1" !default;
$icon-prefix: my- !default;


@font-face {
	font-family: $icon-font-family;
	src:url("#{$icon-font-path}/ionicons.eot?v=#{$icon-version}");
	src:url("#{$icon-font-path}/ionicons.eot?v=#{$icon-version}#iefix") format("embedded-opentype"),
	url("#{$icon-font-path}/ionicons.ttf?v=#{$icon-version}") format("truetype"),
	url("#{$icon-font-path}/ionicons.woff?v=#{$icon-version}") format("woff"),
	url("#{$icon-font-path}/ionicons.svg?v=#{$icon-version}#Ionicons") format("svg");
	font-weight: normal;
	font-style: normal;
}
@font-face {
	font-family: "huawen";
	src:url("#{$icon-font-path}/hwxh.ttf?v=#{$ionicons-version}");
	font-weight: normal;
	font-style: normal;
}


.base-icon{
  display: inline-block;
  font-family: $icon-font-family;
  speak: none;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  text-rendering: auto;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}




//icon-variables.sass文件
$icon-var-person:"\f100";


//icon-icons.sass文件
.#{$icon-prefix}person:before{
	@extend .base-icon;
}
.#{$icon-prefix}person:before{
	content:$icon-var-person;
}

更多详情->
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值