How can I get colour emois on the web - css

🍌 🙇‍♂️ 😖 👋 🐒 🥂 😢 🤔 😠 🤩 🙄 🥺 👐 😉 😠 🤯 🥒 😾 🤣 😈 😮 🙏 👍 ❤️ 😱 🥱
I am trying to replace a web based emoticon system based on a series of gif images that I implemented around 2008 sort of time with characters from the unicode set. The list of emojis that I display above is my choice of icons to replace the equivalent emoticon set I was using. Not perfect, but close enough.
Except that they are not in colour!
When I paste them , as I pasted them here into gedit, gedit displays them all in colour. However even though I took the font that I think gedit is using (Dejavu Sans Mono) loaded it into a web page using #font-face there are displays, as here in mostly black and white, with just a couple in colour. Am I doing something wrong?
Here is part of my css
.item {
height: 60px;
display: flex;
flex-direction: row;
font-family:'DejaVu Sans Mono', Helvetica, sans-serif;
scroll-snap-align:start;
border-radius: 5px;
box-shadow: 1px 1px 3px 0px rgba(0,0,0,0.31);
margin:0 5px 5px 3px;
}
#font-face {
font-family: 'DejaVu Sans Mono';
src: url('/fonts/DejaVuSansMono.ttf') format('truetype');
font-weight: normal;
font-style: normal;
font-display: swap;
}

I found a solution that works on my Chrome Desktop browser, my Android Phone and my Apple Ipad.
I downloaded this font
https://github.com/googlefonts/noto-emoji/blob/master/fonts/NotoColorEmoji.ttf
Put it in my /fonts directory where the web server could find it.
and then used the following in my CSS
#font-face {
font-family: 'NotoColorEmoji';
src: url('/fonts/NotoColorEmoji.ttf') format('truetype');
font-weight: normal;
font-style: normal;
font-display: swap;
}
and
.item {
height: 60px;
display: flex;
flex-direction: row;
font-family:'NotoColorEmoji', 'Roboto', Helvetica, sans-serif;
scroll-snap-align:start;
border-radius: 5px;
box-shadow: 1px 1px 3px 0px rgba(0,0,0,0.31);
margin:0 5px 5px 3px;
}
Now all my chosen emoji are in color.

Related

CSS3 #font-face causes the font file to output its sample text

I used the #font-face this way
#font-face {
font-family: 'SteelTongs';
src: url('../fonts/SteelTongs.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
section.page_heading .logo a {
font-size: 40px;
font-family: 'SteelTongs';
text-shadow: 0px 2px rgba(0,0,0,0.36);
color: #fff;
text-decoration: none;
float: left;
margin-right: 25px;
Now, what happens is the sample text normally in .ttf file shows in the logo container
Edit:
See http://www.had.omarsalim.biz
Here is a screen shot:
Notice the Header
Please help
I tested in chrome and firefox
I'm also tested with the SteelTongs web font in firefox and chrome, it is not supported,the font link is
abstractfonts- steeltongs ,U just change the font.

How do I embed a custom website font in ttf format for all browsers?

On my website I'm using a custom font which I have uploaded. It seems to be choosing when to work intermittently. It works on some computers/browsers, but not on others. It is also mapped correctly.
This is my code:
<style type="text/css">
#font-face {
font-family: 'AgencyFBRegular';
src: url('agencyr.eot');
src: url('agencyr.eot?#iefix') format('embedded-opentype'),
url('agencyr.woff') format('woff'),
url('AGENCYR.TTF') format('truetype'),
url('agencyr.svg#AgencyFBRegular') format('svg');
}
h3 { font-family: 'Agency FB', sans-serif; font-size: 26px; font-weight:normal; text-align: left; line-height: 100%;
border-bottom: 1px solid #484848; padding-bottom: 5px; margin-bottom:7px;
</style>
I thought it was working everywhere until I used a friend's laptop to view it.
Can you see where I'm going wrong?
UPDATE:
I have updated font CSS. It seems to be working, but now not on iOS.
The following code should work:
#font-face {
font-family:"AgencyFBRegular";
src: url("agencyr.eot") /* EOT file for IE */
}
#font-face {
font-family:"AgencyFBRegular";
src: url("agencyr.ttf") /* TTF file for CSS3 browsers */
}
h3 {
font-family:'Agency FB', sans-serif;
font-size: 26px;
font-weight:normal;
text-align: left;
line-height: 100%;
border-bottom: 1px solid #484848;
padding-bottom: 5px;
margin-bottom:7px;
}
You need change file name of your font without Uppercase. Like this: from AGENCYR.TTF to agencyr.ttf
and in your css file:
src: url('agencyr.ttf');

Cant reduce bold size of header 1

