gpt4 book ai didi

javascript - JS : How to determine if font have glyph for character?

转载 作者:太空宇宙 更新时间:2023-11-04 15:26:45 27 4
gpt4 key购买 nike

如何判断字体是否有字符字形?

这可能吗?

var a = glyph_exist('0x00A1')
console.log(a)

true or false

最佳答案

<强> Fontkit 似乎支持此用例:

Fontkit is an advanced font engine for Node and the browser, used by PDFKit. It supports many font formats, advanced glyph substitution and layout features, glyph path extraction, color emoji glyphs, font subsetting, and more.

[...]

font.hasGlyphForCodePoint(codePoint)

Returns whether there is glyph in the font for the given unicode code point.

关于javascript - JS : How to determine if font have glyph for character?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46696558/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com