超赞网站推荐_字体(更多)超赞-标志性发明
超赞网站推荐
by Pubudu Dodangoda
通过Pubudu Dodangoda
字体(更多)超赞-标志性发明 (Font (More) Awesome — an iconic invention)
Whether you are building a website, a mobile app, or even a standalone app, there are few things you can never escape. The proper use of graphics and icons is one such basic need. Fancy icons are just as important as alignments and color combinations. That is because a single icon can express what a hundred words can say!
无论您是构建网站,移动应用程序,甚至是独立应用程序,都有很少的事情是您无法逃脱的。 正确使用图形和图标就是这种基本需求之一。 花式图标与路线和颜色组合一样重要。 那是因为单个图标可以表达一百个单词可以说的话!
While there are numerous ways to add icons to a website, the most popular way is to use Font Awesome. Once you perform the required configurations, adding an icon is as simple as this:
尽管有很多方法可以向网站添加图标,但是最流行的方法是使用“真棒字体”。 一旦执行了所需的配置,添加图标就这么简单:
<i class="fa fa-bell"></i>
Yet, there are situations where the icon set provided by Font Awesome is insufficient. For example, I recently wanted to use the logos of Facebook, Twitter, and Airbnb on a website. And it took me by surprise — the Airbnb icon was not included in Font Awesome. In fact, the community had requested the Airbnb icon about 3 years back. Yet the icon is still not in the official icon set.
但是,在某些情况下,Font Awesome提供的图标集不足。 例如,我最近想在网站上使用Facebook,Twitter和Airbnb的徽标。 这让我感到惊讶-“超棒”中未包含Airbnb图标。 实际上,社区早在3年前就已要求使用Airbnb图标。 但是该图标仍不在官方图标集中。
Also, if you want a custom icon which is not very popular, the least complex way to add it is using an img
tag. This is too much work compared to using Font Awesome. On the other hand, the Font Awesome guys can’t cater to all icon requests, practically speaking.
此外,如果您希望使用的自定义图标不是很流行,则添加图标最简单的方法是使用img
标签。 与使用Font Awesome相比,这是太多的工作。 另一方面,实际上,Font Awesome家伙无法满足所有图标要求。
So I searched for an easy way to get the icons I needed, without depending on a third party. Luckily, I found a tool called Calligraphr. I’ll now explain how I used this tool, some CSS knowledge, and few other simple tricks to be able to do the following in my code:
因此,我寻求一种简单的方法来获取所需的图标,而无需依赖第三方。 幸运的是,我找到了一个名为Calligraphr的工具。 现在,我将解释如何使用此工具,一些CSS知识以及一些其他简单的技巧,以便能够在我的代码中执行以下操作:
<i class="fa fa-troll"/><i class="fa fa-like-a-boss"/><i class="fa fa-lol"/>
Pretty cool right? Then let’s build Font More Awesome!
很酷吧? 然后, 让我们构建更棒的字体!
创建字体 (Creating a Font)
The first milestone on our journey is to create the Font More Awesome font using the instructions on their website. The first step is to download the template. Here is an example:
我们旅程中的第一个里程碑是使用其网站上的说明来创建Font More Awesome字体。 第一步是下载模板。 这是一个例子:
Now what we have to do is fill in these boxes with our desired icons. You can either print and draw the icons by hand, or use a tool like Adobe Photoshop or GIMP to use images downloaded from the internet.
现在,我们要做的是在这些框中填写所需的图标。 您可以手工打印和绘制图标,也可以使用Adobe Photoshop或GIMP之类的工具来使用从Internet下载的图像。
After filling the template, it will look as follows:
填写模板后,它将如下所示:
The next thing you have to do is quite simple. Just upload the filled template to the calligraphr website, and click on the “build font” button — and BOOM! Your custom font will be downloaded. Let’s name it FontMoreAwesome.otf
接下来要做的很简单。 只需将填充的模板上传到书法家网站,然后单击“构建字体”按钮-即可! 您的自定义字体将被下载。 让我们将其命名为FontMoreAwesome.otf
If you are wondering what magic just happened, it’s called image vectorization or Image Tracing. Because of the underlying tracing algorithm, you might notice slight differences between the image used and the actual icon created. But, once the images are converted to a vector, they can scale up and down, without losing quality.
如果您想知道发生了什么魔术,那就叫图像矢量化或图像跟踪。 由于底层的跟踪算法,您可能会注意到所使用的图像和创建的实际图标之间存在细微差异。 但是,一旦将图像转换为矢量,它们就可以放大和缩小,而不会损失质量。
与Font Awesome集成 (Integrating with Font Awesome)
Of course you can treat the new font file as a separate icon set. But wouldn’t it be cool if we could extend the Font Awesome font itself? Let’s do it!
当然,您可以将新字体文件视为单独的图标集。 但是,如果我们可以扩展Font Awesome字体本身,那不是很酷吗? 我们开始做吧!
One thing that you should understand here is that we are going to inherit the CSS rules defined by the Font Awesome CSS file. For example, it will contain an entry as follows:
您在这里应该了解的一件事是,我们将继承由Font Awesome CSS文件定义CSS规则。 例如,它将包含如下条目:
.fa { display: inline-block; font: normal normal normal 14px/1 FontAwesome; font-size: inherit; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;}
That means that when we define an icon element as follows, it will inherit styles such as display
, font-size
, and text-rendering
from the above.
这意味着当我们按如下方式定义图标元素时,它将从上面继承样式,例如display
, font-size
和text-rendering
。
<i class="fa fa-troll"/>
Now let’s define our custom CSS file. Let’s name the file font-more-awesome.css
现在,让我们定义我们的自定义CSS文件。 让我们将文件命名为font-more-awesome.css
The first entry of this file should be the font-face declaration. This can be done as follows. No big deal. Just some basic CSS.
该文件的第一个条目应该是字体声明。 这可以如下进行。 没什么大不了的。 只是一些基本CSS。
@font-face { font-family: 'FontMoreAwesome'; src: url('../fonts/FontMoreAwesome.otf'); font-weight: normal; font-style: normal;}
Then we can easily define the custom icons we want like this:
然后,我们可以像这样轻松定义所需的自定义图标:
.fa-troll:before { font-family: FontMoreAwesome; content: "A";}.fa-lol:before { font-family: FontMoreAwesome; content: "B";}.fa-like-a-boss:before { font-family: FontMoreAwesome; content: "C";}
Note here that we are defining the icons as pseudo-elements using the before
selector. That way, we can inject the content we want into the element which uses these classes.
请注意,这里我们使用before
选择器将图标定义为伪元素。 这样,我们可以将所需的内容注入使用这些类的元素中。
In the FontMoreAwesome font we created, “A,” “B,” and “C” are represented by the icons for Troll, Lol, and Like-a-boss respectively. This is not the best way to do it, though.
在我们创建的FontMoreAwesome字体中,“ A”,“ B”和“ C”分别由Troll,Lol和Like-a-boss的图标表示。 但是,这并不是最好的方法。
Font Awesome uses Unicode Private Use Area (PUA) to ensure screen readers do not read off random characters that represent icons.
Font Awesome使用Unicode专用区(PUA)来确保屏幕阅读器不会读取代表图标的随机字符。
But for our example, we’ll stick with the English alphabet letters to keep the story simple.
但在我们的示例中,我们将坚持使用英文字母以使故事保持简单。
Another thing to note in the above example is that we override the font-family defined by Font Awesome while injecting custom content.
在上面的示例中要注意的另一件事是,在注入自定义内容时,我们将覆盖由Font Awesome定义的字体系列。
让我们使用更棒的字体 (Let’s Use Font More Awesome)
The final step is to load this CSS file into the index.html file, which is pretty easy.
最后一步是将该CSS文件加载到index.html文件中,这非常简单。
<link href="css/font-more-awesome.css" rel="stylesheet">
Now you can use these icons as any other fa
icon. For example, the following icon will be large and will spin.
现在,您可以将这些图标用作其他任何fa
图标。 例如,以下图标将很大并且会旋转。
<i class="fa fa-troll fa-spin fa-lg"/>
你喜欢这个故事吗? 然后,您可以做一件事... (Did you enjoy this story? Then there’s one little thing you could do…)
翻译自: https://www.freecodecamp.org/news/lets-use-font-more-awesome-to-make-an-iconic-invention-a95324d92ace/
超赞网站推荐
相关文章:

