Skip to content

use() functionality to import fonts #165

@rockstorm101

Description

@rockstorm101

This is somewhat a feature request more than an issue really as I guess I'm attempting something a bit borderline here. According to OpenSCAD docs one should be able to use fonts "importing" them like:
use <ttf/super-font/my-super-font-in-italics.ttf>

However, attempting such thing through SP via solid.use() does not work.

Traceback (most recent call last):
  File "/tmp/test/venv/lib/python3.9/site-packages/solid/objects.py", line 856, in use
    contents = scad_file_path.read_text()
  File "/usr/lib/python3.9/pathlib.py", line 1256, in read_text
    return f.read()
  File "/usr/lib/python3.9/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 16: invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/src/test.py", line 15, in <module>
    sp.use("../aux/awesome-font-bold.ttf")
  File "/tmp/test/venv/lib/python3.9/site-packages/solid/objects.py", line 858, in use
    raise Exception(f"Failed to import SCAD module '{scad_file_path}' with error: {e} ")
Exception: Failed to import SCAD module '../aux/awesome-font-bold.ttf' with error: 'utf-8' codec can't decode byte 0x92 in position 16: invalid start byte 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions