Good Day
Maybe you can help me with a problem...
I'm trying to modify a macro that creates a Text Shape, and everything is fine if it is just 1 line, in my macro there is a form that asks for font size (in mm), font type and style
The problem is that it is designed to accept the text size in milimeters like this
Dim shTexto As ShapeshTexto.SetSize , sizeText
The thing is... that when it is a multiline text, the programming is that it only multiplies the size by the number of lines... so if we input a size of 4.5mm, when it is 1 line, it works, but 2 or more lines... it doesn't work, because the text shape will be 9mm, but the text size will be less because of the space between lines
is there a way to calculate the space between lines??
or a better way to do this??
Regards!
There are several possible ways to measure two lines of text ...
A: the distance ignoring descendersB: the distance allowing for descendersC: the distance allowing for inter-line spacing
To answer the question, it would be useful to know ...
Which version (A, B or C) do you think the macro is currently using, and which version would you like to measure it with?
If either answer is B, consider also ... is it still the same if the second line does not have any descenders?
Hi harryLondon
I did a test and it is using B, but I think it doesn't matter, since everything goes in Uppercase
the thing is that if I use a Height of 4.5mm with 1 line, everything is OK and expectedbut with 2 lines, I would expect that each individual line would be 4.5mm, so the end result would be 9mm + space between lines
So maybe in this case, the height should be C per your diagram, but right now it just does 4.5mm * 2 as the size
Do you think it is possible to account for the space between lines??? (it can be from 1 to 4 text lines, giving us 3 spaces between lines)
Thank you!
I know this thread is older, but I automate coreldraw with VB.net, and the concept should be the same.
I accumulate lines of text in a string with a for next loop and a newline at the end of each line of text.
I then create a creativeartistictext shape, using whatever font or font size i want and then CorelDraw will create the proper leading(space between lines).
If I want to increase or decrease the leading, I use a paragraph object and apply linespacing to the paragraph.
If that's not helpful I could post some code for you. What you're asking is something I do in a number of my programs right now, so I know it works. I don't know how much you have to change to get it to work in a macro instead of vb.net.