Search code examples
pythonwxpythontruetypewxstyledtextctrlrichtextctrl

How can I load true type front (ttf) into wxPython from file directly


I'm working on a wxPython project with text editing capabilities. I want to package a font with this project (a .ttf file) and have it as the default font for the text editor. Can this be done in wxPython? There was a similar question in 2007 in the wxPython-users mailing list. At that time it was not possible. It's now seven years later and I'm hoping that someone came up with a solution for this.

I am currently using wx.richtextctrl for the text editing box. I might consider using wx.styledtextctrl instead if it helps to solve my problem.


Solution

  • No, wx can still only use fonts that are installed in the system. If you distribute your project using an installer then it can install the font and your application can access it by its facename.