Font Preview Returns to Blender 2.62

As my first contribution to Blender code I am working on adding Font Preview capability back to Blender 2.62 and beyond.

The first drafts are in Python with .c code following closely along.
Currently I have interfaced the file browser with a simple CHANNELS addition in Python. The picture below is a screen shot of that with some mock-up of Times New Roman added.


What I am currently working on adding:

  • preview changes to font when font file is clicked on
  • changeable preview phrases
  • showing multiple point sizes and styles like bold and italic

What I will eventually work on:

  • in the file list, having the font filenames display with the font style
  • fonts searched/filtered by characteristics like serifs, widths, slopes and weight

If you regularly use fonts and text in Blender please feel free to post requests on what features or capabilities would be of benefit to your workflow.

If you are a developer familiar with the font code in Blender and would like to collaborate on this project and other font related projects like improved kerning, tracking and leading then please drop by #blendercoders or #blenderpython and let’s have a chat. I am there regularly.

Thanks, JTA

Hi, this seems a great feature. Did you stop working on it?

I don’t think that kind of display is possible with the current Blender API. But go ahead and surprise us with a solution.

Thanks and yes, I am still working on the project, as well as a couple other projects so it is on the slow burner for the time being while I work on the .c code necessary to interface with bpy and depending on my paid work schedule.

I have been asking around on the chat channel and it does seem that the bpy api will not directly support this type of UI display as atom says. I even took the time to dig into some of the more obscure code.

So I am slowly working on some .c code now that I know what bpy does and does not do for fonts. I have learned quite a bit about bpy and coding blender so the time was not wasted.

wow… i need this right now! :smiley:

I feel you on that! I need it too! I have been slowly working on it and some other tools. My Blender Wiki page will be up soon with more information. I will post here ASAP when I get the first usable version of the font preview working. It will be a .c patch but I will try to expose as much as possible to BPYthon so it can be configured. Hopefully the .c patch will be integrated soon after it is done. I am also working on other font, titling and text motion graphics improvements for Blender.

I will be posting soon some VSE tools, one of which is making the file loading and management of multiple images fit a better slideshow workflow. I am also working on interoperability in integrating Inkscape and GIMP as a seamless titling solution for overlays with easy file updating. This workflow is especially focused on reducing click counts and improving speed in live events and broadcast video. So I have been busy. There will be lots to share soon.

Thanks, JTa

The ability to see your fonts before selecting would be wonderful… hope you can make it happen with the latest version of Blender and beyond.

Thanks for the feedback. Yes, when it gets added to trunk it will become a part of Blender and be in all the subsequent versions. Elubie, the file browser module owner is very supportive and helpful on this project. So hopefully that will help get it into Blender permanently. I just ran into some technical issues that slowed me down. Then some other projects took priority. It’s slow going but it’s still alive and well. : )

Very promising work! Keep it up!

Ok, it looks like I will have some coding time soon. I also setup my laptop to compile Blender finally so I can code on the move.

Where I am at currently is looking in to the new OpenGL improvements that will allow me to draw the font on the screen in a specific location. That solution still has some issues due to not having any good calls to query the screen location of elements. But, it’s still a nice and straight forward solution.

I am also looking at developing a new UI widget. I have that area of code isolated and am working on a simple test case to consider the feasibility. This also has the benefits of allowing selected font drawing for other purposes and even custom drawn UI elements for specialized purposes. I like the idea of some custom sliders being available down the road.

So again, most of the coding is done, I just need a good way to draw a selected font to the panel since there is no existing feature for this in Blender.

Thanks to all who are following this thread, it’s not dead yet! ;p

JTa

If you are wondering, yes we are still following :slight_smile:

Currently, my workflow for finding a font is:

  • Open the “font manager” (in ubuntu), and find the font I want
  • Find the name of the file of that font
  • Navigate to the folder in Blender

Your addon would solve the first two steps. And would be a first step to have a proper “font browser” in blender (as many applications already have). It should be a priority of the dev team IMHO.

So keep going, it’s something that will be very important to anyone doing motion graphics.

Thanks. Yes, I do motion graphics also for live events and it drives me nuts not having this. I have done a small amount of work on this project. My busy season for events is starting to wind down so I will be working on it some more. I have a BGL solution that I have been looking at based on some of CodeManX’s BGL py scripts.

I’ll keep everyone here posted and will post on BN if I get even a barely usable tool.

Talking with Elubie for the long term, she is supportive of having a full font browser in the file manager that will show all the fonts previews in the folder at one time in the browser file view area. Preview of only the selected font file is a good first step though for the current project. Thanks for your support and patience.

JT

Hello,

well speaking of Python and OpenGL… i did some (very basic) experiments only with Python / PyPy and PyOpenGL, i only got “pyglxgears” to run, and drawed a rounded reactangle, next step would be some attempt to replicate some widget drawing code from Blender (the OpenGL calls basically) in a much larger attempt to get some widgets and a viewport to run in pure python (outside blender). Only concern i have is performance, will try further with PyPy and maybe for c libs with cffi, PyOpenGL itself should be performant enough, as it directly wraps the C OpenGL libraries. But dont expect something useable in a short time, that is a LOT of work…

@scorpion81 Excellent idea. Psy-fi has been working on the widget code to make it more usable. These are promising improvements to Blender. Being able to do custom drawing on the UI for widgets will open up some excellent and needed solutions like Font Preview.

Hello JTA,

Hey :slight_smile: guys, will you include also a Key searching connection between top row (A) and all Font content below (B)… like on the example. Actually is that possible, cause right now is total mess, when I’m searching a specific Font. :slight_smile: Thanks for the new future…


@scorpion81, I think you are going down the wrong path in this. If you want fast, hardware accelerated, non-custom UI in Python outside of blender, you should look at kivy. It’s extremely fast, and uses Cython for a lot of performance critical things.

Currently, in my own opinion, blender’s UI API has zero value except that it integrates in blender. It lacks quite a few widgets, like a multi-line text editor for panels/dialogs instead of just in the text editor region, and in general the interplay of drawing and operators and so on feels very complicated compared to other frameworks like QT or Kivy.

I remember hearing somewhere that the core developers are writing a new UI library which is more python-centric and allows more customization and subclassing etc. That would be very nice to have, and I am looking forward to that.

@ivaydesign
I am not clear on what you are asking. Please give me more information.

And by the way, Plasmasolutions has taken on the job of doing the font preview code now.
https://developer.blender.org/D1002
Please do not leave feature requests on the patch page.

It was just today committed to master so it will be available with the buildbot builds as soon as they all catch up to master.

He has implemented the filename of the font showing the font style. He has not implemented the panel text preview that I have coded and posted above. I have linked him to this thread so he can reference that info.

Maybe I will open up a design page for people to comment on if I find the time.

Font preview for font file names in the file browser is now available in buildbot builds! Thanks to Plasmasolutions and the devs for making this happen finally. It is not as simple of a task as it would seem.

Good going Plasmasolutions/Thomas!

has anyone tried it on OSX? I just downloaded a build and it doesn’t seem to work


thanks:)

(edit)
tried this on the Gooseberry branch and it works, just not the standard buildbot version

@comeinandburn
It works in the windoze 64 version…make sure and load a font object, then use the load font from the panel and click on the thumbnails view. Make sure and post a bug report if it does not show up.

Also it needs to be a build that is after the commit. So make sure it’s a build from the 9th or later.