golang / freetype

The Freetype font rasterizer in the Go programming language.
Other
778 stars 183 forks source link

Vertical Text #56

Closed aragonet closed 6 years ago

aragonet commented 6 years ago

Is there a way to set a text in vertical?

I'd really appreciate that...

Thanks

nigeltao commented 6 years ago

Not currently. Sorry.

Wohlstand commented 6 years ago

You can just load every glyph individually and draw them yourself where you want (for example, put them randomly on any position of the screen). Means, for vertical text, you need to iterate Y offset by adding the height and some spacing between of letters, and keep X offset be same (or align glyphs to center if needed).

1l0 commented 6 years ago

Looks like that Glyph already has included a Vmetric in phantomPoints[2,3]. So somehow you could achieve vertical text in CJK fonts if you write the proper rasterizer for it... I want it too.

aragonet commented 6 years ago

Ok thanks for your help. At the end I made it by drawing the fonts in horizontal and then rotate the image...