terrastruct / d2

D2 is a modern diagram scripting language that turns text to diagrams.
https://d2lang.com
Mozilla Public License 2.0
16.59k stars 417 forks source link

support latin-1 and geometric shape unicode chars #2100

Closed alixander closed 1 week ago

alixander commented 1 week ago

closes https://github.com/terrastruct/d2/issues/1811

Latin-1 and geometric shape unicode chars supported by the loaded font are measured correctly now. In the below example, the unicode for the bullseye is not supported for Source Sans Pro, so is still measured incorrectly. However, the coverage is much better

Screenshot 2024-09-16 at 10 27 24 AM

Note that it's possible to extend this further to all unicode chars, but it reduces performance by a lot (runtime of all tests went from 46s to 112s) for very little gain.