OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   CorelDRAW/Corel DESIGNER VBA (http://forum.oberonplace.com/forumdisplay.php?f=16)
-   -   ...beat to death... (http://forum.oberonplace.com/showthread.php?t=1323)

SteveDude 30-01-2006 21:42

...beat to death...
 
Alex,

I don't really want to beat our conversation to death on CenterX and TopY, because I understand your reasoning completely.

When dealing with Text, CenterX works as desired as long as the alignment is set to match. At this point I don't even care why something worked in B6 but is off in the Gold, but what is needed is a consistant and reliable way of setting the top of an Ascending character at an exact location. What happened with one piece of code, text was set to have the ascender be at exactly 1/2 inch below the top of the page and it worked fine. For some reason in the gold it was no longer the case, but was 1/2 inck higher with 72 point type making it partly off the page. Who knows maybe my calculations were wrong, but I didn't touch the DLL between version change.

I haven't been on your site much, but probably should because I know I can learn some things from the master of the masters. I consider myself pretty good at work arounds and have found them for the problems I mentioned and I know you have your hands full, but I would like to see this happen. It's an important thing in the screen printing industry, especially fitting text to the bottom of a circle. Again in the gold the text fitting with ascender aligning at the bottom of the circle was off and I didn't use CenterX or TopY to calculate the positioning. In 12 using PlaceOnOtherSide worked great, but seems non functional in X3. Haven't tried it in the Gold Version.

Hope I didn't offend you, I was just having a bad day.

Steve

Alex 30-01-2006 22:04

Quote:

Originally Posted by SteveDude
Hope I didn't offend you, I was just having a bad day.

Of course not! Did I sound offended? If so, sorry, didn't mean to...

For people who don't know, we are continuing a conversaition from Corel newsgroups. Here is part of the question:

Quote:

Originally Posted by SteveDude
I have been using something like this to set the location of some artistic
text...

x = .ActivePage.CenterX
y = .ActivePage.TopY - Margin - ObjectHeight
Set s = .ActiveLayer.CreateArtisticText(x, y, strText$, , , ,
sngFontHeight, , , ,cdrCenterAlignment)

In B6 it aligned as expected. In the gold it aligns 1/2 inch higher than
before. I am getting the ObjectHeight by converting the FontHeight to the
document units. Same code, different results.

It is hard for me to say what is the problem without seeing all the code and the end result, but I agree that more font information would be very useful, such as placement of each text baseline, text ascenders and descenders, each character position on the page, bounding boxes of characters, words, lines, paragraphs... I hope that the next version will open up at least some of those :hush:

SteveDude 30-01-2006 22:44

File Name Inserter
 
Alex,

Try the File Name Inserter in DRAW X3 setting text in the top quadrant and you'll see what I mean.

Didn't realize it was yours.

Steve

Alex 31-01-2006 10:10

Steve,

I haven't tried the File Name Inserter yet (need to install it) but I did a quick test in CorelDRAW 12 and X3 and it seems to work the same way. Here are the sample code for v12:

Code:

Sub Test12()
    Dim x As Double, y As Double
    Dim txtSize As Double
    txtSize = 24
    x = ActivePage.SizeWidth / 2
    y = ActivePage.SizeHeight - ActiveDocument.ToUnits(txtSize, cdrPoint)
    ActiveLayer.CreateArtisticText x, y, "Text", Font:="Arial", _
                    Size:=txtSize, Alignment:=cdrCenterAlignment
End Sub

and X3:

Code:

Sub TestX3()
    Dim x As Double, y As Double
    Dim txtSize As Double
    txtSize = 24
    x = ActivePage.CenterX
    y = ActivePage.TopY - ActiveDocument.ToUnits(txtSize, cdrPoint)
    ActiveLayer.CreateArtisticText x, y, "Text", Font:="Arial", _
                    Size:=txtSize, Alignment:=cdrCenterAlignment
End Sub

The result is absolutely identical.

What am I doing differently?

SteveDude 01-02-2006 22:46

hmmmm...
 
Alex,

I did figure it out and know why the results were different in 12 and X3, but still don't know why it worked in B6 and not in the gold. As I said, in the DRAWings X3 Beta the results were different than straight out DRAW X3. For circle text text in 12, Place on other side worked, so therefore there were no issues with aligning text to the bottom of the path. In X3, it doesn't work (at least in B6 it didn't, I did log a bug on it). If you change the sizes of the font in the sample you show you will notice the placement is different, but yes it is identical in 12. In my version I compensated for the offset in font size differences so the placement would be same no matter what. It was that compensation I needed to change to make it work in the Gold. This is part of a new feature I am adding to the DRAWings X3 plugin, so I never noticed the problem in 12.

Steve


All times are GMT -5. The time now is 21:44.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com