Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show some text if missing emoji in HTML

Tags:

html

Is there a way in HTML or Angular to show some text if an emoji is missing? For instance, the thinking face emoji is missing in Windows 8, so I was hoping to show some alternative text if possible.

The emoji code is 🤔

My HTML is simple:

<div ng-switch-when="folder"
     ng-bind-html="Some text &#x1f914;">
</div>
like image 757
AshD Avatar asked Oct 14 '25 04:10

AshD


1 Answers

I would recommend to use @font-face to import a font that you know contains the required unicode characters. Then, you can either use that font for all of the affected paragraphs, or just for the "emojis" by using the unicode-range descriptor.

Example:

@font-face {
  font-family: 'Someemojifont';
  src: url('some-emoji-font.otf');
  unicode-range: U+1F914; /* thinking face */
}

I understand that this isn't an exact answer to the question at hand, but it might still be a valid solution to the problem that motivated the question.

like image 64
domsson Avatar answered Oct 16 '25 19:10

domsson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!