更改HTML中的Unicode字体 [英] Change unicode font in HTML
问题描述
我正在使用unicode以HTML格式显示棋子,但它们以错误的字体显示.他们应该是这样的:
I'm using unicode to display chess pieces in HTML, but they're displaying in the wrong font. Here's what they should look like:
它过去通常是这样显示的,但是由于某种原因,它现在显示为
It used to display like this, but now for some reason it's showing up as
维基百科页面表明这是由于特定字体 https://en.wikipedia.org/Wiki/Chess_symbols_in_Unicode ,但是我更改字体的尝试并未成功.
The wikipedia page suggests this is due to a specific font https://en.wikipedia.org/wiki/Chess_symbols_in_Unicode, but my attempts to change the font haven't been successful.
相关代码:
const pieces = {
pawn: {
worth: 1,
dna: '<p>♟</p>'
}
}
body.innerHTML += pieces.pawn.dna;
有什么主意如何使浏览器以不同的字体显示unicode? p>
Any ideas how to make the browser display the unicodes under a different font?
推荐答案
问题中显示的字体看起来是案例:
The font shown in your question looks to be Cases:
案例
免费软件.Matthieu Leschemelle的True Type字体.该字体最初是用Matthieu的程序Problemiste(用于解决国际象棋问题的程序)制作图表的.此后,Armando Marroquin重新设计了字体,现在可以将其用作独立字体".用于图形和小雕像符号,并带有坐标的框架是一种选择.
Freeware. True Type Font by Matthieu Leschemelle. The font was originally for making diagrams with Matthieu's program Problemiste, a program for solving chess problems. Armando Marroquin has since redesigned the font, and now it can be used as a "stand alone font" for diagrams and figurine notation and frame with co-ordinates is an option.
您可以查看和下载字体,例如在这里:
You can see and download the font e.g. here:
http://www.enpassant.dk/chess/fontimg/cases.htm
http://www.enpassant.dk/chess/downl/cases.zip
这篇关于更改HTML中的Unicode字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!