Skip to content

System fonts are not detected automatically #48

@sereg1k

Description

@sereg1k

V version: 0.1.24 bfaf2a4
VUI: 0.0.1 3030279
OS: Slackware 14.2 x86_64
System fonts:

fc-list | egrep "Arial.ttf|Ubuntu-R.ttf|LiberationSans-R|NotoSans-R|FreeSans.ttf|DejaVuSans.ttf" | sort
/usr/share/fonts/TTF/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/TTF/LiberationSans-Regular.ttf: Liberation Sans:style=Regular

What did you do?
v -g run examples/calculator.v

What did you expect to see?
Running calculator

What did you see instead?

C compiler=cc
ATTENTION: default value of option vblank_mode overridden by environment.
create window wnd=0x146d1c0 ptr==(nil)
================ V panic ================
   module: ui
 function: system_font_path()
     file: /home/sereg1k/.vmodules/ui/ui.v
     line: 147
  message: Please install at least one of: ["/usr/share/fonts/truetype/msttcorefonts/Arial.ttf", "/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-R.ttf", "/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf", "/usr/share/fonts/truetype/noto/NotoSans-Regular.ttf", "/usr/share/fonts/truetype/freefont/FreeSans.ttf", "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", "/usr/share/fonts/dejavu/DejaVuSans.ttf"]  .
=========================================
/media/data/install/dev/v/vlib/builtin/builtin.v:70: |       0x43288e | ./examples/calculator(panic_debug+0x123) 
/media/data/install/dev/ui/ui.v:148:           |       0x44d6ac | ./examples/calculator(ui__system_font_path+0x271) 
/media/data/install/dev/ui/window.v:78 (discriminator 4): |       0x44dcf0 | ./examples/calculator(ui__new_window+0x198) 
/media/data/install/dev/ui/examples/calculator.v:39: |       0x44f524 | ./examples/calculator(main__main+0x36a) 
/home/sereg1k/.cache/v/calculator.tmp.c:25951: |       0x4511cd | ./examples/calculator(main+0x59) 
                                               | 0x7f685c52a7d0 | /lib64/libc.so.6(__libc_start_main+0xf0) 
/glibc-tmp-95e0907d753adfc89f1c416310f2df8c/glibc-2.23/csu/../sysdeps/x86_64/start.S:121: |       0x418909 | ./examples/calculator(_start+0x29)

Workaround for this problem
Use environment variable VUI_FONT
VUI_FONT=/usr/share/fonts/TTF/DejaVuSans.ttf v -g run examples/calculator.v

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions