You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Warning: For others who find this, the solution below mysteriously stopped working. My solution at this link works (for now): Araq/pixels#2 (comment)
# From book: "Mastering Nim, 2nd Edition" Chapter 3import pixels
drawText50, 50, "hello world!", 30, Red
Error
/home/user/.nimble/pkgs2/pixels-0.1.0-d6b41f4a271e9eedfe1e6e8c13d7fb6f010b6c23/pixels.nim(12) drawText
Error: unhandled exception: font could not be created, SDL error Couldn't open /usr/share/fonts/TTF/FiraSans-Regular.ttf [SDLException]Error: execution of an external program failed: '/home/user/.cache/nim/ch03_text_d/ch03_text_4D8F0A24490781C34D568D66A34AA20B6C408DD8'
Fix
# Ch3 requires a text font.# Navigate to the directory where you're running your nim code. The below# command downloads to the current directory a font from nim's SDL2 library,# renames it to FiraSans-Regular, which is the font SDL2 is looking for.
wget https://github.com/nim-lang/sdl2/blob/master/examples/liberation-sans.ttf -O FiraSans-Regular.ttf
# The font is expected to be in /usr/shared/fonts/TTF, and you can put the font# there instead, which requires the use of sudo.
The text was updated successfully, but these errors were encountered:
Warning: For others who find this, the solution below mysteriously stopped working. My solution at this link works (for now):
Araq/pixels#2 (comment)
Error
Fix
The text was updated successfully, but these errors were encountered: