vispy text offline

34 views
Skip to first unread message

Shlomo Kut

unread,
Jul 8, 2020, 1:51:24 AM7/8/20
to vispy
Hi 

We need to target our vispy application to a machine without a connection to the internet.

Is there anyway to bypass vispy loading fonts from the internet?

Thanks for your time,

Shlomo Kut


Kai Muehlbauer

unread,
Jul 8, 2020, 2:10:30 AM7/8/20
to vi...@googlegroups.com
Hi Shlomo,

personally I've not touched those parts of the code. It would be very
helpful if you could support us with some more detail:

- OS and vispy-version (output of `vispy.sys_info()` will do).
- the error message you encounter when vispy is trying to load fonts
- any other information which might help us investigate

Please also consider to open an issue with problem description and the
above information detail at the vispy github issue tracker
https://github.com/vispy/vispy/issues

Thanks!

Cheers,
Kai


Am 08.07.20 um 07:51 schrieb Shlomo Kut:

Marius

unread,
Jul 8, 2020, 5:31:06 AM7/8/20
to vispy
Hi  Shlomo,

I don't know much on VisPy internals (I just use it and even that in a limited way) but I hit the same issue when using CX_freeze package to make an Windows installer and in my case the issue was not that I did not had an Internet connection available but because I had a freezed version of my app, the download was incomplete. I mean, VisPy tried to download the files (font and freetype dll) but it somehow failed, the downloaded files were only partially downloaded (smaller size). Of course that meant that VisPy did not work.

My solution was to use an advice I've read/was given and that was to have a local copy of the files. In my case, in the freezed app, VisPy rezided in lib/vispy and I've created in this folder another folder structure:

lib/vispy/data/fonts/opensans-regular.ttf
lib/vispy/data/freetype/freetype253.dll (for the x86 application)
lib/vispy/data/freetype/freetype253_x64.dll (for the x64 application)

The actual method for loading the files from Internet is here: 
vispy/util/fetching.py 
and is named: load_data_file()

If you do not use a freezed app then make sure that the `data` folder (and it's content) exists in the vispy data_path which can be read from the method:
 _get_vispy_app_dir() 
found in the file:
 vispy/util/config.py. 
It depends on the OS under which you run your app.
You could make a script to test if you already have the 'data' folder in place therefore copy the files from a local directory (inside your app) to the needed location on first run of your application
 
In case it helps, the location from where VisPy is trying to download is this one: 
and 

I hope this helps,
Marius
Reply all
Reply to author
Forward
0 new messages