Pherakki / BlenderToolsForGFS

A Blender plugin for importing and exporting GFS files.
GNU General Public License v3.0
20 stars 1 forks source link

Use the `blf` module to accurately wrap the text for Blender versions v3.0+ #132

Closed Pherakki closed 8 months ago

Pherakki commented 9 months ago

Maintain a dictionary of characters and widths. When a new textwrap is encountered, create a set of characters from the input text. For each character not in the lookup table, measure the width with blf.dimensions(font_id, character) and record it in the table. Then, perform the text wrapping by adding words until the size would exceed the wrapping width and inserting newlines where required (how to deal with text without spaces?).

Pherakki commented 8 months ago

This is probably unnecessary...