Skip to content

Stretch or shrink text in one dimension only #1309

Answered by pointlessone
mslagell asked this question in Q&A
Discussion options

You must be logged in to vote

I don't believe there's a separate horizontal scale for text in PDF. PDF supports text matrices that are more general transformation mechanism but Prawn doesn't support it (apart from text rotation). Other than that you can manipulate user-space transformation with transformation_matrix. Just keep in mind that it will have effect on everything. For example, if you're drawing a box around text it might have uneven line thickness if you apply non-uniform scaling (i.e. for horizontal scaling side borders might be wider than top and bottom borders). To avoid that, only apply transformation to the text. This might also apply to text box sizes and margin boxes, I don't remember from the top of …

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mslagell
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants