X3D/WRL Import: TextStyle - Font family, style not getting parsed #31

Closed
opened 2024-10-25 21:47:55 +02:00 by Cedric Steiert · 2 comments
Collaborator

Text importer:

def importText(geom, ancestry):

The current implementation does not take Font family (e.g. SANS), style (e.g. BOLD), justify (e.g. MIDDLE -> horizontal alignment), spacing (e.g. 1 -> line height/spacing) into account. Only size gets parsed atm.

justify and spacing should be easy to add. For the font family and style we'd have to lookup the system font files and find a matching one. For the implementation make sure we don't get "stuck" here, as import should work always regardless.

Attached some wrl files for testing.

Text importer: https://projects.blender.org/extensions/io_scene_x3d/src/commit/e68efebfb1c83493afe571b482a4469a20a3560b/source/import_x3d.py#L3181 The current implementation does not take Font family (e.g. SANS), style (e.g. BOLD), justify (e.g. MIDDLE -> horizontal alignment), spacing (e.g. 1 -> line height/spacing) into account. Only size gets parsed atm. justify and spacing should be easy to add. For the font family and style we'd have to lookup the system font files and find a matching one. For the implementation make sure we don't get "stuck" here, as import should work always regardless. Attached some wrl files for testing.
Cedric Steiert added the
enhancement
task
labels 2024-10-25 21:47:55 +02:00
Cedric Steiert changed title from X3D/WRL Import: TextStyle - Font family, style, justify, spacing not getting parsed to X3D/WRL Import: TextStyle - Font family, style not getting parsed 2024-11-04 12:50:17 +01:00
Author
Collaborator

justify and spacing is now getting parsed an applied. Style (bold/italic) and font family is a bit more tricky and thus still a todo.

justify and spacing is now getting parsed an applied. Style (bold/italic) and font family is a bit more tricky and thus still a todo.
Author
Collaborator

Attached file now imports with all properties set and font family inclusive variants set:
grafik

Attached file now imports with all properties set and font family inclusive variants set: ![grafik](/attachments/7bd42c06-d2d5-47f4-ad4d-f7e9f1ad8042)
Sign in to join this conversation.
No description provided.