JAVA中的垃圾回收机制以及其在android开发中的作用
http://blog.csdn.net/xieqibao/article/details/6707519 这篇文章概述了JAVA中运行时数据的结构,以及垃圾回收机制的作用。在后半部分,描述了如何检测和定位ANDROID程序是否内存溢出。转载于:https://www.cnblogs.com/u3shadow/p/4379336.html

微信小程序把后台传过来的数组坐标展示在地图上
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 功能实现: 1. 根据后台传递过来的数据,包括地址名字,经纬度坐标等都展示在map组件上; 2. 点击相应地址实现用户当前位置导航至点击的…

Flask-login Question
1 未登录访问鉴权页面如何处理? 如果未登录访问了一个作了 login_required 限制的 view,那么 Flask-Login 会默认 flash一条消息,并且将重定向到login_view,如果你没有指定login_view,那么 Flask-Login 将会抛出一个 4…

愉快的舞会c++_如何在5分钟内建立一个令人愉快的加载屏幕
愉快的舞会cFirst, here is what we will build. Set your timer!首先,这是我们将要建立的。 设置您的计时器! Does this look familiar?这看起来很熟悉吗? If yes, that’s because you’ve seen this somewhere — Slack!如果是…

有关C/C++中,表达式计算顺序的问题,以及表达式内部变量“副作用”问题(转)...
经常可以在一些讨论组里看到下面的提问:“谁知道下面C语句给n赋什么值?”m 1; n mm;最近有位不相识的朋友发email给我,问为什么在某个C系统里,下面表达式打印出两个4,而不是4和5:a 4; cout << a &…

