EmojiOne font does not work - font-face

I want to show all Emojis in my HTML page with the font EmojiOne.
Therefore I gave the class emoji to all the divs and spans which consist of emojis.
In my css I imported the font "EmojiOne" and assigned that font to the class Emoji.
<div class="emoji">💛💜💓🤣😗🤗🤗😘🤣😜</div>
#font-face {
font-family: EmojiOne;
src: url(./emojione-svg.otf);
}
.emoji{
font-family: EmojiOne, Helvetica, sans-serif;
}
The text with the class emoji is not shown in EmojiOne but Helvetica.

Related

Laravel DomPDF Custom Font Face Shows Square Boxes

I am trying to generate a PDF that will contain Chinese characters using dompdf and hence I downloaded the font package and added the following code in my blade.php.
#font-face {
font-family: 'simhei';
font-style: normal;
font-weight: normal;
src: url('{{base_path().'/public/fonts/'}}'simhei.ttf) format('truetype');
}
body {
font-family: 'simhei', 'DejaVu Sans', sans-serif;
}
Next, I tried the API again with Postman. The response body shows square boxes as shown below.
But if I highlighted the text, it shows the Chinese characters.
If I save the response as a file in Postman, it also shows square boxes instead of Chinese characters when I opened it in WPS Office.
I have also tried with other font packages including Firefly Sung and msyh. All give the same result.
Try this:
#font-face {
font-family: 'Firefly Sung';
font-style: normal;
font-weight: 400;
src: url(http://eclecticgeek.com/dompdf/fonts/cjk/fireflysung.ttf) format('truetype');
}
* {
font-family: Firefly Sung, DejaVu Sans, sans-serif;
}

Font-Awesome doesnt work in NativeScript although i followed every step

The Icons I included in Nativescript dont work.
I followed every Step in this tutorial but the Icons look like in the picture.
I tried using different versions of Font-Awesome.
The Desktop and the web-version. I know that the Web-Version is the right one but you never know.
I Included Font-Awesome like this.
.far {
font-family: 'Font Awesome 5 Free', fa-regular-400;
font-weight: 400;
}
.fab {
font-family: 'Font Awesome 5 Brands', fa-brands-400;
font-weight: 400;
}
.fas {
font-family: 'Font Awesome 5 Free', fa-solid-900;
font-weight: 900;
}
And i used it like so:
<Label class="far" style="font-size: 50em; color: blue" text=""></Label>
For custom fonts, you need to add the font file in a folder src/fonts.
Based on your picture, it's Android you are using, and on that platform, your CSS font-family must match the font file name, ie. FontAwesome if your font file is named FontAwesome.ttf.
On iOS the font family must match the name in the font file - check out https://www.nativescript.org/blog/using-custom-fonts-in-a-nativescript-app
for more details.
Edit: Maybe you are just missing quotes around the font (file) names,
ie.
.far {
font-family: 'Font Awesome 5 Free', 'fa-regular-400';
}
.fab {
font-family: 'Font Awesome 5 Brands', 'fa-brands-400';
}
.fas {
font-family: 'Font Awesome 5 Free', 'fa-solid-900';
}
I've created a Playground:
https://play.nativescript.org/?template=play-ng&id=yUV2G5
and the three icons are displayed correctly on iOS.

Icon Fonts in Shadow DOM

Is there a recommended way to let Icon Fonts (eq. FontAwesome/Octicons) bleed into the Shadow DOM?
At the moment, when I want to use an icon in a custom element's Shadow DOM I have to include parts of the ociticons.css file inline in the Shadow DOM:
#shadowroot
<style>
.octicon, .mega-octicon {
font: normal normal normal 16px/1 octicons;
display: inline-block;
text-decoration: none;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.mega-octicon { font-size: 32px; }
.octicon-search:before { content: '\f02e'} /*  */
</style>
<button>
<span class="mega-octicon octicon-search"></span>
</button>
(Apparently, #font-face does bleed into the Shadow DOM.)
No, there is no “recommended way” to use icon fonts just because those are simply a bundle of css and shadow DOM is intended to hide light css. So your request contradicts the purpose of shadowing.
The common approach is to build the component for showing font-related icons. Every custom component library has in fact it’s own component to show font-icons. Just google for font-awesome polymer or like. A random example.
Sidenote: #font-face does not bleed into shadow. It’s the directive setting the relation between fontname and the file where this font to take from, for those fonts which are not known to browser yet. That said, whether you’d try to declare:
#font-face {
font-family: my-octicons;
src: url('octicons.otf');
}
and then use it like:
font: normal normal normal 16px/1 my-octicons;
in shadow, it won’t be resolved. The reason it’s resolved in your case is that the browser knows where to take the font to show. In general, it’s the same case as if you were declaring:
font: Helvetica;
without any #font-face in before.
Hope this helps.

#font-face issue in IE7

I've got a crush on a certain font named "Kimberly" and I'm trying to use it on a heading / motto of a website.
Applying the #font-face css rule worked for all browsers except IE7 where the heading isn't displayed at all, not even with a fallback font.
And what's most annyoing is that other page [ an example page downloaded from fontsquirrel.com after the conversion of the .ttf font into .eot ] works perfectly on all browsers versions.
Have anyone been through something similar?
Please, take a look.
Thanks
Try adding zoom: 1 to the elements that are using your custom font. So for example:
#motto {
position: relative;
top: 20px;
color: #000;
font-family: "kimberleyregular", Arial, sans-serif;
font-style: normal;
font-weight: normal;
zoom: 1;
}

Changing the font size of code formatted by SyntaxHighlight GeSHi in MediaWiki

The font size of my code snippets are too small relative to the default font size of the Wiki, which makes them hard to read (see below for an example). Is there anything I can do to change it?
Example:
The code that generates the above is:
==== Histograms ====
This is the code to compute the histogram:
<source lang="matlab">
nEls = numel(unique_vals);
edges = zeros(nEls+2,1);
</source>
Edit the MediaWiki:Geshi.css.
Example:
div.mw-geshi div,pre {
font-family: monospace, "Courier New" !important;
font-size:13px;
}
edit your SyntaxHighlight_GeSHi.class.php
add font-size to following line
$css[] = ".source-$lang {line-height: normal; font-size: 12px;}";
Turns out this is a bug in the MediaWiki extension. It is referenced in the bug tracker at https://bugzilla.wikimedia.org/show_bug.cgi?id=26204
We can get a permanent fix in it, will poke some other peoples to get it properly fixed.
MediaWiki v1.19.23/24 with geshi 1.0.8.11/12:
Edit the Mediawiki:Geshi.css file to be:
/* CSS placed here will be applied to GeSHi syntax highlighting */
div.mw-geshi div,pre {
font-family: monospace, "Courier New" !important;
font-size:13px;
border: 1px dashed blue;
}
span.mw-geshi {
font-family: monospace, "Courier New" !important;
font-size:13px;
This will work for both the inline (<source lang="XXX" console="none">CODE</source>) and for the normal divs (<source lang="XXX">CODE</source>). The source is now preferred to be replaced with syntaxhighlight.

Resources