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
I suspect there is no "Vera.ttf" file. The code doesn't work for common windows "ttf" files. Do fonts need to be moved to a specific directory?
Windows 10 Pro
64-bit OS and processor
The error is:
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
= RESTART: C:\Users\jeff5\Desktop\Python\OpenGL_Exercises\freetypeExample.py =
Traceback (most recent call last):
File "C:\Users\jeff5\Desktop\Python\OpenGL_Exercises\freetypeExample.py", line 2, in
face = freetype.Face("Vera.ttf")
File "C:\Users\jeff5\AppData\Roaming\Python\Python36\site-packages\freetype_init_.py", line 989, in init
if error: raise FT_Exception( error )
freetype.ft_errors.FT_Exception: FT_Exception: (cannot open resource)
The text was updated successfully, but these errors were encountered:
Thank you madig. That did work! I was also able to get it to work by placing a ttf file in the directory with the example code file. It is outputting a bunch of comma delimited numbers to the Python 3.6.5 shell. The "r" before the path is a useful tip as I did not know that. Thx!
Hi,
I am new to Python programming. I don't know where else to post this issue. I installed freetype like this:
python -m pip install --user freetype-py
It seemed to install okay.
There is an error when the following code is run in IDLE:
import freetype
face = freetype.Face("Vera.ttf")
face.set_char_size( 48*64 )
face.load_char('S')
bitmap = face.glyph.bitmap
print (bitmap.buffer)
I suspect there is no "Vera.ttf" file. The code doesn't work for common windows "ttf" files. Do fonts need to be moved to a specific directory?
Windows 10 Pro
64-bit OS and processor
The error is:
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
= RESTART: C:\Users\jeff5\Desktop\Python\OpenGL_Exercises\freetypeExample.py =
Traceback (most recent call last):
File "C:\Users\jeff5\Desktop\Python\OpenGL_Exercises\freetypeExample.py", line 2, in
face = freetype.Face("Vera.ttf")
File "C:\Users\jeff5\AppData\Roaming\Python\Python36\site-packages\freetype_init_.py", line 989, in init
if error: raise FT_Exception( error )
freetype.ft_errors.FT_Exception: FT_Exception: (cannot open resource)
The text was updated successfully, but these errors were encountered: