Skip to content

insert_text and overlapping text! . #3521

Discussion options

You must be logged in to vote

Several things may go wrong with this approach:

  • Even if old and new text contain the same number of characters and the same font size is used, this does not mean that the same written length comes out.
  • Even if old and new text have the same font (have they?) - because Helvetica is a proportional font (every character in principle has its own width).
  • Obviously, the border wrapping the text has been drawn after the original text's writing. You may need to insert new text in background (overlay=False) in the hope that this will improve things.

To exactly fill the original rectangle, use the morph parameter with a scaling matrix (fixpoint is the origin of course). The matrix should look like

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@yang-521
Comment options

@JorjMcKie
Comment options

Answer selected by Muhammadraafat1
Comment options

You must be logged in to vote
1 reply
@JorjMcKie
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants