Reputation: 108
I am trying to make a weather app using OpenWeatherMap api. Apparently,i am trying to update my element's text through javaScript with a temperature and a '℃' symbol. The problem is that the '℃' symbol is not using the font-family mentioned in the corresponding css whereas the temperature value is all fine. I have tried it this way-
$("#temp").text(data.temp+String.fromCharCode(8451));
Also,i tried this-
$("#temp").text(data.temp+String.fromCharCode(8451)).replace('font-family','Aclonica');
I searched for similar SO questions and googled for solution but got nothing. Any kind of help would be appreciated. thanks in advance.
Upvotes: 0
Views: 1072
Reputation: 20228
Most fonts only cover a certain range out of all possible (unicode) characters. Your font rendering engine will use the provided font if possible and use a fallback font to render characters for which the given font doesn't provide an icon / glyph.
This might explain your observation.
Solution: use a font with more glyphs / glyphs for all characters / code points you want to use - or add another (fallback-)font to your font-family
which covers the missing characters. See also Fallback fonts on special characters
Upvotes: 1