Pherakki / BlenderToolsForGFS

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

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

Closed Pherakki closed 1 year ago

Pherakki commented 1 year 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 1 year ago

This is probably unnecessary...