Are there UTF-8 fonts?

I'm looking for UTF-8 fonts to add to my webpage, but I can't find.

(function() {
  var link_element = document.createElement("link"),
    s = document.getElementsByTagName("script")[0];
  if (window.location.protocol !== "http:" && window.location.protocol !== "https:") {
    link_element.href = "http:";
  }
  link_element.href += "//fonts.googleapis.com/css?family=Josefin+Slab:100italic,100,300italic,300,400italic,400,600italic,600,700italic,700";
  link_element.rel = "stylesheet";
  link_element.type = "text/css";
  s.parentNode.insertBefore(link_element, s);
  document.getElementsByTagName("html")[0].style.fontStyle = "Josefin Slab";
})();
      

* {
  font-family: "Josefin Slab";
  font-size: 30px;
}
      

This happens when I write Ő, Ε°, Ε‘ or Ε±
      

Run codeHide result


I want to display "Ő", "Ε°", "Ε‘" and "Ε±". Can anyone please help?

+3


source to share


3 answers


UTF-8 is an encoding , a way of representing Unicode . Unicode is essentially a list of all characters, punctuation marks, spaces, etc. the user may need to render text.

You probably don't need any font that supports Arabic, Hindi, and Chinese, really very few fonts try to cover something like all the Uniocde code.



Many fonts are compatible with Unicode (most are currently), but you need to think about what parts of Unicode you want. Most fonts only try to cover multiple languages ​​or a group of related scripts such as Latin, Greek, and Cyrillic. For example, it looks like you want to illuminate Latin letters well, including accented forms.

It looks like you are only interested in Slab Serif fonts available through Google Web Fonts. I suggest you start by looking for Roboto Slab , which has decent coverage (including all those glyphs you use in your question) and comes in four weights.

+9


source


"Josefin Slab" (Google Fonts) only supports Latin characters.
You should find a font where you can choose the Latin Extended extension .

enter image description here



For example, "Josefin Sans" is such a font.

"//fonts.googleapis.com/css?family=Josefin+Sans" // Latin only, same issue
"//fonts.googleapis.com/css?family=Josefin+Sans&subset=latin,latin-ext" // WORKS!

      

+2


source


"UTF-8 font" doesn't make sense; UTF-8 is a way of specifying (or "encoding") the Unicode character values ​​that you want to display on the screen. If these characters exist in your font, they can be displayed. So what you want is a Unicode font and, yes, a lot and hellip; although most only support a subset of over 110,000 scripts and character sets.

For what it's worth, the snippet in your question renders me correctly using Chrome 39 on Windows 7; some other browsers don't render Unicode as well, so think about it.

+1


source







All Articles