HDU 3001
题目中说明每个城市至少要走一次,至多走2次,因此要用到三进制压缩,然后就是状态转移方程了。 这道题就处理三进制的地方麻烦一点。同时注意,在选择最小长度时,一定是要每一个点都经过至少一次的,即是状态的…

微信小程序 侧滑效果实现
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 先看效果图: 源码: <view wx:if{{if_show}} class{{show_centent?"show":"hide"}} /> <button bindtapbtn>展示 or 隐藏&l…

im和音视频开发哪个更好_如何阅读成为更好的开发者的方式
im和音视频开发哪个更好by nolan grace通过诺兰格雷斯 如何阅读成为更好的开发者的方式 (How to read your way to becoming a better developer) If you want to get better at programming, there are two things you need to do:如果您想提高编程水平,则需要做两…

MVC3学习 四 EF删除操作
由于EF的框架是4.1的,所以现在如果想更新部分字段的话,只能从数据库中查出一次数据(不用查的方法还没找到,需要继续研究),不能像5.1的版本可以不用查。 更新的Action需要用到[HttpGet]和[HttpPost]…

ThinkPHP5.0中Redis的使用和封装(原创)
Redis是一种常用的非关系型数据库,主要用作数据缓存,数据保存形式为key-value,键值相互映射.它的数据存储跟MySQL不同,它数据存储在内存之中,所以数据读取相对而言很快,用来做高并发非常不错. ThinkPhP5.0自带了Redis扩展,在使用之前先下载php_redis.dll 网址 http://windows.p…

【微信小程序之画布】四:手指触摸绘波浪线
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 功能:根据手指触摸绘画一条直线路径--> 起点为手指开始触摸时的坐标,终点为手指触摸结束时的坐标 效果图: 上代码: <canvas clas…

saas的计费数据库设计_如何构建和扩展SaaS计费解决方案
saas的计费数据库设计您需要的最低可行产品 (What you need for a Minimum Viable Product) When you are building your Software as a Service (Saas) Minimum Viable Product (MVP), there is a lot of work that needs to be done. It can be difficult to balance this wo…

关于一对多,多对多的多表查询的控制
一、一对多 以班级Classes和学生Student为例:回忆sql语句://内链接,两种方式效果一样,查询的是两边都有的数据SELECT c.*,s.* FROM classes c,student s WHERE s.cidc.cid;SELECT c.cname,s.sname FROM classes c INNER JOIN student s ON s.cidc.cid;//左外连接&am…

JavaScript对象,方括号和算法
by Dmitri Grabov德米特里格拉波夫(Dmitri Grabov) JavaScript对象,方括号和算法 (JavaScript Objects, Square Brackets and Algorithms) One of the most powerful aspects of JavaScript is being able to dynamically refer to properties of objects. In this…

