CadQuery / CadQuery/cadquery

text cut with custom font breaks face

Open
#1,272 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
5.8k
Forks
541
Avg merge
3d 2h
Merged PRs (30d)
5

Description

Hey,

I tried to cut the text in a solid, using a custom font, but the upper face breaks. I tried three fonts:

- Quicksand-Bold.ttf
- Comfortaa-Bold-tff
- Nunito.ttf

All have the same effect:

![image](https://user-images.githubusercontent.com/36968958/218554604-05ea1b4c-e7e8-4c27-874a-167fb1a96fa2.png)

With default font it works fine:

![image](https://user-images.githubusercontent.com/36968958/218554729-c3183a9d-180a-43e5-bf13-23974c0db27f.png)

I used the following code:

```python
from jupyter_cadquery import (
Edges,
Faces,
Part,
PartGroup,
Vertices,
close_viewer,
close_viewers,
get_defaults,
get_viewer,
open_viewer,
set_defaults,
show,
)
from jupyter_cadquery.replay import disable_replay, enable_replay, replay, reset_replay

import cadquery as cq
from cadquery import exporters
import math
import os
set_defaults(axes=True, timeit=False, control="orbit")
cv = open_viewer("Examples", cad_width=640, height=480, glass=True)
enable_replay(False, False)
show_object = replay

circle_outer_end = 10
length = 30
thickness = 2
fillet = 0.6
text = "CQ"

c = length

directory = os.getcwd()

result = (
cq.Workplane("XY")
.moveTo(c, 0)
.circle(circle_outer_end)
.extrude(thickness, combine=True)
.edges()
.fillet(fillet)
.faces(">Z")
.workplane()
.center(c, 0)
.transformed(rotate=(0, 0, -90))
.text(
text,
fontsize=8,
distance=-0.5,
fontPath=os.path.join(directory, "phijn_font/Quicksand-Bold.ttf"),
cut=False,
kind="bold",
combine="cut",
clean=True
)
)

show(result)
```

On closer inspection I have the feeling the font is not properly converted to a solid:

![image](https://user-images.githubusercontent.com/36968958/218555158-8482b9a1-9774-4df3-9b41-3496a61ff866.png)

Can I do something on my side?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.