I have this code :
<option> 🇩🇪 Deutsch</option>
or
<option> 🇩🇪 Deutsch</option>
and I get this on Firefox :
but on Edge it looks like this :
What have I done wrong ?
Sadly, Windows comes without system Emoji font containing colourful flag ligatures (and many more glyphs from Emoji land). Since Chrome and Edge rely on system fonts, we see those simple characters and not the ligature.
Firefox (still) embeds its own nice fallback Emoji font based on Twitters ("Twemoji Mozilla") to mitigate this. So the only way to get it working across browsers is to provide webfont.
There is nicely usable Mozilla's Twemoji font compiled for web usage by Maxime Euziere at https://xem.github.io/unicode13/emoji.html :
/*
Licenses for TwemojiMozilla.ttf: https://github.com/mozilla/twemoji-colr/blob/master/LICENSE.md#license-for-the-visual-design
Derived from: https://twemoji.twitter.com/
Source: https://xem.github.io/unicode13/emoji.html
*/
#font-face {
font-family: "Twemoji from xem.github.io";
src: url("https://xem.github.io/unicode13/Twemoji.ttf") format("truetype");
unicode-range: U+00A9-E007F;
/* #see https://github.com/mozilla/twemoji-colr/issues/56 */
}
:root {
font-family: "Twemoji from xem.github.io", Segoe UI Emoji, Segoe UI Symbol, Segoe, sans-serif;
}
<p>🇩🇪 Deutsch
Related
Environment: Chrome v97 on Windows 10
It seems the variation selector for emoji is only respected if no font is specified, in which case OS would fallback to the correct glyph.
This is DevTools inspect on the first example (OS fallback). On "Computed" tab it shows the actual glyphs come from both "Segoe UI Emoji" (for emoji presentation) & "Segoe UI Symbol" (for text presentation) correctly.
However if I specify a font explicitly, either both text or both emoji
display, depending on the font order. No fallback to the next font in the list even if the glyphs of the other presentation are missing.
This means if I want to change the emoji font on a site, variation selector doesn't seem to work at all.
Why is that? Is there a workaround?
Sample code is attached
<style>
.emoji {
font-family: 'Segoe UI Emoji';
}
.symbol {
font-family: 'Segoe UI Symbol';
}
.symbol-emoji {
font-family: 'Segoe UI Symbol', 'Segoe UI Emoji';
}
.emoji-symbol {
font-family: 'Segoe UI Emoji', 'Segoe UI Symbol';
}
</style>
OS Fallback: <div>☹︎ ☹️</div>
Emoji: <div class="emoji">☹︎ ☹️</div>
Symbol: <div class="symbol">☹︎ ☹️</div>
Symbol emoji: <div class="symbol-emoji">☹︎ ☹️</div>
Emoji symbol: <div class="emoji-symbol">☹︎ ☹️</div>
The Segoe UI Symbol font doesn't support the variation sequences using U+FE0E, which is why you don't get the text variant in the "Emoji" case. (Segoe UI Symbol does support sequences with U+FE0F, though.)
As for the "Symbol Emoji" and "Emoji Symbol" cases, this is expecting the browser to decide on a font based on the variation sequences. Evidently Chromium doesn't handle that.
I’m writing a small static site (HTML and CSS) and stumbled about a behavior in the property font-family, which I don’t understand. I like to write my code consistent with a nice and clean look, that’s why always quote fonts in CSS.
As far as I understand the CSS2.2 specification correct, quoted fonts are allowed:
Font family names must either be given quoted as strings, or unquoted
as a sequence of one or more identifiers.
Unfortunately, it’s not working properly in my case. I attached an example below.
.test1
{
font-family: 'sans-serif';
}
.test2
{
font-family: 'arial';
}
.test3
{
font-family: sans-serif;
}
<h1 class="test1">Test</h1>
<h1 class="test2">Test</h1>
<h1 class="test3">Test</h1>
I tested the property with Google Chrome 54.0.2840.99 and Internet Explorer 11.0.9600.18450. Why is the quoted font for arial working but not for sans-serif?
Sans-serif is not the name of the font but the font type...
In order to make a font work, you have to type at least the font name!
Font name in required.
Ex
.myclass{font-family: 'myFontName', sans-serif;}
family-name - The name of a font-family, like "times", "courier", "arial", etc.
generic-family - The name of a generic-family, like "serif", "sans-serif", "cursive", "fantasy", "monospace".
Source
I have a set of embedded fonts that work fine in Firefox, Chrome, Safari - but, surprise, surprise, not in IE (v11, but tried in 10 and that didn't work either).
I can get some to load in IE, but not others. Sample of css:
/* working */
#font-face {
font-family: 'FoundersGroteskWeb-Semibold';
src: url(./fonts/FoundersGroteskWeb-Semibold.eot);
src: url(./fonts/FoundersGroteskWeb-Semibold.eot?#iefix) format('embedded-opentype'),
url(./fonts/FoundersGroteskWeb-Semibold.woff) format('woff');
font-style: normal;
font-weight: normal;
}
/* not working */
#font-face {
font-family: 'FoundersGroteskX-CondensedWeb-Bold';
src: url(./fonts/FoundersGroteskX-CondensedWeb-Bold.eot);
src: url(./fonts/FoundersGroteskX-CondensedWeb-Bold.eot?#iefix) format('embedded-opentype'),
url(./fonts/FoundersGroteskX-CondensedWeb-Bold.woff) format('woff');
font-style: normal;
font-weight: normal;
}
The fonts are served, all named correctly, etc. One difference I noticed is that all the other browsers were loading the woff file, whereas IE was using the (first, non #iefix) eot file. So I tried deleting all references to the eot files, forcing IE11 to use the woff. Again, it loaded the first one fine, but didn't use the second one (all other browsers loaded both with no problem).
When I check in the network tab on IE, I can see the 200 response for the first font, but there's nothing at all for the second font, looking like it might be choking on the parse of the css. However, given that the two declarations are identical apart from the font name, I can't see why that might be.
Anyone got any ideas what else I can try, because I've run out of straws to clutch at?
IE 9 (and I think 10 and 11 as well) have 31 character limit on font face name declaration. Please try and rename your font name to "FoundersGroteskX-CndWeb-Bld"; which is 30 characters, just to be safe (because this limitation of 31 characters is including quotes and semi-colon.
as per your earlier suggestion I also tried to minimize font names but this still does not work in latest IE:
</style>
<style type="text/css">
#font-face {
font-family:"Avenir";
src: url("./Fonts/Avenir.eot");
src: url("./Fonts/Avenir.eot?#iefix") format("embedded-opentype"),
url("./Fonts/Avenir.woff") format("woff");
}
</style>
Do you think IE no longer accepts woff fonts?
Check font download security, it should be enable to load font icon.
Navigate to:
IE>Internet options>Intranet>Custom Level>Downloads>Font Download
I'm using the Amatic SC 700 normal from google fonts.
This is the link on google fonts : https://www.google.com/fonts/specimen/Amatic+SC .
The issue is that right now the char ? is converted in ® .
The css code I used is:
#import url(http://fonts.googleapis.com/css?family=Amatic+SC:400,700);
body {
font-family: 'Amatic SC', cursive;
font-style: normal;
font-weight: 700;
}
The html looks like this :
<html> ???? </html>
This is a screenshot of the issue :
This is the jsfiddle link: http://jsfiddle.net/m4vev43a/
I tested this issue on:
Chrome Version 42.0.2311.90
Firefox 37.0.1
Opera 12.16
Any idea how I can fix this?
Are my browsers getting crazy?
Or it's a bug in the font?
Update:
When using :
#import url(http://fonts.googleapis.com/css?family=Amatic+SC);
So without the suffix :400,700 the question mark character is displayed properly.
Unfortunately using the above code + bold text is totaly messing up with the letter spacing in Chrome, Firefox, Opera.
This is a known issue with the bold version of the Amatic font, as can be seen in this bug report from November, 2011. Your font was implemented correctly, it's just that the font file itself has a bug.
A workaround is to use the regular variant for question marks. I know that's hardly a great solution but it seems there's not much else you can do.
One possible workaround I've used to recover this situation.
Note: is not perfect if you need to trust the letter spacing for each browser.
Actually the idea is :
define again the Amatic font in addition the std one, but without the :700
generate a special class to handle just the sentences with the question mark
#font-face {
font-family: 'Amatic';
src: url(http://fonts.gstatic.com/s/amaticsc/v6/DPPfSFKxRTXvae2bKDzp5FtXRa8TVwTICgirnJhmVJw.woff2) format('woff2'), url(http://fonts.gstatic.com/s/amaticsc/v6/DPPfSFKxRTXvae2bKDzp5D8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
}
.has-question-mark {
font-family: Amatic;
}
Im using ▾ and ✓ characters which are inputted by the user so I chant use their full html value (something like this ✓).
These are working fine in Chrome, FF and IE9. However in IE8 they are replaced by a square character (see image below).
When I want unicode characters on IE8, I use
<span class="unicode">unicode characters here</span>
and
.unicode {
font-family: 'DejaVu Serif';
}
#font-face {
font-family: 'DejaVu Serif';
src: url('fonts/DejaVuSerif.eot');
src:local('DejaVu Serif'),
local('DejaVu Serif Book'),
url('fonts/DejaVuSerif.eot?#iefix') format('embedded-opentype'),
url('fonts/DejaVuSerif.woff') format('woff'),
url('fonts/DejaVuSerif.ttf') format('truetype'),
url('fonts/DejaVuSerif.svg#font') format('svg');
}
Where DejaVu fonts are public domain fonts that provide a wider range of characters. You can download their .ttf fonts here, and convert them to the other types using online tools.
You can use the Wingdings font, but Mozilla and Opera are standard-compiliant. Wingdings is not standard (what a surprise coming from Microsoft) because not mapped to Unicode, and so should never be used on a website.
However, do not despair, most symbols are available in Unicode : check
http://www.alanwood.net/demos/wingdings.html
The symbol you want is number 252 in the list.