《Java 8 实战》(二)—— Lambda
Lambda表达式可以理解为简洁地表示可传递的匿名函数的一种方式:它没有名称,但它有参数列表/函数主体/返回类型,可能还有一个可以抛出的异常列表。 Lambda表达式由参数/箭头和主体组成: (Apple a1, Apple a2) -> a1.getWeight(…

c++回调函数 callback
(1)Callback方式Callback的本质是设置一个函数指针进去,然后在需要需要触发某个事件时调用该方法, 比如Windows的窗口消息处理函数就是这种类型。比如下面的示例代码,我们在Download完成时需要触发一个通知外面的事件:…

【微信小程序之画布】终:手指触摸画板实现
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 先看效果图: wxml <!--pages/shouxieban/shouxieban.wxml--> <view class"container"><view>手写板(请在下方区域手写内容&…

Android开发中应避免的重大错误
by Varun Barad由Varun Barad Android开发中应避免的重大错误 (Critical mistakes to avoid in Android development) As many pioneers and leaders in different fields have paraphrased:正如许多不同领域的开拓者和领导人所说: In any endeavor, it is import…
机房收费系统(VB.NET)——超具体的报表制作过程
之前做机房收费系统用的报表是GridReport,这次VB.NET重构中用到了VisualStudio自带的报表控件。刚開始当然对这块功能非常不熟悉,只是探究了一段时间后还是把它做出来了。 以下把在VisualStudio(我用的是VisualStudio2013,假设与您…

微信小程序实现画布自适应各种手机尺寸
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 解决的问题: 画布,动画等js里面的操作,默认是px而不是rpx, 无法根据手机屏幕自适应 达到的效果: 让画布,动画在不同分辨…

网易新闻首页实现
http://www.2cto.com/kf/201409/330299.html IOS后台运行机制详解(二) http://blog.csdn.net/enuola/article/details/9148691转载于:https://www.cnblogs.com/itlover2013/p/4403061.html

阿联酋gitex_航空公司网站不在乎您的隐私后续行动:阿联酋航空以以下方式回应我的文章:...
阿联酋gitexby Konark Modi通过Konark Modi 航空公司网站不在乎您的隐私后续行动:阿联酋航空对我的文章进行了全面否认 (Airline websites don’t care about your privacy follow-up: Emirates responds to my article with full-on denial) Yesterday, The Regis…

微信小程序把缓存的数组动态渲染到页面
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 代码实现的目的:当页面销毁的时候,页面的参数状态还是能够保存。 show_img函数实现: 创建一个数组保存到缓存,遍历缓存的list_stutas对…

Find Minimumd in Rotated Sorted Array
二分搜索查最小数,from mid to分别为区间的第一个,中位数,和最后一个数 if(from<mid&&mid<to)//顺序,第一个即为最小值 return from; if(from>mid)//发现逆序,则最小值在这个区间,2分搜索…

在DataTable中更新、删除数据
在DataTable中选择记录 /*在DataTable中选择记录*//* 向DataTable中插入记录如上,更新和删除如下:* ----但是在更新和删除前,首先要找出要更新和删除的记录。* 一种方法是遍历DataRow,搜索想要的记录,* --〉然而更聪明的办法是使用…

使用TensorFlow进行机器学习即服务
by Kirill Dubovikov通过基里尔杜博维科夫(Kirill Dubovikov) 使用TensorFlow进行机器学习即服务 (Machine Learning as a Service with TensorFlow) Imagine this: you’ve gotten aboard the AI Hype Train and decided to develop an app which will analyze the effective…
浏览器加载、解析、渲染的过程
最近在学习性能优化,学习了雅虎军规 ,可是觉着有点云里雾里的,因为里面有些东西虽然自己也一直在使用,但是感觉不太明白所以然,比如减少DNS查询,css和js文件的顺序。所以就花了时间去了解浏览器的工作&…

《转》java设计模式--工厂方法模式(Factory Method)
本文转自:http://www.cnblogs.com/archimedes/p/java-factory-method-pattern.html 工厂方法模式(别名:虚拟构造) 定义一个用于创建对象的接口,让子类决定实例化哪一个类。Factory Method使一个类的实例化延迟到其子类…

微信小程序去除左上角返回的按钮
微信小程序开发交流qq群 173683895 承接微信小程序开发。扫码加微信。 正文: 解决方法有两种; 1.把该页面设置为tab页面或者主页 ; 2.进入该页面使用 wx.reLaunch(); 示例 wx.reLaunch({url: ../detail/detail,}) 这样有一个弊端,就是…

我的第一个web_登陆我的第一个全栈Web开发人员职位
我的第一个webby Robert Cooper罗伯特库珀(Robert Cooper) 登陆我的第一个全栈Web开发人员职位 (Landing My First Full Stack Web Developer Job) This is the story of the steps I took to get my first job as a full stack web developer. I think it’s valuable to sha…