This package ports part of the Unicode Character Database to Typst. Notably, it includes information from UnicodeData.txt and Blocks.txt.
Usage
This package defines a single function: codepoint
. It lets you get the information related to a specific codepoint. The codepoint can be specified as a string containing a single character, or with its value.
#codepoint("√").name \
#codepoint(sym.times).block.name \
#codepoint(0x00C9).general-category \
#codepoint(sym.eq).math-class
You can display a codepoint in the style of Template:Unichar using the show
entry:
#codepoint("¤").show \
#codepoint(sym.copyright).show \
#codepoint(0x1249).show \
#codepoint(0x100000).show
Changelog
Version 0.3.0
-
Add
math-class
attribute to codepoints.- Some codepoints have their math class overridden by Typst. This is the Unicode math class, not the one used by Typst.
-
The
id
of codepoints now returns a string without the"U+"
prefix.
Version 0.2.0
-
Codepoints now have an
id
attribute which is its corresponding “U+xxxx” string. -
The
block
attribute of a codepoint now contains aname
, astart
, and asize
. -
Fix an issue that made some codepoints cause a panic.
-
Include data from NameAlias.txt.
Version 0.1.0
- Add the
codepoint
function.