Giter Club home page Giter Club logo

Comments (2)

madig avatar madig commented on May 26, 2024

Hi!
If you want to run the code from IDLE, you probably need to specify the full path to a TTF you want to render, try e.g.

import freetype
face = freetype.Face(r'C:\Windows\Fonts\arial.ttf')
face.set_char_size( 48*64 )
face.load_char('S')
bitmap = face.glyph.bitmap
print (bitmap.buffer)

Note the r in front of 'C:\Windows\Fonts\arial.ttf', this makes Windows paths work in Python.

from freetype-py.

jeff5048 avatar jeff5048 commented on May 26, 2024

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!

from freetype-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.