I am trying to make the font in h1 less bold. It seems like the letters are just to fat.
CSS:
h1 {color: #FFFFFF; font-family: ballparkweiner; font-size: 110px;
text-align: center; margin: 0px; }
#font-face {
font-family: 'ballparkweiner';
src: url('ballw___.eot');
src: url('ballw___.eot?#iefix') format('embedded-opentype'),
url('ballw___.woff') format('woff'),
url('ballw___.ttf') format('truetype'),
url('ballw___.svg#ballparkweiner') format('svg');
font-weight: normal;
font-style: normal;
}
h2 { margin: 0px; text-align: center; font-size: 40px; color: #FFFFFF; font-family: Cambria;}
body {background-color: #000000;}
h3 {text-align: center; color: #FFFFFF; }
#footer { font-weight: bold; text-align: center; font-family: Audimat;
clear: both; width:48%;
border-radius: 8px;
background-color:black;
text-align:center; margin-right:auto;
margin-left:auto; color: #FFFFFF; }
From the information I gathered on-line, most said to use font-weight: lighter;
but that doesn't validate when I use the css validator. Any ideas?
Add this:
h1 { font-weight: normal; }
By default, browsers use bold weight for h1. Since your #font-face declares only normal weight typeface, (some) browsers will algorithmically bold the glyphs (i.e., make the strokes wider using some simple method).
I checked your css validate, where did you checked? Probably you checked for css2 validation. Check here this one is original/best http://jigsaw.w3.org/css-validator/validator
I actually just added the font weight line (I had it under the #font face instead )
h1 {color: #FFFFFF; font-family: ballparkweiner; font-size: 110px;
text-align: center; margin: 0px; font-weight: lighter; }

Fonts aren't displaying uniformly

some elements on my website display perfectly, while other elements of the same font look grainy and choppy. I can't figure out why since I specify the style in the same way.
Here's my website:
http://violetoeuvre.com/
The side bar navigation (me, about, writing contact) is totally fine while the paragraph, h2, and footer styles are grainy and look like a rough version of the same type face.
CSS:
/* Fonts */
#import url(http://fonts.googleapis.com/css?family=Playfair+Display:400,700,900,400italic,700italic,900italic);
Funky styles:
h2 {
font-family: 'Playfair Display', sans-serif, 20px;
font-weight: 100;
line-height: 2em;
color: #000000;
letter-spacing: -1px;
margin: 0;
}
h3 {
font-family: 'Playfair Display', sans-serif, 12px;
font-weight: 100;
line-height: 2em;
color: #000000;
letter-spacing: -1px;
margin: 0;
}
#foot a:link {
font-family: 'Playfair Display', sans-serif;
font-size: 15px;
font-weight: 100;
color:#000;
text-decoration: none;
letter-spacing:0.2em;
}
These are functioning fine:
#emma_home a:link{
font-family: 'Playfair Display', serif;
font-size: 75px;
font-weight: 200;
color:rgba(255,255,255,1);
text-decoration: none;
letter-spacing:-4px;
}
#nav_menu a:link{
font-family: 'Playfair Display', serif;
font-size: 30px;
font-weight: 100;
color:rgba (255,255,255,1);
text-decoration: none;
text-align: center;
letter-spacing:0.2em;
}
#side_wrapper_text a:link{
font-family: 'Playfair Display', sans-serif;
font-size: 32px;
font-style: italic;
font-weight: 100;
color:#000000;;
text-decoration: none;
text-align: right;
letter-spacing:0.2em;
}
Also, on a PC the top Emma and Navigation (writing, blog, contact) are about 20 pixels ABOVE the black line, but on my Mac, the letters touch the white like I want.
What gives with these discrepancies??
Thanks.
I think you should move font-size property from font-family tag
and add it
font-family: sans-serif;
font-size : 12px;
check this W3 Schools they define 2 properties
Browsers behave differently with css some adapt the error some not
EDIT
You can save yourself from repeating code by putting the selector that have same styles mostly and then you can overwrite that style. for ex
h2,h3 {
font-family: 'Playfair Display', sans-serif;
font-size : 20px;
font-weight: 100;
line-height: 2em;
color: #000000;
letter-spacing: -1px;
margin: 0;
}
h3 {
font-size: 12px;
}
I see your a link has font weight property double than you defined for other so that may be the case for a tags but i dont see any other significant difference
I was confused as to why Playfair Display appeared grainy in my headings and paragraphs, but NOT in my sidebar navigation.
After some frustration, I realized that the typeface just looks bad at a certain (small) font.
Search for Playfair:
http://www.google.com/fonts/
As you can see, Normal 400 looks very weird, but in larger, bold, or italic styles, it looks just fine. The only thing to do was to choose a similar typeface for smaller styles, so I'm using Jacques Francois.
I'm a designer that works mostly in web but occasionally print as well. I think your issue may actually be with the Playfair font itself which I have just discovered is missing certain font styles when it displays on PCs (Macs look fine). I would test with another font before losing much more time.
As far as I can see IE prefers ttf format over woff and that specific exports is wrong. I simply downloaded the google font mercurial repo any converted original (otf) files with font squirrel, now it works.

Inline heading with background color using #font-face - not working on Mac in either Safari or FF

I have an inline heading (h1) with a background-color on the heading, but on Mac OS in both safari and Firefox it does not seem to stretch around the font. With a websafe font it works fine. Line height is set according to the font-size.
Any suggestions?
See visual expamle:
http://www.flickr.com/photos/hegerokenes/5038724235/
#font-face {
font-family: 'FedraMonoStd-Medium';
src: url('fonts/fedramonostd-medium-webfont.eot');
src: local('☺'), url('fonts/fedramonostd-medium-webfont.woff') format('woff'), url('fonts/fedramonostd-medium-webfont.ttf') format('truetype'), url('fonts/fedramonostd-medium-webfont.svg#webfontNCPrZ83i') format('svg');
font-weight: normal;
font-style: normal;
}
h1 {
font-size: 22px;
background-color: #999895;
line-height: 38px;
display: inline;
color: #fff;
padding: 3px;
}
try a little more padding, this should work without messing up the line-height. say
padding: 12px 3px 3px 3px;
at least it did with the font i was using...
Try floating left or display:inline-block instead, so it can be "blocky".

Resources