otuva / handwriting-synthesis

Handwriting Synthesis with RNNs ✏️ (Migrated to TensorFlow v2)
71 stars 32 forks source link

Customizable text align, surface dimensions #4

Open otuva opened 1 year ago

otuva commented 1 year ago

hand._draw.py

need to change

for text align (enum could be used: left, center, right)

strokes[:, 0] += (view_width - strokes[:, 0].max()) / 2

for dimensions

view_width = 1000
view_height = line_height * (len(strokes) + 1)
chadjemmett commented 1 year ago

Hi I'm working on aligning the text. Thanks for porting this to the new Tensorflow. It works great.

jopke commented 1 year ago

What I would like to see is ability to set a fixed width and have it word wrap. I will likely work on that a bit but if anyone has any thoughts or code I would be grateful.

otuva commented 1 year ago

What I would like to see is ability to set a fixed width and have it word wrap. I will likely work on that a bit but if anyone has any thoughts or code I would be grateful.

You can take average width of lines per character, and when a word exceeds the preset view width, it can break to a new line. It can have variable border spacing also by this logic. I might work on this perhaps