Sudomemo / Sudofont

Icon font version of the Nintendo DS' special font characters
MIT License
16 stars 2 forks source link

sudofont should replace both Nintendo's PUA characters and the emoji with the Nintendo-style glyphs #2

Closed sudofox closed 2 years ago

sudofox commented 7 years ago

This way, we can have the DSi style emoji on the site while still having the right 'equivalent' ones show up on OpenGraph, sharing, Google, and so on.

Right now I switched it to this:

<?php

// new version of stringToEmoji to use actual globally-supported emoji substitutes

function stringToEmoji ($string) {

$nintendoPUA = [ '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '//', '/󺜀/', '/󺜀/' ];

$replacementCharacters = ['😃', '😠', '😔', '😑', '☀', '☁', '☔', '⛄', '✉', '📱', '⏰', 'Ⓐ', 'Ⓑ', 'Ⓧ', 'Ⓨ', 'Ⓛ', 'Ⓡ', '➕', '♠', '♦', '♥', '♣', '❗', '❓', '➡', '⬅', '⬆', '⬇', '✕', '🐸' ];

return  preg_replace($nintendoPUA, $replacementCharacters, $string);

}

replacing the other characters with the Sudofont glyphs will restore the DSi symbols to Theatre whilst making them show up properly everywhere else.